< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template

Print this page
*** 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.internal.vm.annotation.ForceInline;
  import jdk.internal.vm.vector.VectorSupport;
  
  import static jdk.internal.vm.vector.VectorSupport.*;
  
--- 22,15 ---
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  package jdk.incubator.vector;
  
  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.*;
  

*** 478,10 ***
--- 478,26 ---
              super.rearrangeTemplate($shuffletype$.class,
                                      ($shuffletype$) s,
                                      ($vectortype$) v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public $vectortype$ compress(VectorMask<$Boxtype$> m) {
+         return ($vectortype$)
+             super.compressTemplate($masktype$.class,
+                                    ($masktype$) m);  // specialize
+     }
+ 
+     @Override
+     @ForceInline
+     public $vectortype$ expand(VectorMask<$Boxtype$> m) {
+         return ($vectortype$)
+             super.expandTemplate($masktype$.class,
+                                    ($masktype$) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public $vectortype$ selectFrom(Vector<$Boxtype$> v) {
          return ($vectortype$)
              super.selectFromTemplate(($vectortype$) v);  // specialize

*** 918,10 ***
--- 934,19 ---
          @ForceInline
          public $masktype$ not() {
              return xor(maskAll(true));
          }
  
+         @Override
+         @ForceInline
+         public $masktype$ compress() {
+             return ($masktype$)VectorSupport.comExpOp(VectorSupport.VECTOR_OP_MASK_COMPRESS,
+                 $vectortype$.class, $masktype$.class, ETYPE, VLENGTH, null, this,
+                 (v1, m1) -> VSPECIES.iota().compare(VectorOperators.LT, m1.trueCount()));
+         }
+ 
+ 
          // Binary operations
  
          @Override
          @ForceInline
          public $masktype$ and(VectorMask<$Boxtype$> mask) {

*** 1157,33 ***
  #end[byte]
  
      @ForceInline
      @Override
      final
!     $abstractvectortype$ fromByteArray0(byte[] a, int offset) {
!         return super.fromByteArray0Template(a, offset);  // specialize
      }
  
      @ForceInline
      @Override
      final
!     $abstractvectortype$ fromByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) {
!         return super.fromByteArray0Template($masktype$.class, a, offset, ($masktype$) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     $abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset) {
-         return super.fromByteBuffer0Template(bb, offset);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     $abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) {
-         return super.fromByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m);  // specialize
      }
  
      @ForceInline
      @Override
      final
--- 1182,19 ---
  #end[byte]
  
      @ForceInline
      @Override
      final
!     $abstractvectortype$ fromMemorySegment0(MemorySegment ms, long offset) {
!         return super.fromMemorySegment0Template(ms, offset);  // specialize
      }
  
      @ForceInline
      @Override
      final
!     $abstractvectortype$ fromMemorySegment0(MemorySegment ms, long offset, VectorMask<$Boxtype$> m) {
!         return super.fromMemorySegment0Template($masktype$.class, ms, offset, ($masktype$) m);  // specialize
      }
  
      @ForceInline
      @Override
      final

*** 1217,26 ***
  #end[byte]
  
      @ForceInline
      @Override
      final
!     void intoByteArray0(byte[] a, int offset) {
!         super.intoByteArray0Template(a, offset);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) {
-         super.intoByteArray0Template($masktype$.class, a, offset, ($masktype$) m);  // specialize
-     }
- 
-     @ForceInline
-     @Override
-     final
-     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) {
-         super.intoByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m);
      }
  
  #if[short]
      @ForceInline
      @Override
--- 1228,12 ---
  #end[byte]
  
      @ForceInline
      @Override
      final
!     void intoMemorySegment0(MemorySegment ms, long offset, VectorMask<$Boxtype$> m) {
!         super.intoMemorySegment0Template($masktype$.class, ms, offset, ($masktype$) m);
      }
  
  #if[short]
      @ForceInline
      @Override
< prev index next >