* 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. + * 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. * @@ -985,7 +985,7 @@ * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftL(int s); + public abstract ByteVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, @@ -993,8 +993,8 @@ *

* 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. + * 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. * @@ -1003,8 +1003,43 @@ * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftL(int s, VectorMask m); + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of logically left shifting this vector by the input + * vector + */ + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ByteVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); + } // logical, or unsigned, shift right @@ -1014,8 +1049,8 @@ *

* 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. + * 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. * @@ -1023,7 +1058,7 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftR(int s); + public abstract ByteVector shiftRight(int s); /** * Logically right shifts (or unsigned right shifts) this vector by the @@ -1032,8 +1067,8 @@ *

* 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. + * 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. * @@ -1042,8 +1077,44 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftR(int s, VectorMask m); + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of logically right shifting this vector by the + * input vector + */ + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ByteVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); + } /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1060,7 +1131,7 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector aShiftR(int s); + public abstract ByteVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1079,8 +1150,120 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector aShiftR(int s, VectorMask m); + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public abstract ByteVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ByteVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); + } + + /** + * Rotates left this vector by the broadcast of an input scalar. + *

+ * 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. + * + * @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 ByteVector 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. + *

+ * 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. + * + * @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 ByteVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); + } + + /** + * Rotates right this vector by the broadcast of an input scalar. + *

+ * 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. + * + * @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 ByteVector 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. + *

* 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 IntVector shiftL(int s); + public abstract IntVector 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 IntVector shiftL(int s, VectorMask m); + public abstract IntVector 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 IntVector shiftL(Vector v); + public abstract IntVector 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 IntVector shiftL(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (int) (a << b)); + public IntVector 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 IntVector shiftR(int s); + public abstract IntVector 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 IntVector shiftR(int s, VectorMask m); + public abstract IntVector 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 IntVector shiftR(Vector v); + public abstract IntVector 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 IntVector shiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (int) (a >>> b)); + public IntVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); } /** @@ -1110,13 +1118,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 IntVector aShiftR(int s); + public abstract IntVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1124,42 +1133,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 IntVector aShiftR(int s, VectorMask m); + public abstract IntVector 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 IntVector aShiftR(Vector v); + public abstract IntVector 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 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 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 + * 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. * @@ -986,7 +986,7 @@ * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftL(int s); + public abstract ShortVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, @@ -994,8 +994,8 @@ *

* 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 + * 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. * @@ -1004,8 +1004,43 @@ * @return the result of logically left shifting left this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftL(int s, VectorMask m); + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of logically left shifting this vector by the input + * vector + */ + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ShortVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); + } // logical, or unsigned, shift right @@ -1015,8 +1050,8 @@ *

