< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.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.*;
  

@@ -462,10 +462,26 @@
              super.rearrangeTemplate(Long128Shuffle.class,
                                      (Long128Shuffle) s,
                                      (Long128Vector) v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Long128Vector compress(VectorMask<Long> m) {
+         return (Long128Vector)
+             super.compressTemplate(Long128Mask.class,
+                                    (Long128Mask) m);  // specialize
+     }
+ 
+     @Override
+     @ForceInline
+     public Long128Vector expand(VectorMask<Long> m) {
+         return (Long128Vector)
+             super.expandTemplate(Long128Mask.class,
+                                    (Long128Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public Long128Vector selectFrom(Vector<Long> v) {
          return (Long128Vector)
              super.selectFromTemplate((Long128Vector) v);  // specialize

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

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

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