< prev index next >

test/jdk/jdk/incubator/vector/Float512VectorTests.java

Print this page
@@ -58,11 +58,10 @@
                  FloatVector.SPECIES_512;
  
      static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
  
  
-     private static final float CONST_SHIFT = Float.SIZE / 2;
  
      static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / 512);
  
      interface FUnOp {
          float apply(float 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(float[] r, float[] 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], (float)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], (float)0, "at index #" + idx);
+             }
+         }
+     }
+ 
+     static void assertexpandArraysEquals(float[] r, float[] 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], (float)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], (float)0, "at index #" + idx);
+             }
+         }
+     }
+ 
      static void assertSelectFromArraysEquals(float[] r, float[] a, float[] order, int vector_len) {
          int i = 0, j = 0;
          try {
              for (; i < a.length; i += vector_len) {
                  for (j = 0; j < vector_len; j++) {

@@ -1022,11 +1070,10 @@
          } catch (AssertionError e) {
              Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]);
          }
      }
  
- 
      static int bits(float e) {
          return  Float.floatToIntBits(e);
      }
  
      static final List<IntFunction<float[]>> FLOAT_GENERATORS = List.of(

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

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

@@ -1352,11 +1397,10 @@
  
      static boolean ge(float a, float b) {
          return a >= b;
      }
  
- 
      static float firstNonZero(float a, float b) {
          return Float.compare(a, (float) 0) != 0 ? a : b;
      }
  
      @Test

@@ -1469,10 +1513,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::ADD);
      }
+ 
      static float add(float a, float b) {
          return (float)(a + b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1525,10 +1570,11 @@
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Float512VectorTests::add);
      }
+ 
      static float SUB(float a, float b) {
          return (float)(a - b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1545,10 +1591,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::SUB);
      }
+ 
      static float sub(float a, float b) {
          return (float)(a - b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1601,10 +1648,11 @@
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Float512VectorTests::sub);
      }
+ 
      static float MUL(float a, float b) {
          return (float)(a * b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1621,10 +1669,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::MUL);
      }
+ 
      static float mul(float a, float b) {
          return (float)(a * b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1698,10 +1747,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::DIV);
      }
+ 
      static float div(float a, float b) {
          return (float)(a / b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1717,12 +1767,10 @@
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "floatBinaryOpMaskProvider")
      static void DIVFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<float[]> fb,
                                            IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -1757,12 +1805,10 @@
          }
  
          assertArraysEquals(r, a, b, mask, Float512VectorTests::div);
      }
  
- 
- 
      static float FIRST_NONZERO(float a, float b) {
          return (float)(Double.doubleToLongBits(a)!=0?a:b);
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -1800,18 +1846,10 @@
          }
  
          assertArraysEquals(r, a, b, mask, Float512VectorTests::FIRST_NONZERO);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "floatBinaryOpProvider")
      static void addFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -1901,11 +1939,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::mul);
      }
  
- 
      @Test(dataProvider = "floatBinaryOpProvider")
      static void divFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -1916,12 +1953,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, Float512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "floatBinaryOpMaskProvider")
      static void divFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb,
                                            IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -1935,19 +1970,10 @@
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Float512VectorTests::div);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "floatBinaryOpProvider")
      static void ADDFloat512VectorTestsBroadcastLongSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -1975,67 +2001,10 @@
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Float512VectorTests::ADD);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static float MIN(float a, float b) {
          return (float)(Math.min(a, b));
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -2052,10 +2021,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::MIN);
      }
+ 
      static float min(float a, float b) {
          return (float)(Math.min(a, b));
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -2070,10 +2040,11 @@
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::min);
      }
+ 
      static float MAX(float a, float b) {
          return (float)(Math.max(a, b));
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

@@ -2090,10 +2061,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, Float512VectorTests::MAX);
      }
+ 
      static float max(float a, float b) {
          return (float)(Math.max(a, b));
      }
  
      @Test(dataProvider = "floatBinaryOpProvider")

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

@@ -2193,10 +2154,11 @@
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void ADDReduceFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          float ra = 0;

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

@@ -2235,10 +2198,11 @@
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void ADDReduceFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

@@ -2278,10 +2243,11 @@
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void MULReduceFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          float ra = 1;

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

@@ -2320,10 +2287,11 @@
              res *= MULReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void MULReduceFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2346,10 +2314,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Float512VectorTests::MULReduceMasked, Float512VectorTests::MULReduceAllMasked);
      }
+ 
      static float MINReduce(float[] a, int idx) {
          float res = Float.POSITIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = (float) Math.min(res, a[i]);
          }

@@ -2363,10 +2332,11 @@
              res = (float) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void MINReduceFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          float ra = Float.POSITIVE_INFINITY;

