< prev index next >

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

Print this page
rev 55885 : 8222752: [vector] Javadoc changes for Vector api
Summary: Javadoc changes for Vector api
Reviewed-by: jrose, briangoetz, vlivanov, sviswanathan

*** 177,217 **** Class<?> stype = s.elementType(); if (stype == byte.class) { byte[] a = new byte[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (byte) this.get(i); } return (Vector) ByteVector.fromArray((VectorSpecies<Byte>) s, a, 0); } else if (stype == short.class) { short[] a = new short[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (short) this.get(i); } return (Vector) ShortVector.fromArray((VectorSpecies<Short>) s, a, 0); } else if (stype == int.class) { int[] a = new int[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (int) this.get(i); } return (Vector) IntVector.fromArray((VectorSpecies<Integer>) s, a, 0); } else if (stype == long.class) { long[] a = new long[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (long) this.get(i); } return (Vector) LongVector.fromArray((VectorSpecies<Long>) s, a, 0); } else if (stype == float.class) { float[] a = new float[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (float) this.get(i); } return (Vector) FloatVector.fromArray((VectorSpecies<Float>) s, a, 0); } else if (stype == double.class) { double[] a = new double[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (double) this.get(i); } return (Vector) DoubleVector.fromArray((VectorSpecies<Double>) s, a, 0); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } --- 177,217 ---- Class<?> stype = s.elementType(); if (stype == byte.class) { byte[] a = new byte[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (byte) this.lane(i); } return (Vector) ByteVector.fromArray((VectorSpecies<Byte>) s, a, 0); } else if (stype == short.class) { short[] a = new short[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (short) this.lane(i); } return (Vector) ShortVector.fromArray((VectorSpecies<Short>) s, a, 0); } else if (stype == int.class) { int[] a = new int[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (int) this.lane(i); } return (Vector) IntVector.fromArray((VectorSpecies<Integer>) s, a, 0); } else if (stype == long.class) { long[] a = new long[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (long) this.lane(i); } return (Vector) LongVector.fromArray((VectorSpecies<Long>) s, a, 0); } else if (stype == float.class) { float[] a = new float[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (float) this.lane(i); } return (Vector) FloatVector.fromArray((VectorSpecies<Float>) s, a, 0); } else if (stype == double.class) { double[] a = new double[limit]; for (int i = 0; i < limit; i++) { ! a[i] = (double) this.lane(i); } return (Vector) DoubleVector.fromArray((VectorSpecies<Double>) s, a, 0); } else { throw new UnsupportedOperationException("Bad lane type for casting."); }
*** 1226,1237 **** return VectorIntrinsics.rearrangeOp( FloatMaxVector.class, FloatMaxShuffle.class, float.class, LENGTH, this, s, (v1, s_) -> v1.uOp((i, a) -> { ! int ei = s_.getElement(i); ! return v1.get(ei); })); } @Override @ForceInline --- 1226,1237 ---- return VectorIntrinsics.rearrangeOp( FloatMaxVector.class, FloatMaxShuffle.class, float.class, LENGTH, this, s, (v1, s_) -> v1.uOp((i, a) -> { ! int ei = s_.lane(i); ! return v1.lane(ei); })); } @Override @ForceInline
*** 1242,1258 **** FloatMaxMask m = (FloatMaxMask)o2; return VectorIntrinsics.blend( FloatMaxVector.class, FloatMaxMask.class, float.class, LENGTH, this, v, m, ! (v1, v2, m_) -> v1.bOp(v2, (i, a, b) -> m_.getElement(i) ? b : a)); } // Accessors @Override ! public float get(int i) { if (i < 0 || i >= LENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + LENGTH); } int bits = (int) VectorIntrinsics.extract( FloatMaxVector.class, float.class, LENGTH, --- 1242,1258 ---- FloatMaxMask m = (FloatMaxMask)o2; return VectorIntrinsics.blend( FloatMaxVector.class, FloatMaxMask.class, float.class, LENGTH, this, v, m, ! (v1, v2, m_) -> v1.bOp(v2, (i, a, b) -> m_.lane(i) ? b : a)); } // Accessors @Override ! public float lane(int i) { if (i < 0 || i >= LENGTH) { throw new IllegalArgumentException("Index " + i + " must be zero or positive, and less than " + LENGTH); } int bits = (int) VectorIntrinsics.extract( FloatMaxVector.class, float.class, LENGTH,
*** 1450,1460 **** @Override public FloatVector toVector() { float[] va = new float[SPECIES.length()]; for (int i = 0; i < va.length; i++) { ! va[i] = (float) getElement(i); } return FloatVector.fromArray(SPECIES, va, 0); } @Override --- 1450,1460 ---- @Override public FloatVector toVector() { float[] va = new float[SPECIES.length()]; for (int i = 0; i < va.length; i++) { ! va[i] = (float) lane(i); } return FloatVector.fromArray(SPECIES, va, 0); } @Override
< prev index next >