< prev index next >

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

Print this page
rev 55891 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz
rev 55894 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz

@@ -110,11 +110,11 @@
      * @return a zero vector of given species
      */
     @ForceInline
     @SuppressWarnings("unchecked")
     public static DoubleVector zero(VectorSpecies<Double> species) {
-        return VectorIntrinsics.broadcastCoerced((Class<DoubleVector>) species.boxType(), double.class, species.length(),
+        return VectorIntrinsics.broadcastCoerced((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
                                                  Double.doubleToLongBits(0.0f), species,
                                                  ((bits, s) -> ((DoubleSpecies)s).op(i -> Double.longBitsToDouble((long)bits))));
     }
 
     /**

@@ -140,11 +140,11 @@
     @ForceInline
     @SuppressWarnings("unchecked")
     public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int offset) {
         Objects.requireNonNull(a);
         offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE);
-        return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(),
+        return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
                                      a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET,
                                      a, offset, species,
                                      (c, idx, s) -> {
                                          ByteBuffer bbc = ByteBuffer.wrap(c, idx, a.length - idx).order(ByteOrder.nativeOrder());
                                          DoubleBuffer tb = bbc.asDoubleBuffer();

@@ -198,11 +198,11 @@
     @ForceInline
     @SuppressWarnings("unchecked")
     public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int offset){
         Objects.requireNonNull(a);
         offset = VectorIntrinsics.checkIndex(offset, a.length, species.length());
-        return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(),
+        return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
                                      a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET,
                                      a, offset, species,
                                      (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n]));
     }
 

@@ -264,12 +264,12 @@
         // Index vector: vix[0:n] = k -> a_offset + indexMap[i_offset + k]
         IntVector vix = IntVector.fromArray(IntVector.species(species.indexShape()), indexMap, i_offset).add(a_offset);
 
         vix = VectorIntrinsics.checkIndex(vix, a.length);
 
-        return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.boxType(), double.class, species.length(),
-                                            IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix,
+        return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
+                                            IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix,
                                             a, a_offset, indexMap, i_offset, species,
                                             (double[] c, int idx, int[] iMap, int idy, VectorSpecies<Double> s) ->
                                                 ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]]));
         }
 

@@ -334,11 +334,11 @@
     public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset) {
         if (bb.order() != ByteOrder.nativeOrder()) {
             throw new IllegalArgumentException();
         }
         offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE);
-        return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(),
+        return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
                                      U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset,
                                      bb, offset, species,
                                      (c, idx, s) -> {
                                          ByteBuffer bbc = c.duplicate().position(idx).order(ByteOrder.nativeOrder());
                                          DoubleBuffer tb = bbc.asDoubleBuffer();

@@ -390,19 +390,19 @@
     /**
      * Returns a vector where all lane elements are set to the primitive
      * value {@code e}.
      *
      * @param species species of the desired vector
-     * @param e the value
+     * @param e the value to be broadcasted
      * @return a vector of vector where all lane elements are set to
      * the primitive value {@code e}
      */
     @ForceInline
     @SuppressWarnings("unchecked")
     public static DoubleVector broadcast(VectorSpecies<Double> species, double e) {
         return VectorIntrinsics.broadcastCoerced(
-            (Class<DoubleVector>) species.boxType(), double.class, species.length(),
+            (Class<DoubleVector>) species.vectorType(), double.class, species.length(),
             Double.doubleToLongBits(e), species,
             ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits))));
     }
 
     /**

@@ -422,11 +422,11 @@
     @ForceInline
     @SuppressWarnings("unchecked")
     public static DoubleVector scalars(VectorSpecies<Double> species, double... es) {
         Objects.requireNonNull(es);
         int ix = VectorIntrinsics.checkIndex(0, es.length, species.length());
-        return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(),
+        return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(),
                                      es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET,
                                      es, ix, species,
                                      (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n]));
     }
 

@@ -800,29 +800,29 @@
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public abstract DoubleVector rotateEL(int i);
+    public abstract DoubleVector rotateLanesLeft(int i);
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public abstract DoubleVector rotateER(int i);
+    public abstract DoubleVector rotateLanesRight(int i);
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public abstract DoubleVector shiftEL(int i);
+    public abstract DoubleVector shiftLanesLeft(int i);
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public abstract DoubleVector shiftER(int i);
+    public abstract DoubleVector shiftLanesRight(int i);
 
     /**
      * Divides this vector by an input vector.
      * <p>
      * This is a lane-wise binary operation which applies the primitive division

@@ -1720,11 +1720,11 @@
      * the default implementation of adding vectors sequentially from left to right is used.
      * For this reason, the output of this method may vary for the same input values.
      *
      * @return the addition of all the lane elements of this vector
      */
