--- old/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java 2019-04-26 14:54:13.536432100 -0700 +++ new/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java 2019-04-26 14:54:12.958956400 -0700 @@ -686,12 +686,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 shiftRLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -700,17 +700,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, LongMaxVectorTests::shiftR); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -722,20 +722,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, 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 fa, IntFunction fb) { + static void shiftRightLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -744,17 +748,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, LongMaxVectorTests::shiftL); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -766,20 +770,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, 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 fa, IntFunction fb) { + static void shiftArithmeticRightLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -788,17 +796,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, LongMaxVectorTests::aShiftR); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -810,20 +818,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, 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 fa, IntFunction fb) { + static void shiftLeftLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -831,17 +843,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, LongMaxVectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -852,20 +864,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, 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 fa, IntFunction fb) { + static void shiftRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -873,17 +889,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, LongMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -894,20 +910,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, 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 fa, IntFunction fb) { + static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -915,17 +935,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, LongMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -936,25 +956,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, LongMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -996,7 +1008,7 @@ 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]; @@ -1005,7 +1017,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; @@ -1020,7 +1032,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLongMaxVectorTests(IntFunction fa) { + static void andLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1028,7 +1040,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(); } } @@ -1036,15 +1048,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, 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]; @@ -1053,7 +1065,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; @@ -1068,7 +1080,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLongMaxVectorTests(IntFunction fa) { + static void orLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1076,7 +1088,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(); } } @@ -1084,15 +1096,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, 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]; @@ -1101,7 +1113,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; @@ -1116,7 +1128,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLongMaxVectorTests(IntFunction fa) { + static void xorLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1124,7 +1136,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(); } } @@ -1132,14 +1144,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, 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]; @@ -1148,7 +1160,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; @@ -1161,7 +1173,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLongMaxVectorTests(IntFunction fa) { + static void addLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1169,7 +1181,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(); } } @@ -1177,13 +1189,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, 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]; @@ -1192,7 +1204,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; @@ -1205,7 +1217,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLongMaxVectorTests(IntFunction fa) { + static void mulLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1213,7 +1225,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(); } } @@ -1221,13 +1233,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, 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]); @@ -1236,7 +1248,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]); @@ -1245,7 +1257,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLongMaxVectorTests(IntFunction fa) { + static void minLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1253,7 +1265,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(); } } @@ -1261,13 +1273,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, 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]); @@ -1276,7 +1288,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]); @@ -1285,7 +1297,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLongMaxVectorTests(IntFunction fa) { + static void maxLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1293,7 +1305,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(); } } @@ -1301,11 +1313,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, LongMaxVectorTests::maxAll, LongMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::maxLanes, LongMaxVectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) {