--- old/test/jdk/jdk/incubator/vector/Int128VectorTests.java 2019-04-26 14:53:32.475199900 -0700 +++ new/test/jdk/jdk/incubator/vector/Int128VectorTests.java 2019-04-26 14:53:31.871321900 -0700 @@ -682,12 +682,12 @@ } - 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 fa, IntFunction fb) { + static void shiftLeftInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ 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 fa, IntFunction fb, + static void shiftLeftInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ 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 fa, IntFunction fb) { + static void shiftRightInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ 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 fa, IntFunction fb, + static void shiftRightInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ 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 fa, IntFunction fb) { + static void shiftArithmeticRightInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ 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 fa, IntFunction fb, + static void shiftArithmeticRightInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ 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 fa, IntFunction fb) { + static void shiftLeftInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ 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 fa, IntFunction fb, + static void shiftLeftInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ 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 fa, IntFunction fb) { + static void shiftRightInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ 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 fa, IntFunction fb, + static void shiftRightInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ 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 fa, IntFunction fb) { + static void shiftArithmeticRightInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ 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 fa, IntFunction fb, + static void shiftArithmeticRightInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ 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)); } @@ -992,7 +1004,7 @@ 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]; @@ -1001,7 +1013,7 @@ 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; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllInt128VectorTests(IntFunction fa) { + static void andLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1024,7 +1036,7 @@ 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(); } } @@ -1032,15 +1044,15 @@ 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]; @@ -1049,7 +1061,7 @@ 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; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllInt128VectorTests(IntFunction fa) { + static void orLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1072,7 +1084,7 @@ 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(); } } @@ -1080,15 +1092,15 @@ 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]; @@ -1097,7 +1109,7 @@ 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; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllInt128VectorTests(IntFunction fa) { + static void xorLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1120,7 +1132,7 @@ 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(); } } @@ -1128,14 +1140,14 @@ 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]; @@ -1144,7 +1156,7 @@ 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; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllInt128VectorTests(IntFunction fa) { + static void addLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1165,7 +1177,7 @@ 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(); } } @@ -1173,13 +1185,13 @@ 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]; @@ -1188,7 +1200,7 @@ 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; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllInt128VectorTests(IntFunction fa) { + static void mulLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1209,7 +1221,7 @@ 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(); } } @@ -1217,13 +1229,13 @@ 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]); @@ -1232,7 +1244,7 @@ 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]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllInt128VectorTests(IntFunction fa) { + static void minLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1249,7 +1261,7 @@ 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(); } } @@ -1257,13 +1269,13 @@ 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]); @@ -1272,7 +1284,7 @@ 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]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllInt128VectorTests(IntFunction fa) { + static void maxLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1289,7 +1301,7 @@ 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(); } } @@ -1297,11 +1309,11 @@ 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) {