@@ -2387,10 +2357,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Float512VectorTests::MINReduce, Float512VectorTests::MINReduceAll);
      }
+ 
      static float MINReduceMasked(float[] a, int idx, boolean[] mask) {
          float res = Float.POSITIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (float) Math.min(res, a[i]);

@@ -2405,10 +2376,11 @@
              res = (float) Math.min(res, MINReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void MINReduceFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2431,10 +2403,11 @@
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Float512VectorTests::MINReduceMasked, Float512VectorTests::MINReduceAllMasked);
      }
+ 
      static float MAXReduce(float[] a, int idx) {
          float res = Float.NEGATIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = (float) Math.max(res, a[i]);
          }

@@ -2448,10 +2421,11 @@
              res = (float) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void MAXReduceFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          float ra = Float.NEGATIVE_INFINITY;

@@ -2472,10 +2446,11 @@
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Float512VectorTests::MAXReduce, Float512VectorTests::MAXReduceAll);
      }
+ 
      static float MAXReduceMasked(float[] a, int idx, boolean[] mask) {
          float res = Float.NEGATIVE_INFINITY;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (float) Math.max(res, a[i]);

@@ -2490,10 +2465,11 @@
              res = (float) Math.max(res, MAXReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void MAXReduceFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

@@ -2533,10 +2510,11 @@
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void FIRST_NONZEROReduceFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          float ra = (float) 0;

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

@@ -2575,10 +2554,11 @@
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

@@ -2602,14 +2582,10 @@
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Float512VectorTests::FIRST_NONZEROReduceMasked, Float512VectorTests::FIRST_NONZEROReduceAllMasked);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void withFloat512VectorTests(IntFunction<float []> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
  

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

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

@@ -2745,11 +2723,10 @@
                  }
              }
          }
      }
  
- 
      static boolean testIS_NAN(float a) {
          return Float.isNaN(a);
      }
  
      @Test(dataProvider = "floatTestOpProvider")

@@ -2787,11 +2764,10 @@
                  }
              }
          }
      }
  
- 
      static boolean testIS_INFINITE(float a) {
          return Float.isInfinite(a);
      }
  
      @Test(dataProvider = "floatTestOpProvider")

@@ -2829,11 +2805,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void LTFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -2849,11 +2824,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void ltFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -2892,11 +2866,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void GTFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -2935,11 +2908,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void EQFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -2955,11 +2927,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void eqFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -2998,11 +2969,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void NEFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -3041,11 +3011,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void LEFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -3084,11 +3053,10 @@
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void GEFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -3127,19 +3095,10 @@
                  }
              }
          }
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void LTFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -3152,11 +3111,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpMaskProvider")
      static void LTFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction<float[]> fa,
                                  IntFunction<float[]> fb, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -3189,11 +3147,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < (float)((long)b[i]));
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpMaskProvider")
      static void LTFloat512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction<float[]> fa,
                                  IntFunction<float[]> fb, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -3226,11 +3183,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpMaskProvider")
      static void EQFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction<float[]> fa,
                                  IntFunction<float[]> fb, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -3263,11 +3219,10 @@
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == (float)((long)b[i]));
              }
          }
      }
  
- 
      @Test(dataProvider = "floatCompareOpMaskProvider")
      static void EQFloat512VectorTestsBroadcastLongMaskedSmokeTest(IntFunction<float[]> fa,
                                  IntFunction<float[]> fb, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -3342,10 +3297,47 @@
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "floatUnaryOpMaskProvider")
+     static void compressFloat512VectorTests(IntFunction<float[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         float[] a = fa.apply(SPECIES.length());
+         float[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Float> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "floatUnaryOpMaskProvider")
+     static void expandFloat512VectorTests(IntFunction<float[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         float[] a = fa.apply(SPECIES.length());
+         float[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Float> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 FloatVector av = FloatVector.fromArray(SPECIES, a, i);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void getFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
  

@@ -3512,14 +3504,10 @@
          }
  
          assertBroadcastArraysEquals(r, a);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void ZeroFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = new float[a.length];
  

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

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

@@ -3587,10 +3573,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, origin, Float512VectorTests::sliceBinary);
      }
+ 
      static float[] slice(float[] a, float[] b, int origin, boolean[] mask, int idx) {
          float[] res = new float[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] : (float)0;

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

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

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

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

@@ -3790,11 +3779,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::EXP, Float512VectorTests::strictEXP);
      }
  
- 
      static float LOG1P(float a) {
          return (float)(Math.log1p((double)a));
      }
  
      static float strictLOG1P(float a) {

@@ -3814,11 +3802,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG1P, Float512VectorTests::strictLOG1P);
      }
  
