< prev index next >

test/jdk/jdk/incubator/vector/Double128VectorTests.java

Print this page
@@ -58,11 +58,10 @@
                  DoubleVector.SPECIES_128;
  
      static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
  
  
-     private static final double CONST_SHIFT = Double.SIZE / 2;
  
      static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 128);
  
      interface FUnOp {
          double apply(double a);

@@ -259,10 +258,59 @@
              int idx = i + j;
              Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]);
          }
      }
  
+     static void assertcompressArraysEquals(double[] r, double[] a, boolean[] m, int vector_len) {
+         int i = 0, j = 0, k = 0;
+         try {
+             for (; i < a.length; i += vector_len) {
+                 k = 0;
+                 for (j = 0; j < vector_len; j++) {
+                     if (m[(i + j) % SPECIES.length()]) {
+                         Assert.assertEquals(r[i + k], a[i + j]);
+                         k++;
+                     }
+                 }
+                 for (; k < vector_len; k++) {
+                     Assert.assertEquals(r[i + k], (double)0);
+                 }
+             }
+         } catch (AssertionError e) {
+             int idx = i + k;
+             if (m[(i + j) % SPECIES.length()]) {
+                 Assert.assertEquals(r[idx], a[i + j], "at index #" + idx);
+             } else {
+                 Assert.assertEquals(r[idx], (double)0, "at index #" + idx);
+             }
+         }
+     }
+ 
+     static void assertexpandArraysEquals(double[] r, double[] a, boolean[] m, int vector_len) {
+         int i = 0, j = 0, k = 0;
+         try {
+             for (; i < a.length; i += vector_len) {
+                 k = 0;
+                 for (j = 0; j < vector_len; j++) {
+                     if (m[(i + j) % SPECIES.length()]) {
+                         Assert.assertEquals(r[i + j], a[i + k]);
+                         k++;
+                     } else {
+                         Assert.assertEquals(r[i + j], (double)0);
+                     }
+                 }
+             }
+         } catch (AssertionError e) {
+             int idx = i + j;
+             if (m[idx % SPECIES.length()]) {
+                 Assert.assertEquals(r[idx], a[i + k], "at index #" + idx);
+             } else {
+                 Assert.assertEquals(r[idx], (double)0, "at index #" + idx);
+             }
+         }
+     }
+ 
      static void assertSelectFromArraysEquals(double[] r, double[] a, double[] order, int vector_len) {
          int i = 0, j = 0;
          try {
              for (; i < a.length; i += vector_len) {
                  for (j = 0; j < vector_len; j++) {

@@ -1011,12 +1059,10 @@
          } catch (AssertionError e) {
              Assert.assertEquals(r[i], (long)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]);
          }
      }
  
- 
- 
      static long bits(double e) {
          return  Double.doubleToLongBits(e);
      }
  
      static final List<IntFunction<double[]>> DOUBLE_GENERATORS = List.of(

@@ -1196,11 +1242,10 @@
                          return new Object[] {fa, fs, fm};
                  }))).
                  toArray(Object[][]::new);
      }
  
- 
      static final List<IntFunction<double[]>> DOUBLE_COMPARE_GENERATORS = List.of(
              withToString("double[i]", (int s) -> {
                  return fill(s * BUFFER_REPS,
                              i -> (double)i);
              }),

@@ -1317,11 +1362,10 @@
      static final IntFunction<long[]> lfr = (vl) -> {
          int length = BUFFER_REPS * vl;
          return new long[length];
      };
  
- 
      static boolean eq(double a, double b) {
          return a == b;
      }
  
      static boolean neq(double a, double b) {

@@ -1342,11 +1386,10 @@
  
      static boolean ge(double a, double b) {
          return a >= b;
      }
  
- 
      static double firstNonZero(double a, double b) {
          return Double.compare(a, (double) 0) != 0 ? a : b;
      }
  
      @Test

@@ -1459,10 +1502,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::ADD);
      }
+ 
      static double add(double a, double b) {
          return (double)(a + b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1515,10 +1559,11 @@
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Double128VectorTests::add);
      }
+ 
      static double SUB(double a, double b) {
          return (double)(a - b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1535,10 +1580,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::SUB);
      }
