< prev index next >

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

Print this page

        

*** 110,120 **** * @return a zero vector of given species */ @ForceInline @SuppressWarnings("unchecked") public static DoubleVector zero(VectorSpecies<Double> species) { ! return VectorIntrinsics.broadcastCoerced((Class<DoubleVector>) species.boxType(), double.class, species.length(), Double.doubleToLongBits(0.0f), species, ((bits, s) -> ((DoubleSpecies)s).op(i -> Double.longBitsToDouble((long)bits)))); } /** --- 110,120 ---- * @return a zero vector of given species */ @ForceInline @SuppressWarnings("unchecked") public static DoubleVector zero(VectorSpecies<Double> species) { ! 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)))); } /**
*** 140,150 **** @ForceInline @SuppressWarnings("unchecked") public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); ! return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { ByteBuffer bbc = ByteBuffer.wrap(c, idx, a.length - idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); --- 140,150 ---- @ForceInline @SuppressWarnings("unchecked") public static DoubleVector fromByteArray(VectorSpecies<Double> species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); ! return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { ByteBuffer bbc = ByteBuffer.wrap(c, idx, a.length - idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer();
*** 198,208 **** @ForceInline @SuppressWarnings("unchecked") public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n])); } --- 198,208 ---- @ForceInline @SuppressWarnings("unchecked") public static DoubleVector fromArray(VectorSpecies<Double> species, double[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n])); }
*** 264,275 **** // Index vector: vix[0:n] = k -> a_offset + indexMap[i_offset + k] IntVector vix = IntVector.fromArray(IntVector.species(species.indexShape()), indexMap, i_offset).add(a_offset); vix = VectorIntrinsics.checkIndex(vix, a.length); ! return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.boxType(), double.class, species.length(), ! IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (double[] c, int idx, int[] iMap, int idy, VectorSpecies<Double> s) -> ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]])); } --- 264,275 ---- // Index vector: vix[0:n] = k -> a_offset + indexMap[i_offset + k] IntVector vix = IntVector.fromArray(IntVector.species(species.indexShape()), indexMap, i_offset).add(a_offset); vix = VectorIntrinsics.checkIndex(vix, a.length); ! return VectorIntrinsics.loadWithMap((Class<DoubleVector>) species.vectorType(), double.class, species.length(), ! IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (double[] c, int idx, int[] iMap, int idy, VectorSpecies<Double> s) -> ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]])); }
*** 334,344 **** public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset) { if (bb.order() != ByteOrder.nativeOrder()) { throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); ! return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { ByteBuffer bbc = c.duplicate().position(idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer(); --- 334,344 ---- public static DoubleVector fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset) { if (bb.order() != ByteOrder.nativeOrder()) { throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); ! return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { ByteBuffer bbc = c.duplicate().position(idx).order(ByteOrder.nativeOrder()); DoubleBuffer tb = bbc.asDoubleBuffer();
*** 398,408 **** */ @ForceInline @SuppressWarnings("unchecked") public static DoubleVector broadcast(VectorSpecies<Double> species, double e) { return VectorIntrinsics.broadcastCoerced( ! (Class<DoubleVector>) species.boxType(), double.class, species.length(), Double.doubleToLongBits(e), species, ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits)))); } /** --- 398,408 ---- */ @ForceInline @SuppressWarnings("unchecked") public static DoubleVector broadcast(VectorSpecies<Double> species, double e) { return VectorIntrinsics.broadcastCoerced( ! (Class<DoubleVector>) species.vectorType(), double.class, species.length(), Double.doubleToLongBits(e), species, ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits)))); } /**
*** 422,432 **** @ForceInline @SuppressWarnings("unchecked") public static DoubleVector scalars(VectorSpecies<Double> species, double... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) species.boxType(), double.class, species.length(), es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n])); } --- 422,432 ---- @ForceInline @SuppressWarnings("unchecked") public static DoubleVector scalars(VectorSpecies<Double> species, double... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); ! return VectorIntrinsics.load((Class<DoubleVector>) species.vectorType(), double.class, species.length(), es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n])); }
*** 800,828 **** /** * {@inheritDoc} */ @Override ! public abstract DoubleVector rotateEL(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector rotateER(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector shiftEL(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector shiftER(int i); /** * Divides this vector by an input vector. * <p> * This is a lane-wise binary operation which applies the primitive division --- 800,828 ---- /** * {@inheritDoc} */ @Override ! public abstract DoubleVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override ! public abstract DoubleVector shiftLanesRight(int i); /** * Divides this vector by an input vector. * <p> * This is a lane-wise binary operation which applies the primitive division
*** 1978,1994 **** */ static final class DoubleSpecies extends AbstractSpecies<Double> { final Function<double[], DoubleVector> vectorFactory; private DoubleSpecies(VectorShape shape, ! Class<?> boxType, Class<?> maskType, Function<double[], DoubleVector> vectorFactory, Function<boolean[], VectorMask<Double>> maskFactory, Function<IntUnaryOperator, VectorShuffle<Double>> shuffleFromArrayFactory, fShuffleFromArray<Double> shuffleFromOpFactory) { ! super(shape, double.class, Double.SIZE, boxType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } interface FOp { --- 1978,1994 ---- */ static final class DoubleSpecies extends AbstractSpecies<Double> { final Function<double[], DoubleVector> vectorFactory; private DoubleSpecies(VectorShape shape, ! Class<?> vectorType, Class<?> maskType, Function<double[], DoubleVector> vectorFactory, Function<boolean[], VectorMask<Double>> maskFactory, Function<IntUnaryOperator, VectorShuffle<Double>> shuffleFromArrayFactory, fShuffleFromArray<Double> shuffleFromOpFactory) { ! super(shape, double.class, Double.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } interface FOp {
< prev index next >