< prev index next >

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

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

@@ -827,33 +852,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(LongMaxMask.class, a, offset, (LongMaxMask) 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(LongMaxMask.class, bb, offset, (LongMaxMask) m);  // specialize
+     LongVector fromMemorySegment0(MemorySegment ms, long offset, VectorMask<Long> m) {
+         return super.fromMemorySegment0Template(LongMaxMask.class, ms, offset, (LongMaxMask) m);  // specialize
      }
  
      @ForceInline
      @Override
      final

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