--- old/test/jdk/jdk/incubator/vector/Long128VectorTests.java 2019-04-26 14:53:55.160073200 -0700 +++ new/test/jdk/jdk/incubator/vector/Long128VectorTests.java 2019-04-26 14:53:54.575950300 -0700 @@ -682,12 +682,12 @@ } - 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 shiftRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ 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, Long128VectorTests::shiftR); + assertArraysEquals(a, b, r, Long128VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ 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, Long128VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long128VectorTests::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 shiftLLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ 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, Long128VectorTests::shiftL); + assertArraysEquals(a, b, r, Long128VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ 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, Long128VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ 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, Long128VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long128VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ 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, Long128VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long128VectorTests::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 aShiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::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 shiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::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 shiftLLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] 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()) { 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, Long128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long128VectorTests::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]; @@ -1001,7 +1013,7 @@ 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; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLong128VectorTests(IntFunction fa) { + static void andLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1024,7 +1036,7 @@ 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(); } } @@ -1032,15 +1044,15 @@ 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, Long128VectorTests::andAll, Long128VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::andLanes, Long128VectorTests::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]; @@ -1049,7 +1061,7 @@ 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; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLong128VectorTests(IntFunction fa) { + static void orLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1072,7 +1084,7 @@ 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(); } } @@ -1080,15 +1092,15 @@ 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, Long128VectorTests::orAll, Long128VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::orLanes, Long128VectorTests::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]; @@ -1097,7 +1109,7 @@ 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; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLong128VectorTests(IntFunction fa) { + static void xorLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1120,7 +1132,7 @@ 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(); } } @@ -1128,14 +1140,14 @@ 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, Long128VectorTests::xorAll, Long128VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::xorLanes, Long128VectorTests::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]; @@ -1144,7 +1156,7 @@ 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; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLong128VectorTests(IntFunction fa) { + static void addLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1165,7 +1177,7 @@ 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(); } } @@ -1173,13 +1185,13 @@ 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, Long128VectorTests::addAll, Long128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::addLanes, Long128VectorTests::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]; @@ -1188,7 +1200,7 @@ 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; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLong128VectorTests(IntFunction fa) { + static void mulLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1209,7 +1221,7 @@ 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(); } } @@ -1217,13 +1229,13 @@ 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, Long128VectorTests::mulAll, Long128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::mulLanes, Long128VectorTests::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]); @@ -1232,7 +1244,7 @@ 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]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLong128VectorTests(IntFunction fa) { + static void minLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1249,7 +1261,7 @@ 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(); } } @@ -1257,13 +1269,13 @@ 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, Long128VectorTests::minAll, Long128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::minLanes, Long128VectorTests::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]); @@ -1272,7 +1284,7 @@ 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]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLong128VectorTests(IntFunction fa) { + static void maxLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1289,7 +1301,7 @@ 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(); } } @@ -1297,11 +1309,11 @@ 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, Long128VectorTests::maxAll, Long128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::maxLanes, Long128VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) {