< prev index next >

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

Print this page

        

*** 115,124 **** --- 115,144 ---- return VectorIntrinsics.broadcastCoerced((Class<DoubleVector>) species.vectorType(), double.class, species.length(), Double.doubleToLongBits(0.0f), species, ((bits, s) -> ((DoubleSpecies)s).op(i -> Double.longBitsToDouble((long)bits)))); } + @ForceInline + @SuppressWarnings("unchecked") + static VectorShuffle<Double> shuffleIotaHelper(VectorSpecies<Double> species, int step) { + switch (species.bitSize()) { + case 64: return VectorIntrinsics.shuffleIota(double.class, Double64Vector.Double64Shuffle.class, species, + 64 / Double.SIZE, step, + (val, l) -> new Double64Vector.Double64Shuffle(i -> ((i + val) & (l-1)))); + case 128: return VectorIntrinsics.shuffleIota(double.class, Double128Vector.Double128Shuffle.class, species, + 128/ Double.SIZE, step, + (val, l) -> new Double128Vector.Double128Shuffle(i -> ((i + val) & (l-1)))); + case 256: return VectorIntrinsics.shuffleIota(double.class, Double256Vector.Double256Shuffle.class, species, + 256/ Double.SIZE, step, + (val, l) -> new Double256Vector.Double256Shuffle(i -> ((i + val) & (l-1)))); + case 512: return VectorIntrinsics.shuffleIota(double.class, Double512Vector.Double512Shuffle.class, species, + 512 / Double.SIZE, step, + (val, l) -> new Double512Vector.Double512Shuffle(i -> ((i + val) & (l-1)))); + default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); + } + } + /** * Loads a vector from a byte array starting at an offset. * <p> * Bytes are composed into primitive lane elements according to the * native byte order of the underlying platform
< prev index next >