-    public abstract double addAll();
+    public abstract double addLanes();
 
     /**
      * Adds all lane elements of this vector, selecting lane elements
      * controlled by a mask.
      * <p>

@@ -1742,11 +1742,11 @@
      * For this reason, the output of this method may vary on the same input values.
      *
      * @param m the mask controlling lane selection
      * @return the addition of the selected lane elements of this vector
      */
-    public abstract double addAll(VectorMask<Double> m);
+    public abstract double addLanes(VectorMask<Double> m);
 
     /**
      * Multiplies all lane elements of this vector.
      * <p>
      * This is a cross-lane reduction operation which applies the

@@ -1761,11 +1761,11 @@
      * the default implementation of multiplying vectors sequentially from left to right is used.
      * For this reason, the output of this method may vary on the same input values.
      *
      * @return the multiplication of all the lane elements of this vector
      */
-    public abstract double mulAll();
+    public abstract double mulLanes();
 
     /**
      * Multiplies all lane elements of this vector, selecting lane elements
      * controlled by a mask.
      * <p>

@@ -1782,11 +1782,11 @@
      * For this reason, the output of this method may vary on the same input values.
      *
      * @param m the mask controlling lane selection
      * @return the multiplication of all the lane elements of this vector
      */
-    public abstract double mulAll(VectorMask<Double> m);
+    public abstract double mulLanes(VectorMask<Double> m);
 
     /**
      * Returns the minimum lane element of this vector.
      * <p>
      * This is an associative cross-lane reduction operation which applies the operation

@@ -1794,11 +1794,11 @@
      * and the identity value is
      * {@link Double#POSITIVE_INFINITY}.
      *
      * @return the minimum lane element of this vector
      */
-    public abstract double minAll();
+    public abstract double minLanes();
 
     /**
      * Returns the minimum lane element of this vector, selecting lane elements
      * controlled by a mask.
      * <p>

@@ -1808,11 +1808,11 @@
      * {@link Double#POSITIVE_INFINITY}.
      *
      * @param m the mask controlling lane selection
      * @return the minimum lane element of this vector
      */
-    public abstract double minAll(VectorMask<Double> m);
+    public abstract double minLanes(VectorMask<Double> m);
 
     /**
      * Returns the maximum lane element of this vector.
      * <p>
      * This is an associative cross-lane reduction operation which applies the operation

@@ -1820,11 +1820,11 @@
      * and the identity value is
      * {@link Double#NEGATIVE_INFINITY}.
      *
      * @return the maximum lane element of this vector
      */
-    public abstract double maxAll();
+    public abstract double maxLanes();
 
     /**
      * Returns the maximum lane element of this vector, selecting lane elements
      * controlled by a mask.
      * <p>

@@ -1834,11 +1834,11 @@
      * {@link Double#NEGATIVE_INFINITY}.
      *
      * @param m the mask controlling lane selection
      * @return the maximum lane element of this vector
      */
-    public abstract double maxAll(VectorMask<Double> m);
+    public abstract double maxLanes(VectorMask<Double> m);
 
 
     // Type specific accessors
 
     /**

@@ -1978,17 +1978,17 @@
      */
     static final class DoubleSpecies extends AbstractSpecies<Double> {
         final Function<double[], DoubleVector> vectorFactory;
 
         private DoubleSpecies(VectorShape shape,
-                          Class<?> boxType,
+                          Class<?> vectorType,
                           Class<?> maskType,
                           Function<double[], DoubleVector> vectorFactory,
                           Function<boolean[], VectorMask<Double>> maskFactory,
                           Function<IntUnaryOperator, VectorShuffle<Double>> shuffleFromArrayFactory,
                           fShuffleFromArray<Double> shuffleFromOpFactory) {
-            super(shape, double.class, Double.SIZE, boxType, maskType, maskFactory,
+            super(shape, double.class, Double.SIZE, vectorType, maskType, maskFactory,
                   shuffleFromArrayFactory, shuffleFromOpFactory);
             this.vectorFactory = vectorFactory;
         }
 
         interface FOp {
< prev index next >