mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8340079: Modify rearrange/selectFrom Vector API methods to perform wrapIndexes instead of checkIndexes
Reviewed-by: jbhateja, psandoz
This commit is contained in:
parent
d2e77089aa
commit
83dcb02d77
47 changed files with 663 additions and 148 deletions
|
@ -263,6 +263,20 @@ public class VectorSupport {
|
|||
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<?>> {
|
||||
|
@ -605,6 +619,23 @@ public class VectorSupport {
|
|||
return defaultImpl.apply(v, sh, m);
|
||||
}
|
||||
|
||||
public interface VectorSelectFromOp<V extends Vector<?>,
|
||||
M extends VectorMask<?>> {
|
||||
V apply(V v1, V v2, M m);
|
||||
}
|
||||
|
||||
@IntrinsicCandidate
|
||||
public static
|
||||
<V extends Vector<E>,
|
||||
M extends VectorMask<E>,
|
||||
E>
|
||||
V selectFromOp(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
|
||||
int length, V v1, V v2, M m,
|
||||
VectorSelectFromOp<V, M> defaultImpl) {
|
||||
assert isNonCapturingLambda(defaultImpl) : defaultImpl;
|
||||
return defaultImpl.apply(v1, v2, m);
|
||||
}
|
||||
|
||||
/* ============================================================================ */
|
||||
|
||||
public interface VectorBlendOp<V extends Vector<?>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue