< prev index next >

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

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

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

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

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

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

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

*** 578,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,
-                     Float64Mask::defaultMaskCast);
-             }
-             return this.defaultMaskCast(species);
          }
  
          @Override
          @ForceInline
          public Float64Mask eq(VectorMask<Float> mask) {
--- 606,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 Float64Mask eq(VectorMask<Float> mask) {

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

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