+ 
      static double sub(double a, double b) {
          return (double)(a - b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1591,10 +1637,11 @@
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Double128VectorTests::sub);
      }
+ 
      static double MUL(double a, double b) {
          return (double)(a * b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1611,10 +1658,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::MUL);
      }
+ 
      static double mul(double a, double b) {
          return (double)(a * b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1688,10 +1736,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::DIV);
      }
+ 
      static double div(double a, double b) {
          return (double)(a / b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1707,12 +1756,10 @@
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "doubleBinaryOpMaskProvider")
      static void DIVDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<double[]> fb,
                                            IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -1747,12 +1794,10 @@
          }
  
          assertArraysEquals(r, a, b, mask, Double128VectorTests::div);
      }
  
- 
- 
      static double FIRST_NONZERO(double a, double b) {
          return (double)(Double.doubleToLongBits(a)!=0?a:b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1790,18 +1835,10 @@
          }
  
          assertArraysEquals(r, a, b, mask, Double128VectorTests::FIRST_NONZERO);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void addDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -1891,11 +1928,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::mul);
      }
  
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void divDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -1906,12 +1942,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, Double128VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "doubleBinaryOpMaskProvider")
      static void divDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb,
                                            IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -1925,19 +1959,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Double128VectorTests::div);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void ADDDouble128VectorTestsBroadcastLongSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -1965,67 +1990,10 @@
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Double128VectorTests::ADD);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static double MIN(double a, double b) {
          return (double)(Math.min(a, b));
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -2042,10 +2010,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::MIN);
      }
+ 
      static double min(double a, double b) {
          return (double)(Math.min(a, b));
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -2060,10 +2029,11 @@
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::min);
      }
+ 
      static double MAX(double a, double b) {
          return (double)(Math.max(a, b));
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -2080,10 +2050,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double128VectorTests::MAX);
      }
+ 
      static double max(double a, double b) {
          return (double)(Math.max(a, b));
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -2155,21 +2126,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, Double128VectorTests::max);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static double ADDReduce(double[] a, int idx) {
          double res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res += a[i];
          }

@@ -2183,10 +2143,11 @@
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void ADDReduceDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          double ra = 0;

@@ -2207,10 +2168,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Double128VectorTests::ADDReduce, Double128VectorTests::ADDReduceAll);
      }
+ 
      static double ADDReduceMasked(double[] a, int idx, boolean[] mask) {
          double res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res += a[i];

@@ -2225,10 +2187,11 @@
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void ADDReduceDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2251,10 +2214,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Double128VectorTests::ADDReduceMasked, Double128VectorTests::ADDReduceAllMasked);
      }
+ 
      static double MULReduce(double[] a, int idx) {
          double res = 1;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res *= a[i];
          }

@@ -2268,10 +2232,11 @@
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MULReduceDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          double ra = 1;

@@ -2292,10 +2257,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Double128VectorTests::MULReduce, Double128VectorTests::MULReduceAll);
      }
+ 
      static double MULReduceMasked(double[] a, int idx, boolean[] mask) {
          double res = 1;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res *= a[i];

@@ -2310,10 +2276,11 @@
              res *= MULReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MULReduceDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2336,10 +2303,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Double128VectorTests::MULReduceMasked, Double128VectorTests::MULReduceAllMasked);
      }
+ 
      static double MINReduce(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]);
          }

@@ -2353,10 +2321,11 @@
              res = (double) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MINReduceDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          double ra = Double.POSITIVE_INFINITY;

@@ -2377,10 +2346,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Double128VectorTests::MINReduce, Double128VectorTests::MINReduceAll);
      }
+ 
      static double MINReduceMasked(double[] a, int idx, boolean[] mask) {
          double res = Double.POSITIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (double) Math.min(res, a[i]);

@@ -2395,10 +2365,11 @@
              res = (double) Math.min(res, MINReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MINReduceDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2421,10 +2392,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Double128VectorTests::MINReduceMasked, Double128VectorTests::MINReduceAllMasked);
      }
+ 
      static double MAXReduce(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]);
          }

@@ -2438,10 +2410,11 @@
              res = (double) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void MAXReduceDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          double ra = Double.NEGATIVE_INFINITY;

