< prev index next >

test/jdk/jdk/incubator/vector/Double64VectorTests.java

Print this page
@@ -58,11 +58,10 @@
                  DoubleVector.SPECIES_64;
  
      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 / 64);
  
      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, Double64VectorTests::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, Double64VectorTests::add);
      }
+ 
      static double SUB(double a, double b) {
          return (double)(a - b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

@@ -1535,10 +1580,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Double64VectorTests::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, Double64VectorTests::sub);
      }
+ 
      static double MUL(double a, double b) {
          return (double)(a * b);
      }
  
      @Test(dataProvider = "doubleBinaryOpProvider")

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

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

@@ -1707,12 +1756,10 @@
          }
  
          assertArraysEquals(r, a, b, Double64VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "doubleBinaryOpMaskProvider")
      static void DIVDouble64VectorTestsMasked(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, Double64VectorTests::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, Double64VectorTests::FIRST_NONZERO);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void addDouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::mul);
      }
  
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void divDouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "doubleBinaryOpMaskProvider")
      static void divDouble64VectorTestsBroadcastMaskedSmokeTest(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, Double64VectorTests::div);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void ADDDouble64VectorTestsBroadcastLongSmokeTest(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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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 ADDReduceDouble64VectorTests(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,
                  Double64VectorTests::ADDReduce, Double64VectorTests::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 ADDReduceDouble64VectorTestsMasked(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,
                  Double64VectorTests::ADDReduceMasked, Double64VectorTests::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 MULReduceDouble64VectorTests(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,
                  Double64VectorTests::MULReduce, Double64VectorTests::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 MULReduceDouble64VectorTestsMasked(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,
                  Double64VectorTests::MULReduceMasked, Double64VectorTests::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 MINReduceDouble64VectorTests(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,
                  Double64VectorTests::MINReduce, Double64VectorTests::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 MINReduceDouble64VectorTestsMasked(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,
                  Double64VectorTests::MINReduceMasked, Double64VectorTests::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 MAXReduceDouble64VectorTests(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,
                  Double64VectorTests::MAXReduce, Double64VectorTests::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 MAXReduceDouble64VectorTestsMasked(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,
                  Double64VectorTests::MAXReduceMasked, Double64VectorTests::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_NONZEROReduceDouble64VectorTests(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,
                  Double64VectorTests::FIRST_NONZEROReduce, Double64VectorTests::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_NONZEROReduceDouble64VectorTestsMasked(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,
                  Double64VectorTests::FIRST_NONZEROReduceMasked, Double64VectorTests::FIRST_NONZEROReduceAllMasked);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "doubleUnaryOpProvider")
      static void withDouble64VectorTests(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 LTDouble64VectorTests(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 ltDouble64VectorTests(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 GTDouble64VectorTests(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 EQDouble64VectorTests(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 eqDouble64VectorTests(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 NEDouble64VectorTests(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 LEDouble64VectorTests(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 GEDouble64VectorTests(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 LTDouble64VectorTestsBroadcastSmokeTest(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 LTDouble64VectorTestsBroadcastMaskedSmokeTest(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 LTDouble64VectorTestsBroadcastLongMaskedSmokeTest(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 EQDouble64VectorTestsBroadcastMaskedSmokeTest(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 EQDouble64VectorTestsBroadcastLongMaskedSmokeTest(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 compressDouble64VectorTests(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 expandDouble64VectorTests(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 getDouble64VectorTests(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 ZeroDouble64VectorTests(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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::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, Double64VectorTests::SIN, Double64VectorTests::strictSIN);
      }
  
- 
      static double EXP(double a) {
          return (double)(Math.exp((double)a));
      }
  
      static double strictEXP(double a) {

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -4092,11 +4067,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Double64VectorTests::CBRT, Double64VectorTests::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, Double64VectorTests::HYPOT, Double64VectorTests::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, Double64VectorTests::POW, Double64VectorTests::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, Double64VectorTests::pow, Double64VectorTests::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, Double64VectorTests::ATAN2, Double64VectorTests::strictATAN2);
      }
  
  
- 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void POWDouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::POW, Double64VectorTests::strictPOW);
      }
  
+ 
      @Test(dataProvider = "doubleBinaryOpProvider")
      static void powDouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::pow, Double64VectorTests::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 FMADouble64VectorTests(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, Double64VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void fmaDouble64VectorTests(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, Double64VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble64VectorTestsMasked(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, Double64VectorTests::FMA);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void FMADouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::FMA);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble64VectorTestsBroadcastMaskedSmokeTest(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, Double64VectorTests::FMA);
      }
  
- 
- 
- 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void FMADouble64VectorTestsDoubleBroadcastSmokeTest(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, Double64VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "doubleTernaryOpProvider")
      static void fmaDouble64VectorTestsDoubleBroadcastSmokeTest(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, Double64VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "doubleTernaryOpMaskProvider")
      static void FMADouble64VectorTestsDoubleBroadcastMaskedSmokeTest(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, Double64VectorTests::FMA);
      }
  
- 
- 
- 
      static double NEG(double a) {
          return (double)(-((double)a));
      }
  
      static double neg(double a) {

@@ -4576,27 +4537,18 @@
          }
  
          assertArraysEquals(r, a, mask, Double64VectorTests::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 SQRTDouble64VectorTests(IntFunction<double[]> fa) {
          double[] a = fa.apply(SPECIES.length());
          double[] r = fr.apply(SPECIES.length());
  

@@ -4623,12 +4575,10 @@
          }
  
          assertArraysEquals(r, a, Double64VectorTests::sqrt);
      }
  
- 
- 
      @Test(dataProvider = "doubleUnaryOpMaskProvider")
      static void SQRTMaskedDouble64VectorTests(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, Double64VectorTests::SQRT);
      }
  
- 
      @Test(dataProvider = "doubleCompareOpProvider")
      static void ltDouble64VectorTestsBroadcastSmokeTest(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, Double64VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressDouble64VectorTestsSmokeTest(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 indexInRangeLongDouble64VectorTestsSmokeTest(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 loopBoundLongDouble64VectorTestsSmokeTest(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 ElementSizeDouble64VectorTestsSmokeTest() {
          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 >