< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.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(Int512Shuffle.class,
                                      (Int512Shuffle) s,
                                      (Int512Vector) v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Int512Vector compress(VectorMask<Integer> m) {
+         return (Int512Vector)
+             super.compressTemplate(Int512Mask.class,
+                                    (Int512Mask) m);  // specialize
+     }
+ 
+     @Override
+     @ForceInline
+     public Int512Vector expand(VectorMask<Integer> m) {
+         return (Int512Vector)
+             super.expandTemplate(Int512Mask.class,
+                                    (Int512Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public Int512Vector selectFrom(Vector<Integer> v) {
          return (Int512Vector)
              super.selectFromTemplate((Int512Vector) v);  // specialize

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

@@ -867,33 +892,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(Int512Mask.class, a, offset, (Int512Mask) 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(Int512Mask.class, bb, offset, (Int512Mask) m);  // specialize
+     IntVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Integer> m) {
+         return super.fromMemorySegment0Template(Int512Mask.class, ms, offset, (Int512Mask) m);  // specialize
      }
  
      @ForceInline
      @Override
      final

@@ -917,26 +928,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(Int512Mask.class, a, offset, (Int512Mask) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
-         super.intoByteBuffer0Template(Int512Mask.class, bb, offset, (Int512Mask) m);
+     void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Integer> m) {
+         super.intoMemorySegment0Template(Int512Mask.class, ms, offset, (Int512Mask) m);
      }
  
  
      // End of specialized low-level memory operations.
  
< prev index next >