--- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java 2019-04-23 10:51:43.189493700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java 2019-04-23 10:51:42.752094000 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static LongVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), long.class, species.length(), 0, species, ((bits, s) -> ((LongSpecies)s).op(i -> (long)bits))); } @@ -142,7 +142,7 @@ public static LongVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static LongVector fromArray(VectorSpecies species, long[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_LONG_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((LongSpecies)s).op(n -> c[idx + n])); @@ -266,8 +266,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class) species.boxType(), long.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_LONG_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class) species.vectorType(), long.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_LONG_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (long[] c, int idx, int[] iMap, int idy, VectorSpecies s) -> ((LongSpecies)s).op(n -> c[idx + iMap[idy+n]])); @@ -336,7 +336,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -400,7 +400,7 @@ @SuppressWarnings("unchecked") public static LongVector broadcast(VectorSpecies species, long e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), long.class, species.length(), + (Class) species.vectorType(), long.class, species.length(), e, species, ((bits, sp) -> ((LongSpecies)sp).op(i -> (long)bits))); } @@ -424,7 +424,7 @@ public static LongVector scalars(VectorSpecies species, long... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), es, Unsafe.ARRAY_LONG_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((LongSpecies)sp).op(n -> c[idx + n])); @@ -802,25 +802,25 @@ * {@inheritDoc} */ @Override - public abstract LongVector rotateEL(int i); + public abstract LongVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector rotateER(int i); + public abstract LongVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector shiftEL(int i); + public abstract LongVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector shiftER(int i); + public abstract LongVector shiftLanesRight(int i); @@ -999,113 +999,121 @@ * Logically left shifts this vector by the broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftL(int s); + public abstract LongVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, * selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection - * @return the result of logically left shifting this vector by the + * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftL(int s, VectorMask m); + public abstract LongVector shiftLeft(int s, VectorMask m); /** * Logically left shifts this vector by an input vector. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically left shifting this vector by the input * vector */ - public abstract LongVector shiftL(Vector v); + public abstract LongVector shiftLeft(Vector v); /** * Logically left shifts this vector by an input vector, selecting lane * elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the input * vector */ - public LongVector shiftL(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a << b)); + public LongVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); } // logical, or unsigned, shift right - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftR(int s); + public abstract LongVector shiftRight(int s); - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a * mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftR(int s, VectorMask m); + public abstract LongVector shiftRight(int s, VectorMask m); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically right shifting this vector by the * input vector */ - public abstract LongVector shiftR(Vector v); + public abstract LongVector shiftRight(Vector v); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * input vector */ - public LongVector shiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a >>> b)); + public LongVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); } /** @@ -1113,13 +1121,14 @@ * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector aShiftR(int s); + public abstract LongVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1127,42 +1136,45 @@ * mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector aShiftR(int s, VectorMask m); + public abstract LongVector shiftArithmeticRight(int s, VectorMask m); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of arithmetically right shifting this vector by the * input vector */ - public abstract LongVector aShiftR(Vector v); + public abstract LongVector shiftArithmeticRight(Vector v); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * input vector */ - public LongVector aShiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a >> b)); + public LongVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); } /** @@ -1179,8 +1191,8 @@ * input scalar */ @ForceInline - public final LongVector rotateL(int s) { - return shiftL(s).or(shiftR(-s)); + public final LongVector rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); } /** @@ -1199,8 +1211,8 @@ * input scalar */ @ForceInline - public final LongVector rotateL(int s, VectorMask m) { - return shiftL(s, m).or(shiftR(-s, m), m); + public final LongVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); } /** @@ -1217,8 +1229,8 @@ * input scalar */ @ForceInline - public final LongVector rotateR(int s) { - return shiftR(s).or(shiftL(-s)); + public final LongVector rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); } /** @@ -1237,8 +1249,8 @@ * input scalar */ @ForceInline - public final LongVector rotateR(int s, VectorMask m) { - return shiftR(s, m).or(shiftL(-s, m), m); + public final LongVector rotateRight(int s, VectorMask m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); } /** @@ -1580,13 +1592,13 @@ final Function vectorFactory; private LongSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, long.class, Long.SIZE, boxType, maskType, maskFactory, + super(shape, long.class, Long.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; }