< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template

Print this page
rev 55237 : javadoc changes

*** 105,115 **** /** * Returns a vector where all lane elements are set to the default * primitive value. * ! * @return a zero vector */ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ zero($Type$Species species) { return species.zero(); --- 105,116 ---- /** * Returns a vector where all lane elements are set to the default * primitive value. * ! * @param species species of desired vector ! * @return a zero vector of given species */ @ForceInline @SuppressWarnings("unchecked") public static $abstractvectortype$ zero($Type$Species species) { return species.zero();
*** 126,135 **** --- 127,137 ---- * {@link #fromByteBuffer($Type$Species, ByteBuffer, int, Mask) method} as follows: * <pre>{@code * return this.fromByteBuffer(ByteBuffer.wrap(a), i, this.maskAllTrue()); * }</pre> * + * @param species species of desired vector * @param a the byte array * @param ix the offset into the array * @return a vector loaded from a byte array * @throws IndexOutOfBoundsException if {@code i < 0} or * {@code i > a.length - (this.length() * this.elementSize() / Byte.SIZE)}
*** 161,170 **** --- 163,173 ---- * {@link #fromByteBuffer($Type$Species, ByteBuffer, int, Mask) method} as follows: * <pre>{@code * return this.fromByteBuffer(ByteBuffer.wrap(a), i, m); * }</pre> * + * @param species species of desired vector * @param a the byte array * @param ix the offset into the array * @param m the mask * @return a vector loaded from a byte array * @throws IndexOutOfBoundsException if {@code i < 0} or
*** 185,194 **** --- 188,198 ---- * <p> * For each vector lane, where {@code N} is the vector lane index, the * array element at index {@code i + N} is placed into the * resulting vector at lane index {@code N}. * + * @param species species of desired vector * @param a the array * @param i the offset into the array * @return the vector loaded from an array * @throws IndexOutOfBoundsException if {@code i < 0}, or * {@code i > a.length - this.length()}
*** 212,221 **** --- 216,226 ---- * if the mask lane at index {@code N} is set then the array element at * index {@code i + N} is placed into the resulting vector at lane index * {@code N}, otherwise the default element value is placed into the * resulting vector at lane index {@code N}. * + * @param species species of desired vector * @param a the array * @param i the offset into the array * @param m the mask * @return the vector loaded from an array * @throws IndexOutOfBoundsException if {@code i < 0}, or
*** 233,242 **** --- 238,248 ---- * <p> * For each vector lane, where {@code N} is the vector lane index, the * array element at index {@code i + indexMap[j + N]} is placed into the * resulting vector at lane index {@code N}. * + * @param species species of desired vector * @param a the array * @param i the offset into the array, may be negative if relative * indexes in the index map compensate to produce a value within the * array bounds * @param indexMap the index map
*** 283,296 **** --- 289,304 ---- * For each vector lane, where {@code N} is the vector lane index, * if the mask lane at index {@code N} is set then the array element at * index {@code i + indexMap[j + N]} is placed into the resulting vector * at lane index {@code N}. * + * @param species species of desired vector * @param a the array * @param i the offset into the array, may be negative if relative * indexes in the index map compensate to produce a value within the * array bounds + * @param m the mask * @param indexMap the index map * @param j the offset into the index map * @return the vector loaded from an array * @throws IndexOutOfBoundsException if {@code j < 0}, or * {@code j > indexMap.length - this.length()},
*** 324,333 **** --- 332,342 ---- * {@link #fromByteBuffer($Type$Species, ByteBuffer, int, Mask)} method} as follows: * <pre>{@code * return this.fromByteBuffer(b, i, this.maskAllTrue()) * }</pre> * + * @param species species of desired vector * @param bb the byte buffer * @param ix the offset into the byte buffer * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()},
*** 375,386 **** --- 384,397 ---- * es[n] = eb.get(n); * } * Vector<E> r = ((ESpecies<S>)this).fromArray(es, 0, m); * }</pre> * + * @param species species of desired vector * @param bb the byte buffer * @param ix the offset into the byte buffer + * @param m the mask * @return a vector loaded from a byte buffer * @throws IndexOutOfBoundsException if the offset is {@code < 0}, * or {@code > b.limit()}, * for any vector lane index {@code N} where the mask at lane {@code N} * is set
*** 389,398 **** --- 400,422 ---- @ForceInline public static $abstractvectortype$ fromByteBuffer($Type$Species species, ByteBuffer bb, int ix, Mask<$Boxtype$> m) { return zero(species).blend(fromByteBuffer(species, bb, ix), m); } + /** + * Returns a mask where each lane is set or unset according to given + * {@code boolean} values + * <p> + * For each mask lane, where {@code N} is the mask lane index, + * if the given {@code boolean} value at index {@code N} is {@code true} + * then the mask lane at index {@code N} is set, otherwise it is unset. + * + * @param species mask species + * @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 < species.length()} + */ @ForceInline public static Mask<$Boxtype$> maskFromValues($Type$Species species, boolean... bits) { if (species.boxType() == $Type$MaxVector.class) return new $Type$MaxVector.$Type$MaxMask(bits); switch (species.bitSize()) {
*** 427,436 **** --- 451,474 ---- case 512: return $Type$512Vector.$Type$512Mask.FALSE_MASK; default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } + /** + * Loads a mask from a {@code boolean} array starting at an offset. + * <p> + * For each mask lane, where {@code N} is the mask lane index, + * if the array element at index {@code ix + N} is {@code true} then the + * mask lane at index {@code N} is set, otherwise it is unset. + * + * @param species mask species + * @param bits the {@code boolean} array + * @param ix the offset into the array + * @return the mask loaded from a {@code boolean} array + * @throws IndexOutOfBoundsException if {@code ix < 0}, or + * {@code ix > bits.length - species.length()} + */ @ForceInline @SuppressWarnings("unchecked") public static Mask<$Boxtype$> maskFromArray($Type$Species species, boolean[] bits, int ix) { Objects.requireNonNull(bits); ix = VectorIntrinsics.checkIndex(ix, bits.length, species.length());
*** 438,463 **** --- 476,537 ---- bits, (((long) ix) << ARRAY_SHIFT) + Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, bits, ix, species, (c, idx, s) -> (Mask<$Boxtype$>) (($Type$Species)s).opm(n -> c[idx + n])); } + /** + * Returns a mask where all lanes are set. + * + * @param species mask species + * @return a mask where all lanes are set + */ @ForceInline @SuppressWarnings("unchecked") public static Mask<$Boxtype$> maskAllTrue($Type$Species species) { return VectorIntrinsics.broadcastCoerced((Class<Mask<$Boxtype$>>) species.maskType(), $bitstype$.class, species.length(), ($bitstype$)-1, species, ((z, s) -> trueMask(($Type$Species)s))); } + /** + * Returns a mask where all lanes are unset. + * + * @param species mask species + * @return a mask where all lanes are unset + */ @ForceInline @SuppressWarnings("unchecked") public static Mask<$Boxtype$> maskAllFalse($Type$Species species) { return VectorIntrinsics.broadcastCoerced((Class<Mask<$Boxtype$>>) species.maskType(), $bitstype$.class, species.length(), 0, species, ((z, s) -> falseMask(($Type$Species)s))); } + /** + * Returns a shuffle of mapped indexes where each lane element is + * the result of applying a mapping function to the corresponding lane + * index. + * <p> + * Care should be taken to ensure Shuffle values produced from this + * method are consumed as constants to ensure optimal generation of + * code. For example, values held in static final fields or values + * held in loop constant local variables. + * <p> + * This method behaves as if a shuffle is created from an array of + * mapped indexes as follows: + * <pre>{@code + * int[] a = new int[species.length()]; + * for (int i = 0; i < a.length; i++) { + * a[i] = f.applyAsInt(i); + * } + * return this.shuffleFromValues(a); + * }</pre> + * + * @param species shuffle species + * @param f the lane index mapping function + * @return a shuffle of mapped indexes + */ @ForceInline public static Shuffle<$Boxtype$> shuffle($Type$Species species, IntUnaryOperator f) { if (species.boxType() == $Type$MaxVector.class) return new $Type$MaxVector.$Type$MaxShuffle(f); switch (species.bitSize()) {
*** 467,476 **** --- 541,563 ---- case 512: return new $Type$512Vector.$Type$512Shuffle(f); default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } + /** + * Returns a shuffle where each lane element is the value of its + * corresponding lane index. + * <p> + * This method behaves as if a shuffle is created from an identity + * index mapping function as follows: + * <pre>{@code + * return this.shuffle(i -> i); + * }</pre> + * + * @param species shuffle species + * @return a shuffle of lane indexes + */ @ForceInline public static Shuffle<$Boxtype$> shuffleIota($Type$Species species) { if (species.boxType() == $Type$MaxVector.class) return new $Type$MaxVector.$Type$MaxShuffle(AbstractShuffle.IDENTITY); switch (species.bitSize()) {
*** 480,489 **** --- 567,592 ---- case 512: return new $Type$512Vector.$Type$512Shuffle(AbstractShuffle.IDENTITY); default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } + /** + * Returns a shuffle where each lane element is set to a given + * {@code int} value logically AND'ed by the species length minus one. + * <p> + * For each shuffle lane, where {@code N} is the shuffle lane index, the + * the {@code int} value at index {@code N} logically AND'ed by + * {@code species.length() - 1} is placed into the resulting shuffle at + * lane index {@code N}. + * + * @param species shuffle species + * @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 < species.length()} + */ @ForceInline public static Shuffle<$Boxtype$> shuffleFromValues($Type$Species species, int... ixs) { if (species.boxType() == $Type$MaxVector.class) return new $Type$MaxVector.$Type$MaxShuffle(ixs); switch (species.bitSize()) {
*** 493,502 **** --- 596,620 ---- case 512: return new $Type$512Vector.$Type$512Shuffle(ixs); default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } + /** + * Loads a shuffle from an {@code int} array starting at an offset. + * <p> + * For each shuffle lane, where {@code N} is the shuffle lane index, the + * array element at index {@code i + N} logically AND'ed by + * {@code species.length() - 1} is placed into the resulting shuffle at lane + * index {@code N}. + * + * @param species shuffle species + * @param ixs the {@code int} array + * @param i the offset into the array + * @return a shuffle loaded from the {@code int} array + * @throws IndexOutOfBoundsException if {@code i < 0}, or + * {@code i > a.length - species.length()} + */ @ForceInline public static Shuffle<$Boxtype$> shuffleFromArray($Type$Species species, int[] ixs, int i) { if (species.boxType() == $Type$MaxVector.class) return new $Type$MaxVector.$Type$MaxShuffle(ixs, i); switch (species.bitSize()) {
*** 1822,1832 **** * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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 --- 1940,1950 ---- * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * 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
*** 1838,1848 **** * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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 --- 1956,1966 ---- * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * 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
*** 1869,1879 **** * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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 --- 1987,1997 ---- * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * 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
*** 1887,1897 **** * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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 --- 2005,2015 ---- * <p> * This is a vector binary operation where the primitive logical left shift * operation ({@code <<}) is applied to lane elements 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 ! * 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
*** 1953,1963 **** * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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 --- 2071,2081 ---- * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 ! * 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
*** 1970,1980 **** * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 & 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 --- 2088,2098 ---- * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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. * * @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
*** 2003,2016 **** * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 ! * were subjected to a bitwise logical AND operator & 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] --- 2121,2135 ---- * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 ! * 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]
*** 2021,2034 **** * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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 & 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] --- 2140,2154 ---- * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements 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. * * @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]
*** 2039,2048 **** --- 2159,2169 ---- * <p> * This is a vector binary operation where the primitive logical right shift * operation ({@code >>>}) is applied to lane elements. * * @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, Mask<$Boxtype$> m);
*** 2085,2095 **** * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements to arithmetically * 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 were subjected to a bitwise logical AND operator & 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 --- 2206,2216 ---- * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements to arithmetically * 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 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
*** 2102,2112 **** * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements 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 & 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 --- 2223,2233 ---- * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements 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
*** 2135,2145 **** * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements to arithmetically * 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 were subjected to a bitwise logical AND operator & 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 --- 2256,2266 ---- * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements to arithmetically * 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 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
*** 2154,2164 **** * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements 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 & 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 --- 2275,2285 ---- * <p> * This is a vector binary operation where the primitive arithmetic right * shift operation ({@code >>}) is applied to lane elements 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
*** 2302,2378 **** @Override public abstract void intoByteBuffer(ByteBuffer bb, int ix, Mask<$Boxtype$> m); // Type specific horizontal reductions - /** * Adds all lane elements of this vector. * <p> * This is an associative vector reduction operation where the addition * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0}. * * @return the addition of all the lane elements of this vector */ public abstract $type$ addAll(); /** * Adds all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the addition * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0}. * * @param m the mask controlling lane selection ! * @return the addition of all the lane elements of this vector */ public abstract $type$ addAll(Mask<$Boxtype$> m); /** - * Subtracts all lane elements of this vector. - * <p> - * This is an associative vector reduction operation where the subtraction - * operation ({@code -}) is applied to lane elements, - * and the identity value is {@code 0}. - * - * @return the subtraction of all the lane elements of this vector - */ - public abstract $type$ subAll(); - - /** - * Subtracts all lane elements of this vector, selecting lane elements - * controlled by a mask. - * <p> - * This is an associative vector reduction operation where the subtraction - * operation ({@code -}) is applied to lane elements, - * and the identity value is {@code 0}. - * - * @param m the mask controlling lane selection - * @return the subtraction of all the lane elements of this vector - */ - public abstract $type$ subAll(Mask<$Boxtype$> m); - - /** * Multiplies all lane elements of this vector. * <p> * This is an associative vector reduction operation where the * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1}. * * @return the multiplication of all the lane elements of this vector */ public abstract $type$ mulAll(); /** * Multiplies all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1}. * * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ public abstract $type$ mulAll(Mask<$Boxtype$> m); --- 2423,2532 ---- @Override public abstract void intoByteBuffer(ByteBuffer bb, int ix, Mask<$Boxtype$> m); // Type specific horizontal reductions /** * Adds all lane elements of this vector. * <p> + #if[FP] + * This is a vector reduction operation where the addition + * operation ({@code +}) is applied to lane elements, + * and the identity value is {@code 0.0}. + * + * <p>The value of a floating-point sum is a function both of the input values as well + * as the order of addition operations. The order of addition operations of this method + * is intentionally not defined to allow for JVM to generate optimal machine + * code for the underlying platform at runtime. If the platform supports a vector + * instruction to add all values in the vector, or if there is some other efficient machine + * code sequence, then the JVM has the option of generating this machine code. Otherwise, + * the default implementation of adding vectors sequentially from left to right is used. + * For this reason, the output of this method may vary for the same input values. + #else[FP] * This is an associative vector reduction operation where the addition * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0}. + #end[FP] * * @return the addition of all the lane elements of this vector */ public abstract $type$ addAll(); /** * Adds all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> + #if[FP] + * This is a vector reduction operation where the addition + * operation ({@code +}) is applied to lane elements, + * and the identity value is {@code 0.0}. + * + * <p>The value of a floating-point sum is a function both of the input values as well + * as the order of addition operations. The order of addition operations of this method + * is intentionally not defined to allow for JVM to generate optimal machine + * code for the underlying platform at runtime. If the platform supports a vector + * instruction to add all values in the vector, or if there is some other efficient machine + * code sequence, then the JVM has the option of generating this machine code. Otherwise, + * the default implementation of adding vectors sequentially from left to right is used. + * For this reason, the output of this method may vary on the same input values. + #else[FP] * This is an associative vector reduction operation where the addition * operation ({@code +}) is applied to lane elements, * and the identity value is {@code 0}. + #end[FP] * * @param m the mask controlling lane selection ! * @return the addition of the selected lane elements of this vector */ public abstract $type$ addAll(Mask<$Boxtype$> m); /** * Multiplies all lane elements of this vector. * <p> + #if[FP] + * This is a vector reduction operation where the + * multiplication operation ({@code *}) is applied to lane elements, + * and the identity value is {@code 1.0}. + * + * <p>The order of multiplication operations of this method + * is intentionally not defined to allow for JVM to generate optimal machine + * code for the underlying platform at runtime. If the platform supports a vector + * instruction to multiply all values in the vector, or if there is some other efficient machine + * code sequence, then the JVM has the option of generating this machine code. Otherwise, + * the default implementation of multiplying vectors sequentially from left to right is used. + * For this reason, the output of this method may vary on the same input values. + #else[FP] * This is an associative vector reduction operation where the * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1}. + #end[FP] * * @return the multiplication of all the lane elements of this vector */ public abstract $type$ mulAll(); /** * Multiplies all lane elements of this vector, selecting lane elements * controlled by a mask. * <p> + #if[FP] + * This is a vector reduction operation where the + * multiplication operation ({@code *}) is applied to lane elements, + * and the identity value is {@code 1.0}. + * + * <p>The order of multiplication operations of this method + * is intentionally not defined to allow for JVM to generate optimal machine + * code for the underlying platform at runtime. If the platform supports a vector + * instruction to multiply all values in the vector, or if there is some other efficient machine + * code sequence, then the JVM has the option of generating this machine code. Otherwise, + * the default implementation of multiplying vectors sequentially from left to right is used. + * For this reason, the output of this method may vary on the same input values. + #else[FP] * This is an associative vector reduction operation where the * multiplication operation ({@code *}) is applied to lane elements, * and the identity value is {@code 1}. + #end[FP] * * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ public abstract $type$ mulAll(Mask<$Boxtype$> m);
*** 2380,2390 **** /** * Returns the minimum lane element of this vector. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, ! * and the identity value is {@link $Boxtype$#MAX_VALUE}. * * @return the minimum lane element of this vector */ public abstract $type$ minAll(); --- 2534,2549 ---- /** * Returns the minimum lane element of this vector. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, ! * and the identity value is ! #if[FP] ! * {@link $Boxtype$#POSITIVE_INFINITY}. ! #else[FP] ! * {@link $Boxtype$#MAX_VALUE}. ! #end[FP] * * @return the minimum lane element of this vector */ public abstract $type$ minAll();
*** 2392,2402 **** * Returns the minimum lane element of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, ! * and the identity value is {@link $Boxtype$#MAX_VALUE}. * * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ public abstract $type$ minAll(Mask<$Boxtype$> m); --- 2551,2566 ---- * Returns the minimum lane element of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.min(a, b)} is applied to lane elements, ! * and the identity value is ! #if[FP] ! * {@link $Boxtype$#POSITIVE_INFINITY}. ! #else[FP] ! * {@link $Boxtype$#MAX_VALUE}. ! #end[FP] * * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ public abstract $type$ minAll(Mask<$Boxtype$> m);
*** 2404,2414 **** /** * Returns the maximum lane element of this vector. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, ! * and the identity value is {@link $Boxtype$#MIN_VALUE}. * * @return the maximum lane element of this vector */ public abstract $type$ maxAll(); --- 2568,2583 ---- /** * Returns the maximum lane element of this vector. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, ! * and the identity value is ! #if[FP] ! * {@link $Boxtype$#NEGATIVE_INFINITY}. ! #else[FP] ! * {@link $Boxtype$#MIN_VALUE}. ! #end[FP] * * @return the maximum lane element of this vector */ public abstract $type$ maxAll();
*** 2416,2426 **** * Returns the maximum lane element of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, ! * and the identity value is {@link $Boxtype$#MIN_VALUE}. * * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ public abstract $type$ maxAll(Mask<$Boxtype$> m); --- 2585,2600 ---- * Returns the maximum lane element of this vector, selecting lane elements * controlled by a mask. * <p> * This is an associative vector reduction operation where the operation * {@code (a, b) -> Math.max(a, b)} is applied to lane elements, ! * and the identity value is ! #if[FP] ! * {@link $Boxtype$#NEGATIVE_INFINITY}. ! #else[FP] ! * {@link $Boxtype$#MIN_VALUE}. ! #end[FP] * * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ public abstract $type$ maxAll(Mask<$Boxtype$> m);
*** 2641,2653 **** @Override public abstract $Type$Species species(); /** ! * A specialized factory for creating {@link $abstractvectortype$} value of the same ! * shape, and a {@link Mask} and {@link Shuffle} values of the same shape ! * and {@code int} element type. */ public static abstract class $Type$Species extends Vector.Species<$Boxtype$> { interface FOp { $type$ apply(int i); } --- 2815,2825 ---- @Override public abstract $Type$Species species(); /** ! * Class representing {@link $abstractvectortype$}'s of the same {@link Vector.Shape Shape}. */ public static abstract class $Type$Species extends Vector.Species<$Boxtype$> { interface FOp { $type$ apply(int i); }
*** 2699,2709 **** /** * Returns a vector where each lane element is set to a randomly * generated primitive value. * * The semantics are equivalent to calling ! * {@link {#if[FP]?ThreadLocalRandom#next$Type$:($type$)ThreadLocalRandom#nextInt()} } * * @return a vector where each lane elements is set to a randomly * generated primitive value */ #if[intOrLong] --- 2871,2885 ---- /** * Returns a vector where each lane element is set to a randomly * generated primitive value. * * The semantics are equivalent to calling ! #if[FP] ! * {@code ThreadLocalRandom#next$Type$}. ! #else[FP] ! * {@code ($type$)ThreadLocalRandom#nextInt()}. ! #end[FP] * * @return a vector where each lane elements is set to a randomly * generated primitive value */ #if[intOrLong]
< prev index next >