@@ -2462,10 +2435,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Double128VectorTests::MAXReduce, Double128VectorTests::MAXReduceAll);
      }
+ 
      static double MAXReduceMasked(double[] a, int idx, boolean[] mask) {
          double res = Double.NEGATIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (double) Math.max(res, a[i]);

@@ -2480,10 +2454,11 @@
              res = (double) Math.max(res, MAXReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void MAXReduceDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2506,10 +2481,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Double128VectorTests::MAXReduceMasked, Double128VectorTests::MAXReduceAllMasked);
      }
+ 
      static double FIRST_NONZEROReduce(double[] a, int idx) {
          double res = (double) 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = firstNonZero(res, a[i]);
          }

@@ -2523,10 +2499,11 @@
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void FIRST_NONZEROReduceDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          double ra = (double) 0;

@@ -2547,10 +2524,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Double128VectorTests::FIRST_NONZEROReduce, Double128VectorTests::FIRST_NONZEROReduceAll);
      }
+ 
      static double FIRST_NONZEROReduceMasked(double[] a, int idx, boolean[] mask) {
          double res = (double) 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = firstNonZero(res, a[i]);

@@ -2565,10 +2543,11 @@
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceDouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2592,14 +2571,10 @@
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Double128VectorTests::FIRST_NONZEROReduceMasked, Double128VectorTests::FIRST_NONZEROReduceAllMasked);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void withDouble128VectorTests(IntFunction<double []> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  

@@ -2613,10 +2588,11 @@
  
          for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
              assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
          }
      }
+ 
      static boolean testIS_DEFAULT(double a) {
          return bits(a)==0;
      }
  
      @Test(dataProvider = "doubleTestOpProvider")

@@ -2653,10 +2629,11 @@
                      Assert.assertEquals(mv.laneIsSet(j),  vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j]));
                  }
              }
          }
      }
+ 
      static boolean testIS_NEGATIVE(double a) {
          return bits(a)<0;
      }
  
      @Test(dataProvider = "doubleTestOpProvider")

@@ -2735,11 +2712,10 @@
                  }
              }
          }
      }
  
- 
      static boolean testIS_NAN(double a) {
          return Double.isNaN(a);
      }
  
      @Test(dataProvider = "doubleTestOpProvider")

@@ -2777,11 +2753,10 @@
                  }
              }
          }
      }
  
- 
      static boolean testIS_INFINITE(double a) {
          return Double.isInfinite(a);
      }
  
      @Test(dataProvider = "doubleTestOpProvider")

@@ -2819,11 +2794,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void LTDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -2839,11 +2813,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void ltDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -2882,11 +2855,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void GTDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -2925,11 +2897,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void EQDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -2945,11 +2916,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void eqDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -2988,11 +2958,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void NEDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -3031,11 +3000,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void LEDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -3074,11 +3042,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void GEDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -3117,19 +3084,10 @@
                  }
              }
          }
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void LTDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -3142,11 +3100,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpMaskProvider")
      static void LTDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction<double[]> fa,
                                  IntFunction<double[]> fb, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -3179,11 +3136,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (double)((long)b[i]));
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpMaskProvider")
      static void LTDouble128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction<double[]> fa,
                                  IntFunction<double[]> fb, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -3216,11 +3172,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpMaskProvider")
      static void EQDouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction<double[]> fa,
                                  IntFunction<double[]> fb, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -3253,11 +3208,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (double)((long)b[i]));
              }
          }
      }
  
- 
      @Test(dataProvider = "doubleCompareOpMaskProvider")
      static void EQDouble128VectorTestsBroadcastLongMaskedSmokeTest(IntFunction<double[]> fa,
                                  IntFunction<double[]> fb, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -3332,10 +3286,47 @@
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "doubleUnaryOpMaskProvider")
+     static void compressDouble128VectorTests(IntFunction<double[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         double[] a = fa.apply(SPECIES.length());
+         double[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 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);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "doubleUnaryOpMaskProvider")
+     static void expandDouble128VectorTests(IntFunction<double[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         double[] a = fa.apply(SPECIES.length());
+         double[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Double> vmask = VectorMask.fromArray(SPECIES, mask, 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);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void getDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  

@@ -3502,14 +3493,10 @@
          }
  
          assertBroadcastArraysEquals(r, a);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void ZeroDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = new double[a.length];
  

@@ -3520,13 +3507,10 @@
          }
  
          Assert.assertEquals(a, r);
      }
  
- 
- 
- 
      static double[] sliceUnary(double[] a, int origin, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = a[idx+i+origin];

@@ -3548,10 +3532,11 @@
              }
          }
  
          assertArraysEquals(r, a, origin, Double128VectorTests::sliceUnary);
      }