- 
      static float LOG(float a) {
          return (float)(Math.log((double)a));
      }
  
      static float strictLOG(float a) {

@@ -3838,11 +3825,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG, Float512VectorTests::strictLOG);
      }
  
- 
      static float LOG10(float a) {
          return (float)(Math.log10((double)a));
      }
  
      static float strictLOG10(float a) {

@@ -3862,11 +3848,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::LOG10, Float512VectorTests::strictLOG10);
      }
  
- 
      static float EXPM1(float a) {
          return (float)(Math.expm1((double)a));
      }
  
      static float strictEXPM1(float a) {

@@ -3886,11 +3871,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::EXPM1, Float512VectorTests::strictEXPM1);
      }
  
- 
      static float COS(float a) {
          return (float)(Math.cos((double)a));
      }
  
      static float strictCOS(float a) {

@@ -3910,11 +3894,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::COS, Float512VectorTests::strictCOS);
      }
  
- 
      static float TAN(float a) {
          return (float)(Math.tan((double)a));
      }
  
      static float strictTAN(float a) {

@@ -3934,11 +3917,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::TAN, Float512VectorTests::strictTAN);
      }
  
- 
      static float SINH(float a) {
          return (float)(Math.sinh((double)a));
      }
  
      static float strictSINH(float a) {

@@ -3958,11 +3940,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::SINH, Float512VectorTests::strictSINH);
      }
  
- 
      static float COSH(float a) {
          return (float)(Math.cosh((double)a));
      }
  
      static float strictCOSH(float a) {

@@ -3982,11 +3963,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::COSH, Float512VectorTests::strictCOSH);
      }
  
- 
      static float TANH(float a) {
          return (float)(Math.tanh((double)a));
      }
  
      static float strictTANH(float a) {

@@ -4006,11 +3986,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::TANH, Float512VectorTests::strictTANH);
      }
  
- 
      static float ASIN(float a) {
          return (float)(Math.asin((double)a));
      }
  
      static float strictASIN(float a) {

@@ -4030,11 +4009,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ASIN, Float512VectorTests::strictASIN);
      }
  
- 
      static float ACOS(float a) {
          return (float)(Math.acos((double)a));
      }
  
      static float strictACOS(float a) {

@@ -4054,11 +4032,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ACOS, Float512VectorTests::strictACOS);
      }
  
- 
      static float ATAN(float a) {
          return (float)(Math.atan((double)a));
      }
  
      static float strictATAN(float a) {

@@ -4078,11 +4055,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::ATAN, Float512VectorTests::strictATAN);
      }
  
- 
      static float CBRT(float a) {
          return (float)(Math.cbrt((double)a));
      }
  
      static float strictCBRT(float a) {

@@ -4102,11 +4078,10 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, Float512VectorTests::CBRT, Float512VectorTests::strictCBRT);
      }
  
- 
      static float HYPOT(float a, float b) {
          return (float)(Math.hypot((double)a, (double)b));
      }
  
      static float strictHYPOT(float a, float b) {

@@ -4129,11 +4104,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::HYPOT, Float512VectorTests::strictHYPOT);
      }
  
  
- 
      static float POW(float a, float b) {
          return (float)(Math.pow((double)a, (double)b));
      }
  
      static float strictPOW(float a, float b) {

@@ -4155,10 +4129,11 @@
          }
  
          assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::POW, Float512VectorTests::strictPOW);
      }
  
+ 
      static float pow(float a, float b) {
          return (float)(Math.pow((double)a, (double)b));
      }
  
      static float strictpow(float a, float b) {

@@ -4181,11 +4156,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::pow, Float512VectorTests::strictpow);
      }
  
  
- 
      static float ATAN2(float a, float b) {
          return (float)(Math.atan2((double)a, (double)b));
      }
  
      static float strictATAN2(float a, float b) {

@@ -4208,11 +4182,10 @@
  
          assertArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::ATAN2, Float512VectorTests::strictATAN2);
      }
  
  
- 
      @Test(dataProvider = "floatBinaryOpProvider")
      static void POWFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -4223,10 +4196,11 @@
          }
  
          assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::POW, Float512VectorTests::strictPOW);
      }
  
+ 
      @Test(dataProvider = "floatBinaryOpProvider")
      static void powFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -4238,19 +4212,18 @@
  
          assertBroadcastArraysEqualsWithinOneUlp(r, a, b, Float512VectorTests::pow, Float512VectorTests::strictpow);
      }
  
  
- 
      static float FMA(float a, float b, float c) {
          return (float)(Math.fma(a, b, c));
      }
+ 
      static float fma(float a, float b, float c) {
          return (float)(Math.fma(a, b, c));
      }
  
