--- old/test/jdk/jdk/incubator/vector/Long64VectorTests.java 2019-04-26 14:54:09.022057300 -0700 +++ new/test/jdk/jdk/incubator/vector/Long64VectorTests.java 2019-04-26 14:54:08.437037100 -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 shiftRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong64VectorTests(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, Long64VectorTests::shiftR); + assertArraysEquals(a, b, r, Long64VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong64VectorTests(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, Long64VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long64VectorTests::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 shiftLLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong64VectorTests(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, Long64VectorTests::shiftL); + assertArraysEquals(a, b, r, Long64VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong64VectorTests(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, Long64VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong64VectorTests(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, Long64VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long64VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong64VectorTests(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, Long64VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long64VectorTests::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 aShiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong64VectorTestsShift(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, Long64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong64VectorTestsShift(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, Long64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::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 shiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong64VectorTestsShift(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, Long64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong64VectorTestsShift(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, Long64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::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 shiftLLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong64VectorTestsShift(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, Long64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong64VectorTestsShift(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, Long64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long64VectorTests::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 andAllLong64VectorTests(IntFunction fa) { + static void andLanesLong64VectorTests(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, Long64VectorTests::andAll, Long64VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::andLanes, Long64VectorTests::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 orAllLong64VectorTests(IntFunction fa) { + static void orLanesLong64VectorTests(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, Long64VectorTests::orAll, Long64VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::orLanes, Long64VectorTests::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 xorAllLong64VectorTests(IntFunction fa) { + static void xorLanesLong64VectorTests(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, Long64VectorTests::xorAll, Long64VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::xorLanes, Long64VectorTests::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 addAllLong64VectorTests(IntFunction fa) { + static void addLanesLong64VectorTests(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, Long64VectorTests::addAll, Long64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::addLanes, Long64VectorTests::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 mulAllLong64VectorTests(IntFunction fa) { + static void mulLanesLong64VectorTests(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, Long64VectorTests::mulAll, Long64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::mulLanes, Long64VectorTests::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 minAllLong64VectorTests(IntFunction fa) { + static void minLanesLong64VectorTests(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, Long64VectorTests::minAll, Long64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::minLanes, Long64VectorTests::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 maxAllLong64VectorTests(IntFunction fa) { + static void maxLanesLong64VectorTests(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, Long64VectorTests::maxAll, Long64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::maxLanes, Long64VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) {