< prev index next >

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

Print this page
@@ -234,12 +234,12 @@
                                (Float256Mask)m, f);  // specialize
      }
  
      @ForceInline
      final @Override
-     float rOp(float v, FBinOp f) {
-         return super.rOpTemplate(v, f);  // specialize
+     float rOp(float v, VectorMask<Float> m, FBinOp f) {
+         return super.rOpTemplate(v, m, f);  // specialize
      }
  
      @Override
      @ForceInline
      public final <F>

@@ -271,26 +271,46 @@
      @ForceInline
      public Float256Vector lanewise(Unary op) {
          return (Float256Vector) super.lanewiseTemplate(op);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Float256Vector lanewise(Unary op, VectorMask<Float> m) {
+         return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, (Float256Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public Float256Vector lanewise(Binary op, Vector<Float> v) {
          return (Float256Vector) super.lanewiseTemplate(op, v);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public Float256Vector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
+         return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v, (Float256Mask) m);  // specialize
+     }
+ 
  
      /*package-private*/
      @Override
      @ForceInline
      public final
      Float256Vector
-     lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
+     lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
          return (Float256Vector) super.lanewiseTemplate(op, v1, v2);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public final
+     Float256Vector
+     lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
+         return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v1, v2, (Float256Mask) m);  // specialize
+     }
+ 
      @Override
      @ForceInline
      public final
      Float256Vector addIndex(int scale) {
          return (Float256Vector) super.addIndexTemplate(scale);  // specialize

@@ -306,11 +326,11 @@
  
      @Override
      @ForceInline
      public final float reduceLanes(VectorOperators.Associative op,
                                      VectorMask<Float> m) {
-         return super.reduceLanesTemplate(op, m);  // specialized
+         return super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m);  // specialized
      }
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op) {

@@ -319,11 +339,11 @@
  
      @Override
      @ForceInline
      public final long reduceLanesToLong(VectorOperators.Associative op,
                                          VectorMask<Float> m) {
-         return (long) super.reduceLanesTemplate(op, m);  // specialized
+         return (long) super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m);  // specialized
      }
  
      @ForceInline
      public VectorShuffle<Float> toShuffle() {
          return super.toShuffleTemplate(Float256Shuffle.class); // specialize

@@ -355,10 +375,17 @@
      @ForceInline
      public final Float256Mask compare(Comparison op, long s) {
          return super.compareTemplate(Float256Mask.class, op, s);  // specialize
      }
  
+     @Override
+     @ForceInline
+     public final Float256Mask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
+         return super.compareTemplate(Float256Mask.class, op, v, (Float256Mask) m);
+     }
+ 
+ 
      @Override
      @ForceInline
      public Float256Vector blend(Vector<Float> v, VectorMask<Float> m) {
          return (Float256Vector)
              super.blendTemplate(Float256Mask.class,

@@ -411,10 +438,11 @@
      @ForceInline
      public Float256Vector rearrange(VectorShuffle<Float> shuffle,
                                    VectorMask<Float> m) {
          return (Float256Vector)
              super.rearrangeTemplate(Float256Shuffle.class,
+                                     Float256Mask.class,
                                      (Float256Shuffle) shuffle,
                                      (Float256Mask) m);  // specialize
      }
  
      @Override

@@ -590,20 +618,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");
-             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,
-                     Float256Mask::defaultMaskCast);
-             }
-             return this.defaultMaskCast(species);
+ 
+             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 Float256Mask eq(VectorMask<Float> mask) {

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

@@ -781,40 +815,98 @@
      final
      FloatVector fromArray0(float[] a, int offset) {
          return super.fromArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
+         return super.fromArray0Template(Float256Mask.class, a, offset, (Float256Mask) m);  // specialize
+     }
+ 
+     @ForceInline
+     @Override
+     final
+     FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
+         return super.fromArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m);
+     }
+ 
  
  
      @ForceInline
      @Override
      final
      FloatVector fromByteArray0(byte[] a, int offset) {
          return super.fromByteArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
+         return super.fromByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m);  // specialize
+     }
+ 
      @ForceInline
      @Override
      final
      FloatVector fromByteBuffer0(ByteBuffer bb, int offset) {
          return super.fromByteBuffer0Template(bb, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
+         return super.fromByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m);  // specialize
+     }
+ 
      @ForceInline
      @Override
      final
      void intoArray0(float[] a, int offset) {
          super.intoArray0Template(a, offset);  // specialize
      }
  
+     @ForceInline
+     @Override
+     final
+     void intoArray0(float[] a, int offset, VectorMask<Float> m) {
+         super.intoArray0Template(Float256Mask.class, a, offset, (Float256Mask) m);
+     }
+ 
+     @ForceInline
+     @Override
+     final
+     void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
+         super.intoArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) 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<Float> m) {
+         super.intoByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m);  // specialize
+     }
+ 
+     @ForceInline
+     @Override
+     final
+     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
+         super.intoByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m);
+     }
+ 
+ 
      // End of specialized low-level memory operations.
  
      // ================================================
  
  }
< prev index next >