@@ -113,15 +113,15 @@ */ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ zero(VectorSpecies<$Boxtype$> species) { #if[FP] - return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.vectorType(), $type$.class, species.length(), $Type$.$type$To$Bitstype$Bits(0.0f), species, ((bits, s) -> (($Type$Species)s).op(i -> $Type$.$bitstype$BitsTo$Type$(($bitstype$)bits)))); #else[FP] - return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.vectorType(), $type$.class, species.length(), 0, species, ((bits, s) -> (($Type$Species)s).op(i -> ($type$)bits))); #end[FP] }

@@ -148,11 +148,11 @@ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ fromByteArray(VectorSpecies<$Boxtype$> species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.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()); $Type$Buffer tb = bbc{#if[byte]?;:.as$Type$Buffer();}

@@ -206,11 +206,11 @@ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ fromArray(VectorSpecies<$Boxtype$> species, $type$[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_$TYPE$_BASE_OFFSET, a, offset, species, (c, idx, s) -> (($Type$Species)s).op(n -> c[idx + n])); }

@@ -279,12 +279,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<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, ($type$[] c, int idx, int[] iMap, int idy, VectorSpecies<$Boxtype$> s) -> (($Type$Species)s).op(n -> c[idx + iMap[idy+n]])); }

@@ -356,11 +356,11 @@ public static $abstractvectortype$ fromByteBuffer(VectorSpecies<$Boxtype$> 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<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.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()); $Type$Buffer tb = bbc{#if[byte]?;:.as$Type$Buffer();}

@@ -421,20 +421,20 @@ #if[FP] @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ broadcast(VectorSpecies<$Boxtype$> species, $type$ e) { return VectorIntrinsics.broadcastCoerced( - (Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + (Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), $Type$.$type$To$Bitstype$Bits(e), species, ((bits, sp) -> (($Type$Species)sp).op(i -> $Type$.$bitstype$BitsTo$Type$(($bitstype$)bits)))); } #else[FP] @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ broadcast(VectorSpecies<$Boxtype$> species, $type$ e) { return VectorIntrinsics.broadcastCoerced( - (Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + (Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), e, species, ((bits, sp) -> (($Type$Species)sp).op(i -> ($type$)bits))); } #end[FP]

@@ -455,11 +455,11 @@ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ scalars(VectorSpecies<$Boxtype$> species, $type$... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), es, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, es, ix, species, (c, idx, sp) -> (($Type$Species)sp).op(n -> c[idx + n])); }

@@ -851,29 +851,29 @@ /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ rotateEL(int i); + public abstract $abstractvectortype$ rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ rotateER(int i); + public abstract $abstractvectortype$ rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ shiftEL(int i); + public abstract $abstractvectortype$ shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ shiftER(int i); + public abstract $abstractvectortype$ shiftLanesRight(int i); #if[FP] /** * Divides this vector by an input vector. * <p>

