< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java

Print this page
@@ -22,15 +22,15 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  package jdk.incubator.vector;
  
- import java.nio.ByteBuffer;
  import java.util.Arrays;
  import java.util.Objects;
  import java.util.function.IntUnaryOperator;
  
+ import jdk.incubator.foreign.MemorySegment;
  import jdk.internal.vm.annotation.ForceInline;
  import jdk.internal.vm.vector.VectorSupport;
  
  import static jdk.internal.vm.vector.VectorSupport.*;
  

@@ -472,10 +472,26 @@
              super.rearrangeTemplate(IntMaxShuffle.class,
                                      (IntMaxShuffle) s,
                                      (IntMaxVector) v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public IntMaxVector compress(VectorMask<Integer> m) {
+         return (IntMaxVector)
+             super.compressTemplate(IntMaxMask.class,
+                                    (IntMaxMask) m);  // specialize
+     }
+ 
+     @Override
+     @ForceInline
+     public IntMaxVector expand(VectorMask<Integer> m) {
+         return (IntMaxVector)
+             super.expandTemplate(IntMaxMask.class,
+                                    (IntMaxMask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public IntMaxVector selectFrom(Vector<Integer> v) {
          return (IntMaxVector)
              super.selectFromTemplate((IntMaxVector) v);  // specialize

@@ -645,10 +661,19 @@
          @ForceInline
          public IntMaxMask not() {
              return xor(maskAll(true));
          }
  
+         @Override
+         @ForceInline
+         public IntMaxMask compress() {
+             return (IntMaxMask)VectorSupport.comExpOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
+                 IntMaxVector.class, IntMaxMask.class, ETYPE, VLENGTH, null, this,
+                 (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount()));
+         }
+ 
+ 
          // Binary operations
  
          @Override
          @ForceInline
          public IntMaxMask and(VectorMask<Integer> mask) {

@@ -848,33 +873,19 @@
  
  
      @ForceInline
      @Override
      final
-     IntVector fromByteArray0(byte[] a, int offset) {
-         return super.fromByteArray0Template(a, offset);  // specialize
+     IntVector fromMemorySegment0(MemorySegment ms, long offset) {
+         return super.fromMemorySegment0Template(ms, offset);  // specialize
      }
  
      @ForceInline
      @Override
      final
-     IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
-         return super.fromByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     IntVector fromByteBuffer0(ByteBuffer bb, int offset) {
-         return super.fromByteBuffer0Template(bb, offset);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
-         return super.fromByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m);  // specialize
+     IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Integer> m) {
+         return super.fromMemorySegment0Template(IntMaxMask.class, ms, offset, (IntMaxMask) m);  // specialize
      }
  
      @ForceInline
      @Override
      final

@@ -898,26 +909,12 @@
  
  
      @ForceInline
      @Override
      final
-     void intoByteArray0(byte[] a, int offset) {
-         super.intoByteArray0Template(a, offset);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
-         super.intoByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
-         super.intoByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m);
+     void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Integer> m) {
+         super.intoMemorySegment0Template(IntMaxMask.class, ms, offset, (IntMaxMask) m);
      }
  
  
      // End of specialized low-level memory operations.
  
< prev index next >