< prev index next >

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

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

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

@@ -902,26 +913,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<Short> m) {
-         super.intoByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
-         super.intoByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m);
+     void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<Short> m) {
+         super.intoMemorySegment0Template(Short128Mask.class, ms, offset, (Short128Mask) m);
      }
  
      @ForceInline
      @Override
      final
< prev index next >