@@ -1901,485 +1901,451 @@ * @param m the mask controlling lane selection * @return the bitwise NOT of this vector */ public abstract $abstractvectortype$ not(VectorMask<$Boxtype$> m); -#if[byte] /** * Logically left shifts this vector by the broadcast of an input scalar. * <p> * This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 - */ #end[byte] #if[short] - /** - * Logically left shifts this vector by the broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 - */ #end[short] -#if[intOrLong] - /** - * Logically left shifts this vector by the broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftL(int s); + public abstract $abstractvectortype$ shiftLeft(int s); -#if[byte] /** * Logically left shifts this vector by the broadcast of an input scalar, * selecting lane elements controlled by a mask. * <p> * This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 left this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Logically left shifts this vector by the broadcast of an input scalar, - * selecting lane elements controlled by a mask. - * <p> - * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 left this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Logically left shifts this vector by the broadcast of an input scalar, - * selecting lane elements controlled by a mask. - * <p> - * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftL(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Logically left shifts this vector by an input vector. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of logically left shifting this vector by the input * vector */ - public abstract $abstractvectortype$ shiftL(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftLeft(Vector<$Boxtype$> v); /** * Logically left shifts this vector by an input vector, selecting lane * elements controlled by a mask. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @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 $abstractvectortype$ shiftL(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a << b)); + public $abstractvectortype$ shiftLeft(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftLeft(v), m); } -#end[intOrLong] // logical, or unsigned, shift right -#if[byte] /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar. * <p> * This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 - */ #end[byte] #if[short] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 - */ #end[short] -#if[intOrLong] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftR(int s); + public abstract $abstractvectortype$ shiftRight(int s); -#if[byte] /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a * mask. * <p> * This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 - */ #end[byte] #if[short] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - * <p> - * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 - */ #end[short] -#if[intOrLong] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - * <p> - * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftR(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftRight(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of logically right shifting this vector by the * input vector */ - public abstract $abstractvectortype$ shiftR(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftRight(Vector<$Boxtype$> v); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @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 $abstractvectortype$ shiftR(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a >>> b)); + public $abstractvectortype$ shiftRight(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftRight(v), m); } -#end[intOrLong] -#if[byte] /** * Arithmetically right shifts (or signed right shifts) this vector by the * broadcast of an input scalar. * <p> * This is a lane-wise binary operation which applies the primitive arithmetic right * shift operation ({@code >>}) to each lane to arithmetically * right shift the element by shift value as specified by the input scalar. +#if[byte] * Only the 3 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 - */ #end[byte] #if[short] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane to arithmetically - * right shift the element by shift value as specified by the input scalar. * Only the 4 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 - */ #end[short] -#if[intOrLong] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar. - * <p> - * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ aShiftR(int s); + public abstract $abstractvectortype$ shiftArithmeticRight(int s); -#if[byte] /** * Arithmetically right shifts (or signed right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a * mask. * <p> * This is a lane-wise binary operation which applies the primitive arithmetic right * shift operation ({@code >>}) to each lane to arithmetically * right shift the element by shift value as specified by the input scalar. +#if[byte] * Only the 3 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @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 - */ #end[byte] #if[short] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - * <p> - * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane to arithmetically - * right shift the element by shift value as specified by the input scalar. * Only the 4 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @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 - */ #end[short] -#if[intOrLong] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - * <p> - * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. * * @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 */ -#end[intOrLong] - public abstract $abstractvectortype$ aShiftR(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of arithmetically right shifting this vector by the * input vector */ - public abstract $abstractvectortype$ aShiftR(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftArithmeticRight(Vector<$Boxtype$> v); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. * <p> * 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. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @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 $abstractvectortype$ aShiftR(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a >> b)); + public $abstractvectortype$ shiftArithmeticRight(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftArithmeticRight(v), m); } /** * Rotates left this vector by the broadcast of an input scalar. * <p> +#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateLeft} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x15. +#end[short] * * @param s the input scalar; the number of the bits to rotate left * @return the result of rotating left this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateL(int s) { - return shiftL(s).or(shiftR(-s)); + public final $abstractvectortype$ rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); } /** * Rotates left this vector by the broadcast of an input scalar, selecting * lane elements controlled by a mask. * <p> +#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateLeft} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x15. +#end[short] * * @param s the input scalar; the number of the bits to rotate left * @param m the mask controlling lane selection * @return the result of rotating left this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateL(int s, VectorMask<$Boxtype$> m) { - return shiftL(s, m).or(shiftR(-s, m), m); + public final $abstractvectortype$ rotateLeft(int s, VectorMask<$Boxtype$> m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); } /** * Rotates right this vector by the broadcast of an input scalar. * <p> +#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateRight} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x15. +#end[short] * * @param s the input scalar; the number of the bits to rotate right * @return the result of rotating right this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateR(int s) { - return shiftR(s).or(shiftL(-s)); + public final $abstractvectortype$ rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); } /** * Rotates right this vector by the broadcast of an input scalar, selecting * lane elements controlled by a mask. * <p> +#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateRight} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x15. +#end[short] * * @param s the input scalar; the number of the bits to rotate right * @param m the mask controlling lane selection * @return the result of rotating right this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateR(int s, VectorMask<$Boxtype$> m) { - return shiftR(s, m).or(shiftL(-s, m), m); + public final $abstractvectortype$ rotateRight(int s, VectorMask<$Boxtype$> m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); } -#end[intOrLong] #end[BITWISE] /** * {@inheritDoc} */

@@ -2805,17 +2771,17 @@ */ static final class $Type$Species extends AbstractSpecies<$Boxtype$> { final Function<$type$[], $Type$Vector> vectorFactory; private $Type$Species(VectorShape shape, - Class<?> boxType, + Class<?> vectorType, Class<?> maskType, Function<$type$[], $Type$Vector> vectorFactory, Function<boolean[], VectorMask<$Boxtype$>> maskFactory, Function<IntUnaryOperator, VectorShuffle<$Boxtype$>> shuffleFromArrayFactory, fShuffleFromArray<$Boxtype$> shuffleFromOpFactory) { - super(shape, $type$.class, $Boxtype$.SIZE, boxType, maskType, maskFactory, + super(shape, $type$.class, $Boxtype$.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } interface FOp {