< prev index next >

src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java

Print this page
@@ -39,10 +39,11 @@
  
      // Unary
      public static final int VECTOR_OP_ABS  = 0;
      public static final int VECTOR_OP_NEG  = 1;
      public static final int VECTOR_OP_SQRT = 2;
+     public static final int VECTOR_OP_BIT_COUNT = 3;
  
      // Binary
      public static final int VECTOR_OP_ADD  = 4;
      public static final int VECTOR_OP_SUB  = 5;
      public static final int VECTOR_OP_MUL  = 6;

@@ -74,10 +75,27 @@
  
      // Rotate operations
      public static final int VECTOR_OP_LROTATE = 24;
      public static final int VECTOR_OP_RROTATE = 25;
  
+     // Compression expansion operations
+     public static final int VECTOR_OP_COMPRESS = 26;
+     public static final int VECTOR_OP_EXPAND = 27;
+     public static final int VECTOR_OP_MASK_COMPRESS = 28;
+ 
+     // Leading/Trailing zeros count operations
+     public static final int VECTOR_OP_TZ_COUNT  = 29;
+     public static final int VECTOR_OP_LZ_COUNT  = 30;
+ 
+     // Reverse operation
+     public static final int VECTOR_OP_REVERSE   = 31;
+     public static final int VECTOR_OP_REVERSE_BYTES = 32;
+ 
+     // Compress and Expand Bits operation
+     public static final int VECTOR_OP_COMPRESS_BITS = 33;
+     public static final int VECTOR_OP_EXPAND_BITS = 34;
+ 
      // Math routines
      public static final int VECTOR_OP_TAN = 101;
      public static final int VECTOR_OP_TANH = 102;
      public static final int VECTOR_OP_SIN = 103;
      public static final int VECTOR_OP_SINH = 104;

@@ -361,11 +379,11 @@
      // Memory operations
  
      public interface LoadOperation<C,
                                     VM extends VectorPayload,
                                     S extends VectorSpecies<?>> {
-         VM load(C container, int index, S s);
+         VM load(C container, long index, S s);
      }
  
      @IntrinsicCandidate
      public static
      <C,

@@ -373,11 +391,11 @@
       E,
       S extends VectorSpecies<E>>
      VM load(Class<? extends VM> vmClass, Class<E> eClass,
              int length,
              Object base, long offset,
-             C container, int index, S s,
+             C container, long index, S s,
              LoadOperation<C, VM, S> defaultImpl) {
          assert isNonCapturingLambda(defaultImpl) : defaultImpl;
          return defaultImpl.load(container, index, s);
      }
  

@@ -385,11 +403,11 @@
  
      public interface LoadVectorMaskedOperation<C,
                                                 V extends Vector<?>,
                                                 S extends VectorSpecies<?>,
                                                 M extends VectorMask<?>> {
-         V load(C container, int index, S s, M m);
+         V load(C container, long index, S s, M m);
      }
  
      @IntrinsicCandidate
      public static
      <C,

@@ -398,11 +416,11 @@
       S extends VectorSpecies<E>,
       M extends VectorMask<E>>
      V loadMasked(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
                   int length,
                   Object base, long offset,
-                  M m, C container, int index, S s,
+                  M m, C container, long index, S s,
                   LoadVectorMaskedOperation<C, V, S, M> defaultImpl) {
          assert isNonCapturingLambda(defaultImpl) : defaultImpl;
          return defaultImpl.load(container, index, s, m);
      }
  

@@ -435,31 +453,31 @@
      }
  
      /* ============================================================================ */
  
      public interface StoreVectorOperation<C,
-                                           V extends Vector<?>> {
-         void store(C container, int index, V v);
+                                           V extends VectorPayload> {
+         void store(C container, long index, V v);
      }
  
      @IntrinsicCandidate
      public static
      <C,
-      V extends Vector<?>>
+      V extends VectorPayload>
      void store(Class<?> vClass, Class<?> eClass,
                 int length,
                 Object base, long offset,
-                V v, C container, int index,
+                V v, C container, long index,
                 StoreVectorOperation<C, V> defaultImpl) {
          assert isNonCapturingLambda(defaultImpl) : defaultImpl;
          defaultImpl.store(container, index, v);
      }
  
      public interface StoreVectorMaskedOperation<C,
                                                  V extends Vector<?>,
                                                  M extends VectorMask<?>> {
-         void store(C container, int index, V v, M m);
+         void store(C container, long index, V v, M m);
      }
  
      @IntrinsicCandidate
      public static
      <C,

@@ -467,11 +485,11 @@
       M extends VectorMask<E>,
       E>
      void storeMasked(Class<? extends V> vClass, Class<M> mClass, Class<E> eClass,
                       int length,
                       Object base, long offset,
-                      V v, M m, C container, int index,
+                      V v, M m, C container, long index,
                       StoreVectorMaskedOperation<C, V, M> defaultImpl) {
          assert isNonCapturingLambda(defaultImpl) : defaultImpl;
          defaultImpl.store(container, index, v, m);
      }
  

@@ -624,10 +642,30 @@
          return defaultImpl.apply(v, s);
      }
  
      /* ============================================================================ */
  
+     public interface ComExpOperation<V extends Vector<?>,
+                                      M extends VectorMask<?>> {
+         VectorPayload apply(V v, M m);
+     }
+ 
+     @IntrinsicCandidate
+     public static
+     <V extends Vector<E>,
+      M extends VectorMask<E>,
+      E>
+     VectorPayload comExpOp(int opr,
+                            Class<? extends V> vClass, Class<? extends M> mClass, Class<E> eClass,
+                            int length, V v, M m,
+                            ComExpOperation<V, M> defaultImpl) {
+         assert isNonCapturingLambda(defaultImpl) : defaultImpl;
+         return defaultImpl.apply(v, m);
+     }
+ 
+     /* ============================================================================ */
+ 
      @IntrinsicCandidate
      public static
      <VP extends VectorPayload>
      VP maybeRebox(VP v) {
          // The fence is added here to avoid memory aliasing problems in C2 between scalar & vector accesses.
< prev index next >