< prev index next >
test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.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
@@ -732,10 +732,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
static double max(double a, double b) {
return (double)(Math.max(a, b));
}
@Test(dataProvider = "doubleBinaryOpProvider")
@@ -778,20 +790,20 @@
- static double addAll(double[] a, int idx) {
+ static double addLanes(double[] a, int idx) {
double res = 0;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res += a[i];
}
return res;
}
- static double addAll(double[] a) {
+ static double addLanes(double[] a) {
double res = 0;
for (int i = 0; i < a.length; i += SPECIES.length()) {
double tmp = 0;
for (int j = 0; j < SPECIES.length(); j++) {
tmp += a[i + j];
@@ -800,42 +812,42 @@
}
return res;
}
@Test(dataProvider = "doubleUnaryOpProvider")
- static void addAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
+ static void addLanesDoubleMaxVectorTests(IntFunction<double[]> fa) {
double[] a = fa.apply(SPECIES.length());
double[] r = fr.apply(SPECIES.length());
double ra = 0;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.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()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- ra += av.addAll();
+ ra += av.addLanes();
}
}
- assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::addAll, DoubleMaxVectorTests::addAll);
+ assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::addLanes, DoubleMaxVectorTests::addLanes);
}
- static double mulAll(double[] a, int idx) {
+ static double mulLanes(double[] a, int idx) {
double res = 1;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res *= a[i];
}
return res;
}
- static double mulAll(double[] a) {
+ static double mulLanes(double[] a) {
double res = 1;
for (int i = 0; i < a.length; i += SPECIES.length()) {
double tmp = 1;
for (int j = 0; j < SPECIES.length(); j++) {
tmp *= a[i + j];
@@ -844,111 +856,111 @@
}
return res;
}
@Test(dataProvider = "doubleUnaryOpProvider")
- static void mulAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
+ static void mulLanesDoubleMaxVectorTests(IntFunction<double[]> fa) {
double[] a = fa.apply(SPECIES.length());
double[] r = fr.apply(SPECIES.length());
double ra = 1;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.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()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- ra *= av.mulAll();
+ ra *= av.mulLanes();
}
}
- assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::mulAll, DoubleMaxVectorTests::mulAll);
+ assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::mulLanes, DoubleMaxVectorTests::mulLanes);
}
- static double minAll(double[] a, int idx) {
+ static double minLanes(double[] a, int idx) {
double res = Double.POSITIVE_INFINITY;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (double)Math.min(res, a[i]);
}
return res;
}
- static double minAll(double[] a) {
+ static double minLanes(double[] a) {
double res = Double.POSITIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
res = (double)Math.min(res, a[i]);
}
return res;
}
@Test(dataProvider = "doubleUnaryOpProvider")
- static void minAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
+ static void minLanesDoubleMaxVectorTests(IntFunction<double[]> fa) {
double[] a = fa.apply(SPECIES.length());
double[] r = fr.apply(SPECIES.length());
double ra = Double.POSITIVE_INFINITY;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- r[i] = av.minAll();
+ r[i] = av.minLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Double.POSITIVE_INFINITY;
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- ra = (double)Math.min(ra, av.minAll());
+ ra = (double)Math.min(ra, av.minLanes());
}
}
- assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::minAll, DoubleMaxVectorTests::minAll);
+ assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::minLanes, DoubleMaxVectorTests::minLanes);
}
- static double maxAll(double[] a, int idx) {
+ static double maxLanes(double[] a, int idx) {
double res = Double.NEGATIVE_INFINITY;
for (int i = idx; i < (idx + SPECIES.length()); i++) {
res = (double)Math.max(res, a[i]);
}
return res;
}
- static double maxAll(double[] a) {
+ static double maxLanes(double[] a) {
double res = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i++) {
res = (double)Math.max(res, a[i]);
}
return res;
}
@Test(dataProvider = "doubleUnaryOpProvider")
- static void maxAllDoubleMaxVectorTests(IntFunction<double[]> fa) {
+ static void maxLanesDoubleMaxVectorTests(IntFunction<double[]> fa) {
double[] a = fa.apply(SPECIES.length());
double[] r = fr.apply(SPECIES.length());
double ra = Double.NEGATIVE_INFINITY;
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- r[i] = av.maxAll();
+ r[i] = av.maxLanes();
}
}
for (int ic = 0; ic < INVOC_COUNT; ic++) {
ra = Double.NEGATIVE_INFINITY;
for (int i = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
- ra = (double)Math.max(ra, av.maxAll());
+ ra = (double)Math.max(ra, av.maxLanes());
}
}
- assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::maxAll, DoubleMaxVectorTests::maxAll);
+ assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::maxLanes, DoubleMaxVectorTests::maxLanes);
}
< prev index next >