< prev index next >
test/jdk/jdk/incubator/vector/LongMaxVectorTests.java
Print this page
rev 55894 : 8222897: [vector] Renaming of shift, rotate operations. Few other api changes.
Summary: Renaming of shift, rotate operations. Few other api changes.
Reviewed-by: jrose, briangoetz
@@ -684,35 +684,35 @@
assertArraysEquals(a, b, r, mask, LongMaxVectorTests::xor);
}
- static long shiftR(long a, long b) {
- return (long)((a >>> b));
+ static long shiftLeft(long a, long b) {
+ return (long)((a << b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void shiftRLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftLeftLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.shiftR(bv).intoArray(r, i);
+ av.shiftLeft(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, LongMaxVectorTests::shiftR);
+ assertArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void shiftRLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftLeftLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -720,43 +720,47 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.shiftR(bv, vmask).intoArray(r, i);
+ av.shiftLeft(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftR);
+ assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftLeft);
}
- static long shiftL(long a, long b) {
- return (long)((a << b));
+
+
+
+
+ static long shiftRight(long a, long b) {
+ return (long)((a >>> b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void shiftLLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftRightLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.shiftL(bv).intoArray(r, i);
+ av.shiftRight(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, LongMaxVectorTests::shiftL);
+ assertArraysEquals(a, b, r, LongMaxVectorTests::shiftRight);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void shiftLLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftRightLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -764,43 +768,47 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.shiftL(bv, vmask).intoArray(r, i);
+ av.shiftRight(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftL);
+ assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftRight);
}
- static long aShiftR(long a, long b) {
+
+
+
+
+ static long shiftArithmeticRight(long a, long b) {
return (long)((a >> b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void aShiftRLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftArithmeticRightLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.aShiftR(bv).intoArray(r, i);
+ av.shiftArithmeticRight(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, LongMaxVectorTests::aShiftR);
+ assertArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void aShiftRLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftArithmeticRightLongMaxVectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -808,155 +816,159 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
LongVector bv = LongVector.fromArray(SPECIES, b, i);
- av.aShiftR(bv, vmask).intoArray(r, i);
+ av.shiftArithmeticRight(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, LongMaxVectorTests::aShiftR);
+ assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftArithmeticRight);
}
- static long aShiftR_unary(long a, long b) {
- return (long)((a >> b));
+
+
+
+
+ static long shiftLeft_unary(long a, long b) {
+ return (long)((a << b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void aShiftRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftLeftLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.aShiftR((int)b[i]).intoArray(r, i);
+ av.shiftLeft((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, LongMaxVectorTests::aShiftR_unary);
+ assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft_unary);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void aShiftRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftLeftLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.aShiftR((int)b[i], vmask).intoArray(r, i);
+ av.shiftLeft((int)b[i], vmask).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::aShiftR_unary);
+ assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftLeft_unary);
}
- static long shiftR_unary(long a, long b) {
+
+
+
+
+ static long shiftRight_unary(long a, long b) {
return (long)((a >>> b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void shiftRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftRightLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.shiftR((int)b[i]).intoArray(r, i);
+ av.shiftRight((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftR_unary);
+ assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftRight_unary);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void shiftRLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftRightLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.shiftR((int)b[i], vmask).intoArray(r, i);
+ av.shiftRight((int)b[i], vmask).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftR_unary);
+ assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftRight_unary);
}
- static long shiftL_unary(long a, long b) {
- return (long)((a << b));
+
+
+
+
+ static long shiftArithmeticRight_unary(long a, long b) {
+ return (long)((a >> b));
}
@Test(dataProvider = "longBinaryOpProvider")
- static void shiftLLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+ static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.shiftL((int)b[i]).intoArray(r, i);
+ av.shiftArithmeticRight((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftL_unary);
+ assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight_unary);
}
@Test(dataProvider = "longBinaryOpMaskProvider")
- static void shiftLLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
+ static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction<long[]> fa, IntFunction<long[]> fb,
IntFunction<boolean[]> fm) {
long[] a = fa.apply(SPECIES.length());
long[] b = fb.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Long> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- av.shiftL((int)b[i], vmask).intoArray(r, i);
+ av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftL_unary);
+ assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftArithmeticRight_unary);
}
-
-
-
-
-
-
-
-
static long max(long a, long b) {
return (long)(Math.max(a, b));
}
@Test(dataProvider = "longBinaryOpProvider")
@@ -994,20 +1006,20 @@
}
assertArraysEquals(a, b, r, LongMaxVectorTests::min);
}
- static long andAll(long[] a, int idx) {
+ static long andLanes(long[] a, int idx) {
long res = -1;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res &= a[i];
}
return res;
}
- static long andAll(long[] a) {
+ static long andLanes(long[] a) {
long res = -1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
long tmp = -1;
for (int j = 0; j < SPECIES.length(); j++) {
tmp &= a[i + j];
@@ -1018,44 +1030,44 @@
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void andAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void andLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = -1;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.andAll();
+ r[i] = av.andLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = -1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra &= av.andAll();
+ ra &= av.andLanes();
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::andAll, LongMaxVectorTests::andAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::andLanes, LongMaxVectorTests::andLanes);
}
- static long orAll(long[] a, int idx) {
+ static long orLanes(long[] a, int idx) {
long res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res |= a[i];
}
return res;
}
- static long orAll(long[] a) {
+ static long orLanes(long[] a) {
long res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
long tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp |= a[i + j];
@@ -1066,44 +1078,44 @@
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void orAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void orLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.orAll();
+ r[i] = av.orLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra |= av.orAll();
+ ra |= av.orLanes();
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::orAll, LongMaxVectorTests::orAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::orLanes, LongMaxVectorTests::orLanes);
}
- static long xorAll(long[] a, int idx) {
+ static long xorLanes(long[] a, int idx) {
long res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res ^= a[i];
}
return res;
}
- static long xorAll(long[] a) {
+ static long xorLanes(long[] a) {
long res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
long tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp ^= a[i + j];
@@ -1114,43 +1126,43 @@
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void xorAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void xorLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.xorAll();
+ r[i] = av.xorLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra ^= av.xorAll();
+ ra ^= av.xorLanes();
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::xorAll, LongMaxVectorTests::xorAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::xorLanes, LongMaxVectorTests::xorLanes);
}
- static long addAll(long[] a, int idx) {
+ static long addLanes(long[] a, int idx) {
long res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res += a[i];
}
return res;
}
- static long addAll(long[] a) {
+ static long addLanes(long[] a) {
long res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
long tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp += a[i + j];
@@ -1159,42 +1171,42 @@
}
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void addAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void addLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.addAll();
+ r[i] = av.addLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra += av.addAll();
+ ra += av.addLanes();
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::addAll, LongMaxVectorTests::addAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::addLanes, LongMaxVectorTests::addLanes);
}
- static long mulAll(long[] a, int idx) {
+ static long mulLanes(long[] a, int idx) {
long res = 1;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res *= a[i];
}
return res;
}
- static long mulAll(long[] a) {
+ static long mulLanes(long[] a) {
long res = 1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
long tmp = 1;
for (int j = 0; j < SPECIES.length(); j++) {
tmp *= a[i + j];
@@ -1203,111 +1215,111 @@
}
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void mulAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void mulLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = 1;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.mulAll();
+ r[i] = av.mulLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = 1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra *= av.mulAll();
+ ra *= av.mulLanes();
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::mulAll, LongMaxVectorTests::mulAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::mulLanes, LongMaxVectorTests::mulLanes);
}
- static long minAll(long[] a, int idx) {
+ static long minLanes(long[] a, int idx) {
long res = Long.MAX_VALUE;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (long)Math.min(res, a[i]);
}
return res;
}
- static long minAll(long[] a) {
+ static long minLanes(long[] a) {
long res = Long.MAX_VALUE;
for (int i = 0; i < a.length; i++) {
res = (long)Math.min(res, a[i]);
}
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void minAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void minLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = Long.MAX_VALUE;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.minAll();
+ r[i] = av.minLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Long.MAX_VALUE;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra = (long)Math.min(ra, av.minAll());
+ ra = (long)Math.min(ra, av.minLanes());
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::minAll, LongMaxVectorTests::minAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::minLanes, LongMaxVectorTests::minLanes);
}
- static long maxAll(long[] a, int idx) {
+ static long maxLanes(long[] a, int idx) {
long res = Long.MIN_VALUE;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (long)Math.max(res, a[i]);
}
return res;
}
- static long maxAll(long[] a) {
+ static long maxLanes(long[] a) {
long res = Long.MIN_VALUE;
for (int i = 0; i < a.length; i++) {
res = (long)Math.max(res, a[i]);
}
return res;
}
@Test(dataProvider = "longUnaryOpProvider")
- static void maxAllLongMaxVectorTests(IntFunction<long[]> fa) {
+ static void maxLanesLongMaxVectorTests(IntFunction<long[]> fa) {
long[] a = fa.apply(SPECIES.length());
long[] r = fr.apply(SPECIES.length());
long ra = Long.MIN_VALUE;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- r[i] = av.maxAll();
+ r[i] = av.maxLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Long.MIN_VALUE;
for (int i = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
- ra = (long)Math.max(ra, av.maxAll());
+ ra = (long)Math.max(ra, av.maxLanes());
}
}
- assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::maxAll, LongMaxVectorTests::maxAll);
+ assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::maxLanes, LongMaxVectorTests::maxLanes);
}
static boolean anyTrue(boolean[] a, int idx) {
boolean res = false;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
< prev index next >