Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8287289: Gather/Scatter with Index Vector #213

Closed
wants to merge 9 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -413,118 +413,6 @@ public class ScopedMemoryAccess {
}
}

@ForceInline
public static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
S extends VectorSupport.VectorSpecies<E>,
M extends VectorSupport.VectorMask<E>,
E, IE>
V loadFromMemorySegmentWithMap(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
AbstractMemorySegmentImpl msp, IV offsetMap, S s,
VectorSupport.LoadVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, S, M, E, IE> defaultImpl) {
// @@@ Smarter alignment checking if accessing heap segment backing non-byte[] array
if (msp.maxAlignMask() > 1) {
throw new IllegalArgumentException();
}

try {
return loadFromMemorySegmentWithMapScopedInternal(
msp.sessionImpl(),
vClass, mClass, eClass,
length, ivClass, ieClass,
msp, offsetMap, s,
defaultImpl);
} catch (ScopedAccessError ex) {
throw ex.newRuntimeException();
}
}

@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
S extends VectorSupport.VectorSpecies<E>,
M extends VectorSupport.VectorMask<E>,
E, IE>
V loadFromMemorySegmentWithMapScopedInternal(MemorySessionImpl session,
Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
AbstractMemorySegmentImpl msp, IV offsetMap, S s,
VectorSupport.LoadVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, S, M, E, IE> defaultImpl){
try {
session.checkValidStateRaw();

return VectorSupport.<AbstractMemorySegmentImpl, V, IV, S, M, E, IE>loadWithMap(
vClass, mClass, eClass,
length, ivClass, ieClass,
msp.unsafeGetBase(), msp.unsafeGetOffset(),
offsetMap, 1L, null,
msp, s,
defaultImpl);
} finally {
Reference.reachabilityFence(session);
}
}

@ForceInline
public static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
S extends VectorSupport.VectorSpecies<E>,
M extends VectorSupport.VectorMask<E>,
E, IE>
V loadFromMemorySegmentWithMapMasked(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
AbstractMemorySegmentImpl msp, IV offsetMap, M m, S s,
VectorSupport.LoadVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, S, M, E, IE> defaultImpl) {
// @@@ Smarter alignment checking if accessing heap segment backing non-byte[] array
if (msp.maxAlignMask() > 1) {
throw new IllegalArgumentException();
}

try {
return loadFromMemorySegmentWithMapMaskedScopedInternal(
msp.sessionImpl(),
vClass, mClass, eClass,
length, ivClass, ieClass,
msp, offsetMap, m, s,
defaultImpl);
} catch (ScopedAccessError ex) {
throw ex.newRuntimeException();
}
}

@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
S extends VectorSupport.VectorSpecies<E>,
M extends VectorSupport.VectorMask<E>,
E, IE>
V loadFromMemorySegmentWithMapMaskedScopedInternal(MemorySessionImpl session,
Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
AbstractMemorySegmentImpl msp, IV offsetMap, M m, S s,
VectorSupport.LoadVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, S, M, E, IE> defaultImpl){
try {
session.checkValidStateRaw();

return VectorSupport.loadWithMap(
vClass, mClass, eClass,
length, ivClass, ieClass,
msp.unsafeGetBase(), msp.unsafeGetOffset(),
offsetMap, 1L, m,
msp, s,
defaultImpl);
} finally {
Reference.reachabilityFence(session);
}
}

@ForceInline
public static
<V extends VectorSupport.Vector<E>, E>
@@ -617,115 +505,6 @@ public class ScopedMemoryAccess {
}
}

@ForceInline
public static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
M extends VectorSupport.VectorMask<E>,
E, IE>
void storeIntoMemorySegmentWithMap(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
V v, AbstractMemorySegmentImpl msp, IV offsetMap,
VectorSupport.StoreVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, M, E, IE> defaultImpl) {
// @@@ Smarter alignment checking if accessing heap segment backing non-byte[] array
if (msp.maxAlignMask() > 1) {
throw new IllegalArgumentException();
}

try {
storeIntoMemorySegmentWithMapScopedInternal(
msp.sessionImpl(),
vClass, mClass, eClass,
length, ivClass, ieClass,
v, msp, offsetMap,
defaultImpl);
} catch (ScopedAccessError ex) {
throw ex.newRuntimeException();
}
}

@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
M extends VectorSupport.VectorMask<E>,
E, IE>
void storeIntoMemorySegmentWithMapScopedInternal(MemorySessionImpl session,
Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
V v, AbstractMemorySegmentImpl msp, IV offsetMap,
VectorSupport.StoreVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, M, E, IE> defaultImpl){
try {
session.checkValidStateRaw();

VectorSupport.storeWithMap(
vClass, mClass, eClass,
length, ivClass, ieClass,
msp.unsafeGetBase(), msp.unsafeGetOffset(),
offsetMap, 1L, null,
v, msp,
defaultImpl);
} finally {
Reference.reachabilityFence(session);
}
}