* 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 + * 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. * @@ -1024,7 +1059,7 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftR(int s); + public abstract ShortVector shiftRight(int s); /** * Logically right shifts (or unsigned right shifts) this vector by the @@ -1032,9 +1067,9 @@ * mask. *

* 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 + * 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 * 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. * @@ -1043,8 +1078,44 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftR(int s, VectorMask m); + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of logically right shifting this vector by the + * input vector + */ + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ShortVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); + } /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1061,7 +1132,7 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector aShiftR(int s); + public abstract ShortVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1080,8 +1151,120 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector aShiftR(int s, VectorMask m); + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 v the input vector + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public abstract ShortVector 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. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * 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 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 ShortVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); + } + + /** + * Rotates left this vector by the broadcast of an input scalar. + *

+ * 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. + * + * @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 ShortVector 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. + *

+ * 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. + * + * @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 ShortVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); + } + /** + * Rotates right this vector by the broadcast of an input scalar. + *

+ * 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. + * + * @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 ShortVector 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. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorMask#fromValues(VectorSpecies, boolean...) fromValues()} + * method in VectorMask as follows: + *

``` {@code
+     * } ```
+ * + * @param bits the given {@code boolean} values + * @return a mask where each lane is set or unset according to the given {@code boolean} value + * @throws IndexOutOfBoundsException if {@code bits.length < this.species().length()} + */ + @ForceInline + public final VectorMask maskFromValues(boolean... bits) { + return VectorMask.fromValues(this.species(), bits); + } + + /** + * Loads a mask of same species as {@code this} vector from a {@code boolean} array starting at an offset. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorMask#fromArray(VectorSpecies, boolean[], int) fromArray()} + * method in VectorMask as follows: + *

``` {@code
+     *     return VectorMask.fromArray(this.species(), bits, offset);
+     * } ```

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#fromValues(VectorSpecies, int...) fromValues()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return VectorShuffle.fromValues(this.species(), ixs);
+     * } ```
+ * + * @param ixs the given {@code int} values + * @return a shuffle where each lane element is set to a given + * {@code int} value + * @throws IndexOutOfBoundsException if the number of int values is + * {@code < this.species().length()} + */ + @ForceInline + public final VectorShuffle shuffleFromValues(int... ixs) { + return VectorShuffle.fromValues(this.species(), ixs); + } + + /** + * Loads a shuffle of same species as {@code this} vector from an {@code int} array starting at an offset. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#fromArray(VectorSpecies, int[], int) fromArray()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return VectorShuffle.fromArray(this.species(), ixs, offset);
+     * } ```
+ * + * @param ixs the {@code int} array + * @param offset the offset into the array + * @return a shuffle loaded from the {@code int} array + * @throws IndexOutOfBoundsException if {@code offset < 0}, or + * {@code offset > ixs.length - this.species().length()} + */ + @ForceInline + public final VectorShuffle shuffleFromArray(int[] ixs, int offset) { + return VectorShuffle.fromArray(this.species(), ixs, offset); + } + + /** + * Returns a shuffle of same species as {@code this} vector of mapped indexes where each lane element is + * the result of applying a mapping function to the corresponding lane + * index. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffle(VectorSpecies, IntUnaryOperator) shuffle()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return AbstractShuffle.shuffle(this.species(), f);
+     * } ```
+ * + * @param f the lane index mapping function + * @return a shuffle of mapped indexes + */ + @ForceInline + public final VectorShuffle shuffle(IntUnaryOperator f) { + return AbstractShuffle.shuffle(this.species(), f); + } + + /** + * Returns a shuffle of same species has {@code this} vector and where each lane element is the value of its + * corresponding lane index. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleIota(VectorSpecies) shuffleIota()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return VectorShuffle.shuffleIota(this.species());
+     * } ```
+ * + * @return a shuffle of lane indexes + */ + @ForceInline + public final VectorShuffle shuffleIota() { + return VectorShuffle.shuffleIota(this.species()); + } + + /** + * Returns a shuffle of same species has {@code this} vector and with lane elements set to sequential {@code int} + * values starting from {@code start}. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleIota(VectorSpecies, int) shuffleIota()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return VectorShuffle.shuffleIota(this.species(), start);
+     * } ```
+ * + * @param start starting value of sequence + * @return a shuffle of lane indexes + */ + @ForceInline + public final VectorShuffle shuffleIota(int start) { + return VectorShuffle.shuffleIota(this.species(), start); + } + + /** + * Returns a shuffle of same species has {@code this} vector and with lane elements set to sequential {@code int} + * values starting from {@code start} and looping around species length. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleOffset(VectorSpecies, int) shuffleOffset()} + * method in VectorShuffle as follows: + *

``` {@code
+     *     return VectorShuffle.shuffleOffset(this.species(), start);
+     * } ```
+ * + * @param start starting value of sequence + * @return a shuffle of lane indexes + */ + @ForceInline + public final VectorShuffle shuffleOffset(int start) { + return VectorShuffle.shuffleOffset(this.species(), start); + } } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java 2019-04-23 10:52:11.766188700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java 2019-04-23 10:52:11.328789500 -0700 @@ -121,7 +121,7 @@ /** * Returns a mask where each lane is set or unset according to given - * {@code boolean} values + * {@code boolean} values. *

* 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. - *

- * 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. - *

- * 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. *

* 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. - *

- * 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. - *

- * 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. *

* 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. *

* 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. *

* 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. - *

- * 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. - *

- * 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 @@ -2090,85 +2034,76 @@ *

* 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. - *

- * 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. - *

- * 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. *

* 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. *

* 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. @@ -2176,48 +2111,23 @@ * 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. - *

- * 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. - *

- * 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 @@ -2226,109 +2136,134 @@ * 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. - *

- * 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. - *

- * 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. *

* 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. *

* 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. *

+#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. *

+#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 @@ -2336,37 +2271,69 @@ * 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. *

+#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. *