+ 
      static double[] sliceBinary(double[] a, double[] b, int origin, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = a[idx+i+origin];

@@ -3577,10 +3562,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, origin, Double128VectorTests::sliceBinary);
      }
+ 
      static double[] slice(double[] a, double[] b, int origin, boolean[] mask, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = mask[i] ? a[idx+i+origin] : (double)0;

@@ -3610,10 +3596,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, origin, mask, Double128VectorTests::slice);
      }
+ 
      static double[] unsliceUnary(double[] a, int origin, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i < origin)
                  res[i] = (double)0;

@@ -3637,10 +3624,11 @@
              }
          }
  
          assertArraysEquals(r, a, origin, Double128VectorTests::unsliceUnary);
      }
+ 
      static double[] unsliceBinary(double[] a, double[] b, int origin, int part, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if (part == 0) {
                  if (i < origin)

@@ -3676,10 +3664,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, origin, part, Double128VectorTests::unsliceBinary);
      }
+ 
      static double[] unslice(double[] a, double[] b, int origin, int part, boolean[] mask, int idx) {
          double[] res = new double[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = b[idx+i+origin];

@@ -3756,11 +3745,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::SIN, Double128VectorTests::strictSIN);
      }
  
- 
      static double EXP(double a) {
          return (double)(Math.exp((double)a));
      }
  
      static double strictEXP(double a) {

@@ -3780,11 +3768,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::EXP, Double128VectorTests::strictEXP);
      }
  
- 
      static double LOG1P(double a) {
          return (double)(Math.log1p((double)a));
      }
  
      static double strictLOG1P(double a) {

@@ -3804,11 +3791,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG1P, Double128VectorTests::strictLOG1P);
      }
  
- 
      static double LOG(double a) {
          return (double)(Math.log((double)a));
      }
  
      static double strictLOG(double a) {

@@ -3828,11 +3814,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG, Double128VectorTests::strictLOG);
      }
  
- 
      static double LOG10(double a) {
          return (double)(Math.log10((double)a));
      }
  
      static double strictLOG10(double a) {

@@ -3852,11 +3837,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::LOG10, Double128VectorTests::strictLOG10);
      }
  
- 
      static double EXPM1(double a) {
          return (double)(Math.expm1((double)a));
      }
  
      static double strictEXPM1(double a) {

@@ -3876,11 +3860,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::EXPM1, Double128VectorTests::strictEXPM1);
      }
  
- 
      static double COS(double a) {
          return (double)(Math.cos((double)a));
      }
  
      static double strictCOS(double a) {

@@ -3900,11 +3883,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::COS, Double128VectorTests::strictCOS);
      }
  
- 
      static double TAN(double a) {
          return (double)(Math.tan((double)a));
      }
  
      static double strictTAN(double a) {

@@ -3924,11 +3906,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::TAN, Double128VectorTests::strictTAN);
      }
  
- 
      static double SINH(double a) {
          return (double)(Math.sinh((double)a));
      }
  
      static double strictSINH(double a) {

@@ -3948,11 +3929,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::SINH, Double128VectorTests::strictSINH);
      }
  
- 
      static double COSH(double a) {
          return (double)(Math.cosh((double)a));
      }
  
      static double strictCOSH(double a) {

@@ -3972,11 +3952,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::COSH, Double128VectorTests::strictCOSH);
      }
  
- 
      static double TANH(double a) {
          return (double)(Math.tanh((double)a));
      }
  
      static double strictTANH(double a) {

@@ -3996,11 +3975,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::TANH, Double128VectorTests::strictTANH);
      }
  
