< prev index next >

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

Print this page




 183      * {@code < species.length()}
 184      */
 185     @ForceInline
 186     public static <E> VectorShuffle<E> fromValues(VectorSpecies<E> species, int... ixs) {
 187         return ((AbstractSpecies<E>) species).shuffleFromArrayFactory.apply(ixs, 0);
 188     }
 189 
 190     /**
 191      * Loads a shuffle from an {@code int} array starting at an offset.
 192      * <p>
 193      * For each shuffle lane, where {@code N} is the shuffle lane index, the
 194      * array element at index {@code i + N} logically AND'ed by
 195      * {@code species.length() - 1} is placed into the resulting shuffle at lane
 196      * index {@code N}.
 197      *
 198      * @param species shuffle species
 199      * @param ixs the {@code int} array
 200      * @param offset the offset into the array
 201      * @return a shuffle loaded from the {@code int} array
 202      * @throws IndexOutOfBoundsException if {@code offset < 0}, or
 203      * {@code offset > a.length - species.length()}
 204      */
 205     @ForceInline
 206     public static <E> VectorShuffle<E> fromArray(VectorSpecies<E> species, int[] ixs, int offset) {
 207         return ((AbstractSpecies<E>) species).shuffleFromArrayFactory.apply(ixs, offset);
 208     }
 209 
 210     /**
 211      * Returns an {@code int} array containing the lane elements of this
 212      * shuffle.
 213      * <p>
 214      * This method behaves as if it {@link #intoArray(int[], int)} stores}
 215      * this shuffle into an allocated array and returns that array as
 216      * follows:
 217      * <pre>{@code
 218      *   int[] a = new int[this.length()];
 219      *   VectorShuffle.intoArray(a, 0);
 220      *   return a;
 221      * }</pre>
 222      *
 223      * @return an array containing the the lane elements of this vector




 183      * {@code < species.length()}
 184      */
 185     @ForceInline
 186     public static <E> VectorShuffle<E> fromValues(VectorSpecies<E> species, int... ixs) {
 187         return ((AbstractSpecies<E>) species).shuffleFromArrayFactory.apply(ixs, 0);
 188     }
 189 
 190     /**
 191      * Loads a shuffle from an {@code int} array starting at an offset.
 192      * <p>
 193      * For each shuffle lane, where {@code N} is the shuffle lane index, the
 194      * array element at index {@code i + N} logically AND'ed by
 195      * {@code species.length() - 1} is placed into the resulting shuffle at lane
 196      * index {@code N}.
 197      *
 198      * @param species shuffle species
 199      * @param ixs the {@code int} array
 200      * @param offset the offset into the array
 201      * @return a shuffle loaded from the {@code int} array
 202      * @throws IndexOutOfBoundsException if {@code offset < 0}, or
 203      * {@code offset > ixs.length - species.length()}
 204      */
 205     @ForceInline
 206     public static <E> VectorShuffle<E> fromArray(VectorSpecies<E> species, int[] ixs, int offset) {
 207         return ((AbstractSpecies<E>) species).shuffleFromArrayFactory.apply(ixs, offset);
 208     }
 209 
 210     /**
 211      * Returns an {@code int} array containing the lane elements of this
 212      * shuffle.
 213      * <p>
 214      * This method behaves as if it {@link #intoArray(int[], int)} stores}
 215      * this shuffle into an allocated array and returns that array as
 216      * follows:
 217      * <pre>{@code
 218      *   int[] a = new int[this.length()];
 219      *   VectorShuffle.intoArray(a, 0);
 220      *   return a;
 221      * }</pre>
 222      *
 223      * @return an array containing the the lane elements of this vector


< prev index next >