< prev index next >
test/jdk/jdk/incubator/vector/Int128VectorTests.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
@@ -680,35 +680,35 @@
assertArraysEquals(a, b, r, mask, Int128VectorTests::xor);
}
- static int shiftR(int a, int b) {
- return (int)((a >>> b));
+ static int shiftLeft(int a, int b) {
+ return (int)((a << b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void shiftRInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftLeftInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.shiftR(bv).intoArray(r, i);
+ av.shiftLeft(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, Int128VectorTests::shiftR);
+ assertArraysEquals(a, b, r, Int128VectorTests::shiftLeft);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void shiftRInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftLeftInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -716,43 +716,47 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.shiftR(bv, vmask).intoArray(r, i);
+ av.shiftLeft(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftR);
+ assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftLeft);
}
- static int shiftL(int a, int b) {
- return (int)((a << b));
+
+
+
+
+ static int shiftRight(int a, int b) {
+ return (int)((a >>> b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void shiftLInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftRightInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.shiftL(bv).intoArray(r, i);
+ av.shiftRight(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, Int128VectorTests::shiftL);
+ assertArraysEquals(a, b, r, Int128VectorTests::shiftRight);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void shiftLInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftRightInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -760,43 +764,47 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.shiftL(bv, vmask).intoArray(r, i);
+ av.shiftRight(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftL);
+ assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftRight);
}
- static int aShiftR(int a, int b) {
+
+
+
+
+ static int shiftArithmeticRight(int a, int b) {
return (int)((a >> b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void aShiftRInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftArithmeticRightInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.aShiftR(bv).intoArray(r, i);
+ av.shiftArithmeticRight(bv).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, Int128VectorTests::aShiftR);
+ assertArraysEquals(a, b, r, Int128VectorTests::shiftArithmeticRight);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void aShiftRInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftArithmeticRightInt128VectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
@@ -804,155 +812,159 @@
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
IntVector bv = IntVector.fromArray(SPECIES, b, i);
- av.aShiftR(bv, vmask).intoArray(r, i);
+ av.shiftArithmeticRight(bv, vmask).intoArray(r, i);
}
}
- assertArraysEquals(a, b, r, mask, Int128VectorTests::aShiftR);
+ assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftArithmeticRight);
}
- static int aShiftR_unary(int a, int b) {
- return (int)((a >> b));
+
+
+
+
+ static int shiftLeft_unary(int a, int b) {
+ return (int)((a << b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void aShiftRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftLeftInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- av.aShiftR((int)b[i]).intoArray(r, i);
+ av.shiftLeft((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, Int128VectorTests::aShiftR_unary);
+ assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftLeft_unary);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void aShiftRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftLeftInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Integer> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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, Int128VectorTests::aShiftR_unary);
+ assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftLeft_unary);
}
- static int shiftR_unary(int a, int b) {
+
+
+
+
+ static int shiftRight_unary(int a, int b) {
return (int)((a >>> b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void shiftRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftRightInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- av.shiftR((int)b[i]).intoArray(r, i);
+ av.shiftRight((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftR_unary);
+ assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftRight_unary);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void shiftRInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftRightInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Integer> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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, Int128VectorTests::shiftR_unary);
+ assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftRight_unary);
}
- static int shiftL_unary(int a, int b) {
- return (int)((a << b));
+
+
+
+
+ static int shiftArithmeticRight_unary(int a, int b) {
+ return (int)((a >> b));
}
@Test(dataProvider = "intBinaryOpProvider")
- static void shiftLInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+ static void shiftArithmeticRightInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- av.shiftL((int)b[i]).intoArray(r, i);
+ av.shiftArithmeticRight((int)b[i]).intoArray(r, i);
}
}
- assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftL_unary);
+ assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftArithmeticRight_unary);
}
@Test(dataProvider = "intBinaryOpMaskProvider")
- static void shiftLInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
+ static void shiftArithmeticRightInt128VectorTestsShift(IntFunction<int[]> fa, IntFunction<int[]> fb,
IntFunction<boolean[]> fm) {
int[] a = fa.apply(SPECIES.length());
int[] b = fb.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
boolean[] mask = fm.apply(SPECIES.length());
VectorMask<Integer> vmask = VectorMask.fromValues(SPECIES, mask);
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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, Int128VectorTests::shiftL_unary);
+ assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftArithmeticRight_unary);
}
-
-
-
-
-
-
-
-
static int max(int a, int b) {
return (int)(Math.max(a, b));
}
@Test(dataProvider = "intBinaryOpProvider")
@@ -990,20 +1002,20 @@
}
assertArraysEquals(a, b, r, Int128VectorTests::min);
}
- static int andAll(int[] a, int idx) {
+ static int andLanes(int[] a, int idx) {
int res = -1;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res &= a[i];
}
return res;
}
- static int andAll(int[] a) {
+ static int andLanes(int[] a) {
int res = -1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
int tmp = -1;
for (int j = 0; j < SPECIES.length(); j++) {
tmp &= a[i + j];
@@ -1014,44 +1026,44 @@
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void andAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void andLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = -1;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra &= av.andAll();
+ ra &= av.andLanes();
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::andAll, Int128VectorTests::andAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::andLanes, Int128VectorTests::andLanes);
}
- static int orAll(int[] a, int idx) {
+ static int orLanes(int[] a, int idx) {
int res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res |= a[i];
}
return res;
}
- static int orAll(int[] a) {
+ static int orLanes(int[] a) {
int res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
int tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp |= a[i + j];
@@ -1062,44 +1074,44 @@
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void orAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void orLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra |= av.orAll();
+ ra |= av.orLanes();
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::orAll, Int128VectorTests::orAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::orLanes, Int128VectorTests::orLanes);
}
- static int xorAll(int[] a, int idx) {
+ static int xorLanes(int[] a, int idx) {
int res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res ^= a[i];
}
return res;
}
- static int xorAll(int[] a) {
+ static int xorLanes(int[] a) {
int res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
int tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp ^= a[i + j];
@@ -1110,43 +1122,43 @@
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void xorAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void xorLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra ^= av.xorAll();
+ ra ^= av.xorLanes();
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::xorAll, Int128VectorTests::xorAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::xorLanes, Int128VectorTests::xorLanes);
}
- static int addAll(int[] a, int idx) {
+ static int addLanes(int[] a, int idx) {
int res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res += a[i];
}
return res;
}
- static int addAll(int[] a) {
+ static int addLanes(int[] a) {
int res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
int tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp += a[i + j];
@@ -1155,42 +1167,42 @@
}
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void addAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void addLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra += av.addAll();
+ ra += av.addLanes();
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::addAll, Int128VectorTests::addAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::addLanes, Int128VectorTests::addLanes);
}
- static int mulAll(int[] a, int idx) {
+ static int mulLanes(int[] a, int idx) {
int res = 1;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res *= a[i];
}
return res;
}
- static int mulAll(int[] a) {
+ static int mulLanes(int[] a) {
int res = 1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
int tmp = 1;
for (int j = 0; j < SPECIES.length(); j++) {
tmp *= a[i + j];
@@ -1199,111 +1211,111 @@
}
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void mulAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void mulLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = 1;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.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()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra *= av.mulAll();
+ ra *= av.mulLanes();
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::mulAll, Int128VectorTests::mulAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::mulLanes, Int128VectorTests::mulLanes);
}
- static int minAll(int[] a, int idx) {
+ static int minLanes(int[] a, int idx) {
int res = Integer.MAX_VALUE;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (int)Math.min(res, a[i]);
}
return res;
}
- static int minAll(int[] a) {
+ static int minLanes(int[] a) {
int res = Integer.MAX_VALUE;
for (int i = 0; i < a.length; i++) {
res = (int)Math.min(res, a[i]);
}
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void minAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void minLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = Integer.MAX_VALUE;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- r[i] = av.minAll();
+ r[i] = av.minLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Integer.MAX_VALUE;
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra = (int)Math.min(ra, av.minAll());
+ ra = (int)Math.min(ra, av.minLanes());
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::minAll, Int128VectorTests::minAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::minLanes, Int128VectorTests::minLanes);
}
- static int maxAll(int[] a, int idx) {
+ static int maxLanes(int[] a, int idx) {
int res = Integer.MIN_VALUE;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (int)Math.max(res, a[i]);
}
return res;
}
- static int maxAll(int[] a) {
+ static int maxLanes(int[] a) {
int res = Integer.MIN_VALUE;
for (int i = 0; i < a.length; i++) {
res = (int)Math.max(res, a[i]);
}
return res;
}
@Test(dataProvider = "intUnaryOpProvider")
- static void maxAllInt128VectorTests(IntFunction<int[]> fa) {
+ static void maxLanesInt128VectorTests(IntFunction<int[]> fa) {
int[] a = fa.apply(SPECIES.length());
int[] r = fr.apply(SPECIES.length());
int ra = Integer.MIN_VALUE;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- r[i] = av.maxAll();
+ r[i] = av.maxLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Integer.MIN_VALUE;
for (int i = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
- ra = (int)Math.max(ra, av.maxAll());
+ ra = (int)Math.max(ra, av.maxLanes());
}
}
- assertReductionArraysEquals(a, r, ra, Int128VectorTests::maxAll, Int128VectorTests::maxAll);
+ assertReductionArraysEquals(a, r, ra, Int128VectorTests::maxLanes, Int128VectorTests::maxLanes);
}
static boolean anyTrue(boolean[] a, int idx) {
boolean res = false;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
< prev index next >