< prev index next >

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

Print this page
*** 234,12 ***
                                (Byte256Mask)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 ---
                                (Byte256Mask)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 Byte256Vector lanewise(Unary op) {
          return (Byte256Vector) super.lanewiseTemplate(op);  // specialize
      }
  
      @Override
      @ForceInline
      public Byte256Vector lanewise(Binary op, Vector<Byte> v) {
          return (Byte256Vector) super.lanewiseTemplate(op, v);  // specialize
      }
  
      /*package-private*/
      @Override
      @ForceInline Byte256Vector
      lanewiseShift(VectorOperators.Binary op, int e) {
          return (Byte256Vector) super.lanewiseShiftTemplate(op, e);  // specialize
      }
  
      /*package-private*/
      @Override
      @ForceInline
      public final
      Byte256Vector
!     lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
          return (Byte256Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
      }
  
      @Override
      @ForceInline
      public final
      Byte256Vector addIndex(int scale) {
          return (Byte256Vector) super.addIndexTemplate(scale);  // specialize
--- 271,59 ---
      @ForceInline
      public Byte256Vector lanewise(Unary op) {
          return (Byte256Vector) super.lanewiseTemplate(op);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Byte256Vector lanewise(Unary op, VectorMask<Byte> m) {
+         return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, (Byte256Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public Byte256Vector lanewise(Binary op, Vector<Byte> v) {
          return (Byte256Vector) super.lanewiseTemplate(op, v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Byte256Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
+         return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v, (Byte256Mask) m);  // specialize
+     }
+ 
      /*package-private*/
      @Override
      @ForceInline Byte256Vector
      lanewiseShift(VectorOperators.Binary op, int e) {
          return (Byte256Vector) super.lanewiseShiftTemplate(op, e);  // specialize
      }
  
+     /*package-private*/
+     @Override
+     @ForceInline Byte256Vector
+     lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
+         return (Byte256Vector) super.lanewiseShiftTemplate(op, Byte256Mask.class, e, (Byte256Mask) m);  // specialize
+     }
+ 
      /*package-private*/
      @Override
      @ForceInline
      public final
      Byte256Vector
!     lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
          return (Byte256Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public final
+     Byte256Vector
+     lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
+         return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v1, v2, (Byte256Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public final
      Byte256Vector addIndex(int scale) {
          return (Byte256Vector) 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, Byte256Mask.class, (Byte256Mask) 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(Byte256Shuffle.class); // specialize
--- 352,11 ---
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op,
                                          VectorMask<Byte> m) {
!         return (long) super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m);  // specialized
      }
  
      @ForceInline
      public VectorShuffle<Byte> toShuffle() {
          return super.toShuffleTemplate(Byte256Shuffle.class); // specialize

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

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

*** 642,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,
-                     Byte256Mask::defaultMaskCast);
-             }
-             return this.defaultMaskCast(species);
          }
  
          @Override
          @ForceInline
          public Byte256Mask eq(VectorMask<Byte> mask) {
--- 677,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 Byte256Mask eq(VectorMask<Byte> mask) {

*** 677,56 ***
          @Override
          @ForceInline
          public Byte256Mask and(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, byte.class, VLENGTH,
!                                              this, m,
!                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
          }
  
          @Override
          @ForceInline
          public Byte256Mask or(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, byte.class, VLENGTH,
!                                              this, m,
!                                              (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
          }
  
          @ForceInline
          /* package-private */
          Byte256Mask xor(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.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, Byte256Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> trueCountHelper(((Byte256Mask)m).getBits()));
          }
  
          @Override
          @ForceInline
          public int firstTrue() {
!             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> firstTrueHelper(((Byte256Mask)m).getBits()));
          }
  
          @Override
          @ForceInline
          public int lastTrue() {
!             return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> lastTrueHelper(((Byte256Mask)m).getBits()));
          }
  
          // Reductions
  
          @Override
--- 708,66 ---
          @Override
          @ForceInline
          public Byte256Mask and(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, byte.class, VLENGTH,
!                                           this, m, null,
!                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
          }
  
          @Override
          @ForceInline
          public Byte256Mask or(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, byte.class, VLENGTH,
!                                           this, m, null,
!                                           (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
          }
  
          @ForceInline
          /* package-private */
          Byte256Mask xor(VectorMask<Byte> mask) {
              Objects.requireNonNull(mask);
              Byte256Mask m = (Byte256Mask)mask;
!             return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.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, Byte256Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> trueCountHelper(m.getBits()));
          }
  
          @Override
          @ForceInline
          public int firstTrue() {
!             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
!                                                       (m) -> firstTrueHelper(m.getBits()));
          }
  
          @Override
          @ForceInline
          public int lastTrue() {
!             return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.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, Byte256Mask.class, byte.class, VLENGTH, this,
+                                                       (m) -> toLongHelper(m.getBits()));
          }
  
          // Reductions
  
          @Override

*** 833,46 ***
--- 874,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(Byte256Mask.class, a, offset, (Byte256Mask) 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(Byte256Mask.class, a, offset, (Byte256Mask) 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(Byte256Mask.class, a, offset, (Byte256Mask) 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(Byte256Mask.class, bb, offset, (Byte256Mask) 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(Byte256Mask.class, a, offset, (Byte256Mask) m);
+     }
+ 
+ 
+     @ForceInline
+     @Override
+     final
+     void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
+         super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) 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(Byte256Mask.class, a, offset, (Byte256Mask) m);  // specialize
+     }
+ 
+     @ForceInline
+     @Override
+     final
+     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
+         super.intoByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m);
+     }
+ 
+ 
      // End of specialized low-level memory operations.
  
      // ================================================
  
  }
< prev index next >