@ForceInline
public static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
S extends VectorSupport.VectorSpecies<E>,
M extends VectorSupport.VectorMask<E>,
E, IE>
void storeIntoMemorySegmentWithMapMasked(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
V v, AbstractMemorySegmentImpl msp, IV offsetMap, M m,
VectorSupport.StoreVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, M, E, IE> defaultImpl) {
// @@@ Smarter alignment checking if accessing heap segment backing non-byte[] array
if (msp.maxAlignMask() > 1) {
throw new IllegalArgumentException();
}

try {
storeIntoMemorySegmentWithMapMaskedScopedInternal(
msp.sessionImpl(),
vClass, mClass, eClass,
length, ivClass, ieClass,
v, msp, offsetMap, m,
defaultImpl);
} catch (ScopedAccessError ex) {
throw ex.newRuntimeException();
}
}

@Scoped
@ForceInline
private static
<V extends VectorSupport.Vector<E>,
IV extends VectorSupport.Vector<IE>,
M extends VectorSupport.VectorMask<E>,
E, IE>
void storeIntoMemorySegmentWithMapMaskedScopedInternal(MemorySessionImpl session,
Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
int length, Class<? extends IV> ivClass, Class<IE> ieClass,
V v, AbstractMemorySegmentImpl msp, IV offsetMap, M m,
VectorSupport.StoreVectorOperationWithMap<AbstractMemorySegmentImpl, V, IV, M, E, IE> defaultImpl){
try {
session.checkValidStateRaw();

VectorSupport.storeWithMap(
vClass, mClass, eClass,
length, ivClass, ieClass,
msp.unsafeGetBase(), msp.unsafeGetOffset(),
offsetMap, 1L, m,
v, msp,
defaultImpl);
} finally {
Reference.reachabilityFence(session);
}
}

// typed-ops here

// Note: all the accessor methods defined below take advantage of argument type profiling
Original file line number Diff line number Diff line change
@@ -928,22 +928,6 @@ ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m,
return super.fromMemorySegment0Template(Byte128Mask.class, ms, offset, (Byte128Mask) m, offsetInRange); // specialize
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
return super.fromMemorySegment0Template(Byte128Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
return super.fromMemorySegment0Template(Byte128Mask.class, ivClass, ieClass, ms, offsetMap, (Byte128Mask) m);
}

@ForceInline
@Override
final
@@ -988,22 +972,6 @@ void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte128Mask.class, ms, offset, (Byte128Mask) m);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
super.intoMemorySegment0Template(Byte128Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte128Mask.class, ivClass, ieClass, ms, offsetMap, (Byte128Mask) m);
}


// End of specialized low-level memory operations.

Original file line number Diff line number Diff line change
@@ -960,22 +960,6 @@ ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m,
return super.fromMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m, offsetInRange); // specialize
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
return super.fromMemorySegment0Template(Byte256Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
return super.fromMemorySegment0Template(Byte256Mask.class, ivClass, ieClass, ms, offsetMap, (Byte256Mask) m);
}

@ForceInline
@Override
final
@@ -1020,22 +1004,6 @@ void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte256Mask.class, ms, offset, (Byte256Mask) m);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
super.intoMemorySegment0Template(Byte256Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte256Mask.class, ivClass, ieClass, ms, offsetMap, (Byte256Mask) m);
}


// End of specialized low-level memory operations.

Original file line number Diff line number Diff line change
@@ -1024,22 +1024,6 @@ ByteVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m,
return super.fromMemorySegment0Template(Byte512Mask.class, ms, offset, (Byte512Mask) m, offsetInRange); // specialize
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
return super.fromMemorySegment0Template(Byte512Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
ByteVector fromMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
return super.fromMemorySegment0Template(Byte512Mask.class, ivClass, ieClass, ms, offsetMap, (Byte512Mask) m);
}

@ForceInline
@Override
final
@@ -1084,22 +1068,6 @@ void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte512Mask.class, ms, offset, (Byte512Mask) m);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap) {
super.intoMemorySegment0Template(Byte512Mask.class, ivClass, ieClass, ms, offsetMap);
}

@ForceInline
@Override
final
<IV extends Vector<IE>, IE>
void intoMemorySegment0(Class<? extends IV> ivClass, Class<IE> ieClass, MemorySegment ms, IV offsetMap, VectorMask<Byte> m) {
super.intoMemorySegment0Template(Byte512Mask.class, ivClass, ieClass, ms, offsetMap, (Byte512Mask) m);
}


// End of specialized low-level memory operations.

Loading