- 
      static double ASIN(double a) {
          return (double)(Math.asin((double)a));
      }
  
      static double strictASIN(double a) {

@@ -4020,11 +3998,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ASIN, Double128VectorTests::strictASIN);
      }
  
- 
      static double ACOS(double a) {
          return (double)(Math.acos((double)a));
      }
  
      static double strictACOS(double a) {

@@ -4044,11 +4021,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ACOS, Double128VectorTests::strictACOS);
      }
  
- 
      static double ATAN(double a) {
          return (double)(Math.atan((double)a));
      }
  
      static double strictATAN(double a) {

@@ -4068,11 +4044,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::ATAN, Double128VectorTests::strictATAN);
      }
  
- 
      static double CBRT(double a) {
          return (double)(Math.cbrt((double)a));
      }
  
      static double strictCBRT(double a) {

@@ -4092,11 +4067,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double128VectorTests::CBRT, Double128VectorTests::strictCBRT);
      }
  
- 
      static double HYPOT(double a, double b) {
          return (double)(Math.hypot((double)a, (double)b));
      }
  
      static double strictHYPOT(double a, double b) {

@@ -4119,11 +4093,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::HYPOT, Double128VectorTests::strictHYPOT);
      }
  
  
- 
      static double POW(double a, double b) {
          return (double)(Math.pow((double)a, (double)b));
      }
  
      static double strictPOW(double a, double b) {

@@ -4145,10 +4118,11 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::POW, Double128VectorTests::strictPOW);
      }
  
+ 
      static double pow(double a, double b) {
          return (double)(Math.pow((double)a, (double)b));
      }
  
      static double strictpow(double a, double b) {

@@ -4171,11 +4145,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::pow, Double128VectorTests::strictpow);
      }
  
  
- 
      static double ATAN2(double a, double b) {
          return (double)(Math.atan2((double)a, (double)b));
      }
  
      static double strictATAN2(double a, double b) {

@@ -4198,11 +4171,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::ATAN2, Double128VectorTests::strictATAN2);
      }
  
  
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void POWDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -4213,10 +4185,11 @@
          }
  
          assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::POW, Double128VectorTests::strictPOW);
      }
  
+ 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void powDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -4228,19 +4201,18 @@
  
          assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Double128VectorTests::pow, Double128VectorTests::strictpow);
      }
  
  
- 
      static double FMA(double a, double b, double c) {
          return (double)(Math.fma(a, b, c));
      }
+ 
      static double fma(double a, double b, double c) {
          return (double)(Math.fma(a, b, c));
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void FMADouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb, IntFunction<double[]> fc) {
          int count = INVOC_COUNT;
          switch ("FMA") {
          case "fma": case "lanewise_FMA":

@@ -4262,10 +4234,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, c, Double128VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void fmaDouble128VectorTests(IntFunction<double[]> fa, IntFunction<double[]> fb, IntFunction<double[]> fc) {
          int count = INVOC_COUNT;
          switch ("fma") {
          case "fma": case "lanewise_FMA":

@@ -4286,11 +4259,10 @@
          }
  
          assertArraysEquals(r, a, b, c, Double128VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble128VectorTestsMasked(IntFunction<double[]> fa, IntFunction<double[]> fb,
                                            IntFunction<double[]> fc, IntFunction<boolean[]> fm) {
          int count = INVOC_COUNT;
          switch ("FMA") {

@@ -4316,14 +4288,10 @@
          }
  
          assertArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void FMADouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb, IntFunction<double[]> fc) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
          double[] c = fc.apply(SPECIES.length());

@@ -4350,11 +4318,10 @@
              av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Double128VectorTests::FMA);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble128VectorTestsBroadcastMaskedSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb,
                                            IntFunction<double[]> fc, IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());

@@ -4389,13 +4356,10 @@
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA);
      }
  
