< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorIntrinsics.java
Print this page
rev 50140 : Vector cast support
@@ -222,10 +222,25 @@
return defaultImpl.apply(v, toElementType);
}
/* ============================================================================ */
+ interface VectorCastOp<VT, VF> {
+ VT apply(VF v, Class<?> elementType);
+ }
+
+ @HotSpotIntrinsicCandidate
+ static
+ <VT, VF>
+ VT cast(Class<VF> fromVectorClass, Class<?> fromElementType, int fromVLen,
+ Class<?> toElementType, int toVLen, VF v,
+ VectorCastOp<VT,VF> defaultImpl) {
+ return defaultImpl.apply(v, toElementType);
+ }
+
+ /* ============================================================================ */
+
@HotSpotIntrinsicCandidate
static <V> V maybeRebox(V v) {
// The fence is added here to avoid memory aliasing problems in C2 between scalar & vector accesses.
// TODO: move the fence generation into C2. Generate only when reboxing is taking place.
U.loadFence();
< prev index next >