< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java

Print this page
*** 234,12 ***
                                (Byte64Mask)m, f);  // specialize
      }
  
      @ForceInline
      final @Override
!     byte rOp(byte v, FBinOp f) {
!         return super.rOpTemplate(v, f);  // specialize
      }
  
      @Override
      @ForceInline
      public final <F>
--- 234,12 ---
                                (Byte64Mask)m, f);  // specialize
      }
  
      @ForceInline
      final @Override
!     byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
!         return super.rOpTemplate(v, m, f);  // specialize
      }
  
      @Override
      @ForceInline
      public final <F>

*** 271,32 ***
      @ForceInline
      public Byte64Vector lanewise(Unary op) {
          return (Byte64Vector) super.lanewiseTemplate(op);  // specialize
      }
  
      @Override
      @ForceInline
      public Byte64Vector lanewise(Binary op, Vector<Byte> v) {
          return (Byte64Vector) super.lanewiseTemplate(op, v);  // specialize
      }
  
      /*package-private*/
      @Override
      @ForceInline Byte64Vector
      lanewiseShift(VectorOperators.Binary op, int e) {
          return (Byte64Vector) super.lanewiseShiftTemplate(op, e);  // specialize
      }
  
      /*package-private*/
      @Override
      @ForceInline
      public final
      Byte64Vector
!     lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
          return (Byte64Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
      }
  
      @Override
      @ForceInline
      public final
      Byte64Vector addIndex(int scale) {
          return (Byte64Vector) super.addIndexTemplate(scale);  // specialize
--- 271,59 ---
      @ForceInline
      public Byte64Vector lanewise(Unary op) {
          return (Byte64Vector) super.lanewiseTemplate(op);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Byte64Vector lanewise(Unary op, VectorMask<Byte> m) {
+         return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, (Byte64Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public Byte64Vector lanewise(Binary op, Vector<Byte> v) {
          return (Byte64Vector) super.lanewiseTemplate(op, v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Byte64Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
+         return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v, (Byte64Mask) m);  // specialize
+     }
+ 
      /*package-private*/
      @Override
      @ForceInline Byte64Vector
      lanewiseShift(VectorOperators.Binary op, int e) {
          return (Byte64Vector) super.lanewiseShiftTemplate(op, e);  // specialize
      }
  
+     /*package-private*/
+     @Override
+     @ForceInline Byte64Vector
+     lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
+         return (Byte64Vector) super.lanewiseShiftTemplate(op, Byte64Mask.class, e, (Byte64Mask) m);  // specialize
+     }
+ 
      /*package-private*/
      @Override
      @ForceInline
      public final
      Byte64Vector
!     lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
          return (Byte64Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public final
+     Byte64Vector
+     lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
+         return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v1, v2, (Byte64Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public final
      Byte64Vector addIndex(int scale) {
          return (Byte64Vector) super.addIndexTemplate(scale);  // specialize

*** 312,11 ***
  
      @Override
      @ForceInline
      public final byte reduceLanes(VectorOperators.Associative op,
                                      VectorMask<Byte> m) {
!         return super.reduceLanesTemplate(op, m);  // specialized
      }
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op) {
--- 339,11 ---
  
      @Override
      @ForceInline
      public final byte reduceLanes(VectorOperators.Associative op,
                                      VectorMask<Byte> m) {
!         return super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m);  // specialized
      }
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op) {

*** 325,11 ***
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op,
                                          VectorMask<Byte> m) {
!         return (long) super.reduceLanesTemplate(op, m);  // specialized
      }
  
      @ForceInline
      public VectorShuffle<Byte> toShuffle() {
          return super.toShuffleTemplate(Byte64Shuffle.class); // specialize
--- 352,11 ---
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op,
                                          VectorMask<Byte> m) {
!         return (long) super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m);  // specialized
      }
  
      @ForceInline
      public VectorShuffle<Byte> toShuffle() {
          return super.toShuffleTemplate(Byte64Shuffle.class); // specialize

*** 361,10 ***
--- 388,17 ---
      @ForceInline
      public final Byte64Mask compare(Comparison op, long s) {
          return super.compareTemplate(Byte64Mask.class, op, s);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public final Byte64Mask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
+         return super.compareTemplate(Byte64Mask.class, op, v, (Byte64Mask) m);
+     }
+ 
+ 
      @Override
      @ForceInline
      public Byte64Vector blend(Vector<Byte> v, VectorMask<Byte> m) {
          return (Byte64Vector)
              super.blendTemplate(Byte64Mask.class,

*** 417,10 ***
--- 451,11 ---
      @ForceInline
      public Byte64Vector rearrange(VectorShuffle<Byte> shuffle,
                                    VectorMask<Byte> m) {
          return (Byte64Vector)
              super.rearrangeTemplate(Byte64Shuffle.class,
+                                     Byte64Mask.class,
                                      (Byte64Shuffle) shuffle,
                                      (Byte64Mask) m);  // specialize
      }
  
      @Override

*** 594,20 ***
          @ForceInline
          public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
              AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
              if (length() != species.laneCount())
                  throw new IllegalArgumentException("VectorMask length and species length differ");
!             if (VSIZE == species.vectorBitSize()) {
!                 Class<?> dtype = species.elementType();
!                 Class<?> dmtype = species.maskType();
!                 return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
!                     this.getClass(), ETYPE, VLENGTH,
!                     dmtype, dtype, VLENGTH,
-                     this, species,
-                     Byte64Mask::defaultMaskCast);
-             }
-             return this.defaultMaskCast(species);
          }
  
          @Override
          @ForceInline
          public Byte64Mask eq(VectorMask<Byte> mask) {
--- 629,16 ---
          @ForceInline
          public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
              AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
              if (length() != species.laneCount())
                  throw new IllegalArgumentException("VectorMask length and species length differ");
! 
!             return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
!                 this.getClass(), ETYPE, VLENGTH,
!                 species.maskType(), species.elementType(), VLENGTH,
!                 this, species,
!                 (m, s) -> s.maskFactory(m.toArray()).check(s));
          }
  
          @Override
          @ForceInline
          public Byte64Mask eq(VectorMask<Byte> mask) {

*** 629,56 ***
          @Override
          @ForceInline
          public Byte64Mask and(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, byte.class, VLENGTH,
!                                              this, m,
!                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
          }
  
          @Override
          @ForceInline
          public Byte64Mask or(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, byte.class, VLENGTH,
!                                              this, m,
!                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
          }
  
          @ForceInline
          /* package-private */
          Byte64Mask xor(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, byte.class, VLENGTH,
!                                           this, m,
!                                           (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
          }
  
          // Mask Query operations
  
          @Override
          @ForceInline
          public int trueCount() {
!             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> trueCountHelper(((Byte64Mask)m).getBits()));
          }
  
          @Override
          @ForceInline
          public int firstTrue() {
!             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> firstTrueHelper(((Byte64Mask)m).getBits()));
          }
  
          @Override
          @ForceInline
          public int lastTrue() {
!             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> lastTrueHelper(((Byte64Mask)m).getBits()));
          }
  
          // Reductions
  
          @Override
--- 660,66 ---
          @Override
          @ForceInline
          public Byte64Mask and(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, null, byte.class, VLENGTH,
!                                           this, m, null,
!                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
          }
  
          @Override
          @ForceInline
          public Byte64Mask or(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, null, byte.class, VLENGTH,
!                                           this, m, null,
!                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
          }
  
          @ForceInline
          /* package-private */
          Byte64Mask xor(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte64Mask m = (Byte64Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, null, byte.class, VLENGTH,
!                                           this, m, null,
!                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
          }
  
          // Mask Query operations
  
          @Override
          @ForceInline
          public int trueCount() {
!             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> trueCountHelper(m.getBits()));
          }
  
          @Override
          @ForceInline
          public int firstTrue() {
!             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> firstTrueHelper(m.getBits()));
          }
  
          @Override
          @ForceInline
          public int lastTrue() {
!             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> lastTrueHelper(m.getBits()));
+         }
+ 
+         @Override
+         @ForceInline
+         public long toLong() {
+             if (length() > Long.SIZE) {
+                 throw new UnsupportedOperationException("too many lanes for one long");
+             }
+             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte64Mask.class, byte.class, VLENGTH, this,
+                                                       (m) -> toLongHelper(m.getBits()));
          }
  
          // Reductions
  
          @Override