- 
      @Test(dataProvider = "floatTernaryOpProvider")
      static void FMAFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb, IntFunction<float[]> fc) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] c = fc.apply(SPECIES.length());

@@ -4265,10 +4238,11 @@
              }
          }
  
          assertArraysEquals(r, a, b, c, Float512VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "floatTernaryOpProvider")
      static void fmaFloat512VectorTests(IntFunction<float[]> fa, IntFunction<float[]> fb, IntFunction<float[]> fc) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] c = fc.apply(SPECIES.length());

@@ -4282,11 +4256,10 @@
          }
  
          assertArraysEquals(r, a, b, c, Float512VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "floatTernaryOpMaskProvider")
      static void FMAFloat512VectorTestsMasked(IntFunction<float[]> fa, IntFunction<float[]> fb,
                                            IntFunction<float[]> fc, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -4305,14 +4278,10 @@
          }
  
          assertArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "floatTernaryOpProvider")
      static void FMAFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb, IntFunction<float[]> fc) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] c = fc.apply(SPECIES.length());

@@ -4339,11 +4308,10 @@
              av.lanewise(VectorOperators.FMA, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Float512VectorTests::FMA);
      }
  
- 
      @Test(dataProvider = "floatTernaryOpMaskProvider")
      static void FMAFloat512VectorTestsBroadcastMaskedSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb,
                                            IntFunction<float[]> fc, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -4378,13 +4346,10 @@
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA);
      }
  
- 
- 
- 
      @Test(dataProvider = "floatTernaryOpProvider")
      static void FMAFloat512VectorTestsDoubleBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb, IntFunction<float[]> fc) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] c = fc.apply(SPECIES.length());

@@ -4395,10 +4360,11 @@
              av.lanewise(VectorOperators.FMA, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Float512VectorTests::FMA);
      }
+ 
      @Test(dataProvider = "floatTernaryOpProvider")
      static void fmaFloat512VectorTestsDoubleBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb, IntFunction<float[]> fc) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
          float[] c = fc.apply(SPECIES.length());

@@ -4410,11 +4376,10 @@
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Float512VectorTests::fma);
      }
  
- 
      @Test(dataProvider = "floatTernaryOpMaskProvider")
      static void FMAFloat512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb,
                                            IntFunction<float[]> fc, IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());

@@ -4429,13 +4394,10 @@
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Float512VectorTests::FMA);
      }
  
- 
- 
- 
      static float NEG(float a) {
          return (float)(-((float)a));
      }
  
      static float neg(float a) {

@@ -4544,27 +4506,18 @@
          }
  
          assertArraysEquals(r, a, mask, Float512VectorTests::ABS);
      }
  
- 
- 
- 
- 
- 
- 
- 
      static float SQRT(float a) {
          return (float)(Math.sqrt((double)a));
      }
  
      static float sqrt(float a) {
          return (float)(Math.sqrt((double)a));
      }
  
- 
- 
      @Test(dataProvider = "floatUnaryOpProvider")
      static void SQRTFloat512VectorTests(IntFunction<float[]> fa) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());
  

@@ -4591,12 +4544,10 @@
          }
  
          assertArraysEquals(r, a, Float512VectorTests::sqrt);
      }
  
- 
- 
      @Test(dataProvider = "floatUnaryOpMaskProvider")
      static void SQRTMaskedFloat512VectorTests(IntFunction<float[]> fa,
                                                  IntFunction<boolean[]> fm) {
          float[] a = fa.apply(SPECIES.length());
          float[] r = fr.apply(SPECIES.length());

@@ -4611,11 +4562,10 @@
          }
  
          assertArraysEquals(r, a, mask, Float512VectorTests::SQRT);
      }
  
- 
      @Test(dataProvider = "floatCompareOpProvider")
      static void ltFloat512VectorTestsBroadcastSmokeTest(IntFunction<float[]> fa, IntFunction<float[]> fb) {
          float[] a = fa.apply(SPECIES.length());
          float[] b = fb.apply(SPECIES.length());
  

@@ -5013,10 +4963,27 @@
          }
  
          assertMaskReductionArraysEquals(r, a, Float512VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressFloat512VectorTestsSmokeTest(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},

@@ -5055,10 +5022,24 @@
                  Assert.assertEquals(actualMask.laneIsSet(j), index >= 0 && index < limit);
              }
          }
      }
  
+     @Test(dataProvider = "offsetProvider")
+     static void indexInRangeLongFloat512VectorTestsSmokeTest(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},

@@ -5075,10 +5056,18 @@
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongFloat512VectorTestsSmokeTest(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 ElementSizeFloat512VectorTestsSmokeTest() {
          FloatVector av = FloatVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Float.SIZE);

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