- 
- 
- 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void FMADouble128VectorTestsDoubleBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb, IntFunction<double[]> fc) {
          int count = INVOC_COUNT;
          switch ("FMA") {
          case "fma": case "lanewise_FMA":

@@ -4413,10 +4377,11 @@
              av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Double128VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void fmaDouble128VectorTestsDoubleBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb, IntFunction<double[]> fc) {
          int count = INVOC_COUNT;
          switch ("fma") {
          case "fma": case "lanewise_FMA":

@@ -4435,11 +4400,10 @@
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Double128VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble128VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb,
                                            IntFunction<double[]> fc, IntFunction<boolean[]> fm) {
          int count = INVOC_COUNT;
          switch ("FMA") {

@@ -4461,13 +4425,10 @@
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Double128VectorTests::FMA);
      }
  
- 
- 
- 
      static double NEG(double a) {
          return (double)(-((double)a));
      }
  
      static double neg(double a) {

@@ -4576,27 +4537,18 @@
          }
  
          assertArraysEquals(r, a, mask, Double128VectorTests::ABS);
      }
  
- 
- 
- 
- 
- 
- 
- 
      static double SQRT(double a) {
          return (double)(Math.sqrt((double)a));
      }
  
      static double sqrt(double a) {
          return (double)(Math.sqrt((double)a));
      }
  
- 
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void SQRTDouble128VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  

@@ -4623,12 +4575,10 @@
          }
  
          assertArraysEquals(r, a, Double128VectorTests::sqrt);
      }
  
- 
- 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void SQRTMaskedDouble128VectorTests(IntFunction<double[]> fa,
                                                  IntFunction<boolean[]> fm) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());

@@ -4643,11 +4593,10 @@
          }
  
          assertArraysEquals(r, a, mask, Double128VectorTests::SQRT);
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void ltDouble128VectorTestsBroadcastSmokeTest(IntFunction<double[]> fa, IntFunction<double[]> fb) {
          double[] a = fa.apply(SPECIES.length());
          double[] b = fb.apply(SPECIES.length());
  

@@ -5035,10 +4984,27 @@
          }
  
          assertMaskReductionArraysEquals(r, a, Double128VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressDouble128VectorTestsSmokeTest(IntFunction<boolean[]> fa) {
+         int trueCount = 0;
+         boolean[] a = fa.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 var vmask = SPECIES.loadMask(a, i);
+                 trueCount = vmask.trueCount();
+                 var rmask = vmask.compress();
+                 for (int j = 0; j < SPECIES.length(); j++)  {
+                     Assert.assertEquals(rmask.laneIsSet(j), j < trueCount);
+                 }
+             }
+         }
+     }
+ 
      @DataProvider
      public static Object[][] longMaskProvider() {
          return new Object[][]{
                  {0xFFFFFFFFFFFFFFFFL},
                  {0x0000000000000000L},

@@ -5077,10 +5043,24 @@
                  Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit);
              }
          }
      }
  
+     @Test(dataProvider = "offsetProvider")
+     static void indexInRangeLongDouble128VectorTestsSmokeTest(int offset) {
+         long limit = SPECIES.length() * BUFFER_REPS;
+         for (long i = 0; i < limit; i += SPECIES.length()) {
+             var actualMask = SPECIES.indexInRange(i + offset, limit);
+             var expectedMask = SPECIES.maskAll(true).indexInRange(i + offset, limit);
+             assert(actualMask.equals(expectedMask));
+             for (int j = 0; j < SPECIES.length(); j++)  {
+                 long index = i + j + offset;
+                 Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit);
+             }
+         }
+     }
+ 
      @DataProvider
      public static Object[][] lengthProvider() {
          return new Object[][]{
                  {0},
                  {1},

@@ -5097,10 +5077,18 @@
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongDouble128VectorTestsSmokeTest(int _length) {
+         long length = _length;
+         long actualLoopBound = SPECIES.loopBound(length);
+         long expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
+         Assert.assertEquals(actualLoopBound, expectedLoopBound);
+     }
+ 
      @Test
      static void ElementSizeDouble128VectorTestsSmokeTest() {
          DoubleVector av = DoubleVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Double.SIZE);

@@ -5159,6 +5147,5 @@
          for (int ic = 0; ic < INVOC_COUNT; ic++) {
            Assert.assertEquals(SPECIES.maskAll(true).toLong(), -1L >>> (64 - SPECIES.length()));
          }
      }
  }
- 
< prev index next >