8310691: [REDO] [vectorapi] Refactor VectorShuffle implementation

Reviewed-by: psandoz, jbhateja, epeter
This commit is contained in:
Quan Anh Mai 2024-12-12 03:08:37 +00:00
parent 4da6fd4283
commit 75cfb640a6
64 changed files with 4006 additions and 2423 deletions

View file

@ -234,56 +234,6 @@ public class VectorSupport {
return defaultImpl.apply(offset, limit);
}
/* ============================================================================ */
public interface ShuffleIotaOperation<S extends VectorSpecies<?>,
SH extends VectorShuffle<?>> {
SH apply(int length, int start, int step, S s);
}
@IntrinsicCandidate
public static
<E,
S extends VectorSpecies<E>,
SH extends VectorShuffle<E>>
SH shuffleIota(Class<E> eClass, Class<? extends SH> shClass, S s,
int length,
int start, int step, int wrap,
ShuffleIotaOperation<S, SH> defaultImpl) {
assert isNonCapturingLambda(defaultImpl) : defaultImpl;
return defaultImpl.apply(length, start, step, s);
}
public interface ShuffleToVectorOperation<V extends Vector<?>,
SH extends VectorShuffle<?>> {
V apply(SH sh);
}
@IntrinsicCandidate
public static
<V extends Vector<E>,
SH extends VectorShuffle<E>,
E>
V shuffleToVector(Class<? extends Vector<E>> vClass, Class<E> eClass, Class<? extends SH> shClass, SH sh,
int length,
ShuffleToVectorOperation<V, SH> defaultImpl) {
assert isNonCapturingLambda(defaultImpl) : defaultImpl;
return defaultImpl.apply(sh);
}
public interface WrapShuffleIndexesOperation<SH extends VectorShuffle<?>> {
SH apply(SH sh);
}
@IntrinsicCandidate
public static
<E,
SH extends VectorShuffle<E>>
SH wrapShuffleIndexes(Class<E> eClass, Class<? extends SH> shClass, SH sh, int length,
WrapShuffleIndexesOperation<SH> defaultImpl) {
assert isNonCapturingLambda(defaultImpl) : defaultImpl;
return defaultImpl.apply(sh);
}
/* ============================================================================ */
public interface IndexOperation<V extends Vector<?>,
S extends VectorSpecies<?>> {