*** 785,46 ***
--- 826,105 ---
      final
      ByteVector fromArray0(byte[] a, int offset) {
          return super.fromArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
+         return super.fromArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);  // specialize
+     }
+ 
+ 
  
      @ForceInline
      @Override
      final
      ByteVector fromBooleanArray0(boolean[] a, int offset) {
          return super.fromBooleanArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
+         return super.fromBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);  // specialize
+     }
+ 
      @ForceInline
      @Override
      final
      ByteVector fromByteArray0(byte[] a, int offset) {
          return super.fromByteArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
+         return super.fromByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);  // specialize
+     }
+ 
      @ForceInline
      @Override
      final
      ByteVector fromByteBuffer0(ByteBuffer bb, int offset) {
          return super.fromByteBuffer0Template(bb, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
+         return super.fromByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m);  // specialize
+     }
+ 
      @ForceInline
      @Override
      final
      void intoArray0(byte[] a, int offset) {
          super.intoArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
+         super.intoArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);
+     }
+ 
+ 
+     @ForceInline
+     @Override
+     final
+     void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
+         super.intoBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);
+     }
+ 
      @ForceInline
      @Override
      final
      void intoByteArray0(byte[] a, int offset) {
          super.intoByteArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
+         super.intoByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);  // specialize
+     }
+ 
+     @ForceInline
+     @Override
+     final
+     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
+         super.intoByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m);
+     }
+ 
+ 
      // End of specialized low-level memory operations.
  
      // ================================================
  
  }
< prev index next >