< prev index next >

test/jdk/jdk/incubator/vector/Long512VectorTests.java

Print this page
*** 216,10 ***
--- 216,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(long[] r, long[] 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], (long)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], (long)0, "at index #" + idx);
+             }
+         }
+     }
+ 
+     static void assertexpandArraysEquals(long[] r, long[] 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], (long)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], (long)0, "at index #" + idx);
+             }
+         }
+     }
+ 
      static void assertSelectFromArraysEquals(long[] r, long[] a, long[] order, int vector_len) {
          int i = 0, j = 0;
          try {
              for (; i < a.length; i += vector_len) {
                  for (j = 0; j < vector_len; j++) {

*** 872,11 ***
          } catch (AssertionError e) {
              Assert.assertEquals(r[i], (double)(a[i+offs]), "at index #" + i + ", input = " + a[i+offs]);
          }
      }
  
- 
      static long bits(long e) {
          return  e;
      }
  
      static final List<IntFunction<long[]>> LONG_GENERATORS = List.of(
--- 921,10 ---

*** 974,11 ***
          return INT_LONG_GENERATORS.stream().
                  map(f -> new Object[]{f}).
                  toArray(Object[][]::new);
      }
  
- 
      @DataProvider
      public Object[][] maskProvider() {
          return BOOLEAN_MASK_GENERATORS.stream().
                  map(f -> new Object[]{f}).
                  toArray(Object[][]::new);
--- 1022,10 ---

*** 1050,11 ***
                          return new Object[] {fa, fs, fm};
                  }))).
                  toArray(Object[][]::new);
      }
  
- 
      static final List<IntFunction<long[]>> LONG_COMPARE_GENERATORS = List.of(
              withToString("long[i]", (int s) -> {
                  return fill(s * BUFFER_REPS,
                              i -> (long)i);
              }),
--- 1097,10 ---

*** 1162,11 ***
      static final IntFunction<boolean[]> fmr = (vl) -> {
          int length = BUFFER_REPS * vl;
          return new boolean[length];
      };
  
- 
      static void replaceZero(long[] a, long v) {
          for (int i = 0; i < a.length; i++) {
              if (a[i] == 0) {
                  a[i] = v;
              }
--- 1208,10 ---

*** 1187,10 ***
--- 1232,22 ---
  
      static long ROR_scalar(long a, long b) {
          return Long.rotateRight(a, ((int)b));
      }
  
+     static long TRAILING_ZEROS_COUNT_scalar(long a) {
+         return Long.numberOfTrailingZeros(a);
+     }
+ 
+     static long LEADING_ZEROS_COUNT_scalar(long a) {
+         return Long.numberOfLeadingZeros(a);
+     }
+ 
+     static long REVERSE_scalar(long a) {
+         return Long.reverse(a);
+     }
+ 
      static boolean eq(long a, long b) {
          return a == b;
      }
  
      static boolean neq(long a, long b) {

*** 1341,10 ***
--- 1398,11 ---
              a.div(b, m);
              Assert.fail();
          } catch (ArithmeticException e) {
          }
      }
+ 
      static long ADD(long a, long b) {
          return (long)(a + b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1361,10 ***
--- 1419,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::ADD);
      }
+ 
      static long add(long a, long b) {
          return (long)(a + b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1417,10 ***
--- 1476,11 ---
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::add);
      }
+ 
      static long SUB(long a, long b) {
          return (long)(a - b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1437,10 ***
--- 1497,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::SUB);
      }
+ 
      static long sub(long a, long b) {
          return (long)(a - b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1493,10 ***
--- 1554,11 ---
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::sub);
      }
+ 
      static long MUL(long a, long b) {
          return (long)(a * b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1513,10 ***
--- 1575,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::MUL);
      }
+ 
      static long mul(long a, long b) {
          return (long)(a * b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1570,12 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::mul);
      }
  
- 
- 
      static long DIV(long a, long b) {
          return (long)(a / b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 1633,10 ---

*** 1594,10 ***
--- 1655,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::DIV);
      }
+ 
      static long div(long a, long b) {
          return (long)(a / b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1617,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void DIVLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 1679,10 ---

*** 1724,10 ***
--- 1784,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::AND);
      }
+ 
      static long and(long a, long b) {
          return (long)(a & b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1743,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ANDLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 1804,10 ---

*** 1765,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::AND);
      }
  
- 
      static long AND_NOT(long a, long b) {
          return (long)(a & ~b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 1824,10 ---

*** 1787,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::AND_NOT);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void AND_NOTLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 1845,10 ---

*** 1809,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::AND_NOT);
      }
  
- 
      static long OR(long a, long b) {
          return (long)(a | b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 1865,10 ---

*** 1830,10 ***
--- 1885,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::OR);
      }
+ 
      static long or(long a, long b) {
          return (long)(a | b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 1849,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ORLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 1905,10 ---

*** 1871,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::OR);
      }
  
- 
      static long XOR(long a, long b) {
          return (long)(a ^ b);
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 1925,10 ---

*** 1893,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::XOR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void XORLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 1946,10 ---

*** 1915,10 ***
--- 1966,91 ---
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::XOR);
      }
  
+     static long COMPRESS_BITS(long a, long b) {
+         return (long)(Long.compress(a, b));
+     }
+ 
+     @Test(dataProvider = "longBinaryOpProvider")
+     static void COMPRESS_BITSLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] b = fb.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 LongVector bv = LongVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.COMPRESS_BITS, bv).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, Long512VectorTests::COMPRESS_BITS);
+     }
+ 
+     @Test(dataProvider = "longBinaryOpMaskProvider")
+     static void COMPRESS_BITSLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
+                                           IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] b = fb.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 LongVector bv = LongVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.COMPRESS_BITS, bv, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, mask, Long512VectorTests::COMPRESS_BITS);
+     }
+ 
+     static long EXPAND_BITS(long a, long b) {
+         return (long)(Long.expand(a, b));
+     }
+ 
+     @Test(dataProvider = "longBinaryOpProvider")
+     static void EXPAND_BITSLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] b = fb.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 LongVector bv = LongVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.EXPAND_BITS, bv).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, Long512VectorTests::EXPAND_BITS);
+     }
+ 
+     @Test(dataProvider = "longBinaryOpMaskProvider")
+     static void EXPAND_BITSLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
+                                           IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] b = fb.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 LongVector bv = LongVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.EXPAND_BITS, bv, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, mask, Long512VectorTests::EXPAND_BITS);
+     }
  
      @Test(dataProvider = "longBinaryOpProvider")
      static void addLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());

*** 2009,13 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::mul);
      }
  
- 
- 
- 
      @Test(dataProvider = "longBinaryOpProvider")
      static void divLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2141,10 ---

*** 2028,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Long512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void divLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2157,10 ---

*** 2049,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpProvider")
      static void ORLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2176,10 ---

*** 2079,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Long512VectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ORLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2204,10 ---

*** 2098,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpProvider")
      static void ANDLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2221,10 ---

*** 2128,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Long512VectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ANDLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2249,10 ---

*** 2147,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Long512VectorTests::AND);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpProvider")
      static void ORLong512VectorTestsBroadcastLongSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2266,10 ---

*** 2163,12 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, Long512VectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ORLong512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2280,10 ---

*** 2182,11 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Long512VectorTests::OR);
      }
  
- 
      @Test(dataProvider = "longBinaryOpProvider")
      static void ADDLong512VectorTestsBroadcastLongSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2297,10 ---

*** 2235,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::LSHL);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void LSHLLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2349,10 ---

*** 2257,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::LSHL);
      }
  
- 
- 
- 
- 
- 
      static long ASHR(long a, long b) {
          return (long)((a >> b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2369,10 ---

*** 2283,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::ASHR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ASHRLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2390,10 ---

*** 2305,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::ASHR);
      }
  
- 
- 
- 
- 
- 
      static long LSHR(long a, long b) {
          return (long)((a >>> b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2410,10 ---

*** 2331,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::LSHR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void LSHRLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2431,10 ---

*** 2353,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::LSHR);
      }
  
- 
- 
- 
- 
- 
      static long LSHL_unary(long a, long b) {
          return (long)((a << b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2451,10 ---

*** 2378,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Long512VectorTests::LSHL_unary);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void LSHLLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2471,10 ---

*** 2399,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::LSHL_unary);
      }
  
- 
- 
- 
- 
- 
      static long LSHR_unary(long a, long b) {
          return (long)((a >>> b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2490,10 ---

*** 2424,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Long512VectorTests::LSHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void LSHRLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2510,10 ---

*** 2445,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::LSHR_unary);
      }
  
- 
- 
- 
- 
- 
      static long ASHR_unary(long a, long b) {
          return (long)((a >> b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2529,10 ---

*** 2470,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Long512VectorTests::ASHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ASHRLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2549,10 ---

*** 2491,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ASHR_unary);
      }
  
- 
- 
- 
- 
- 
      static long ROR(long a, long b) {
          return (long)(ROR_scalar(a,b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2568,10 ---

*** 2517,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::ROR);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void RORLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2589,10 ---

*** 2539,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::ROR);
      }
  
- 
      static long ROL(long a, long b) {
          return (long)(ROL_scalar(a,b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2609,10 ---

*** 2561,12 ***
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::ROL);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ROLLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2630,10 ---

*** 2583,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Long512VectorTests::ROL);
      }
  
- 
      static long ROR_unary(long a, long b) {
          return (long)(ROR_scalar(a, b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2650,10 ---

*** 2604,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Long512VectorTests::ROR_unary);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void RORLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2670,10 ---

*** 2625,11 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROR_unary);
      }
  
- 
      static long ROL_unary(long a, long b) {
          return (long)(ROL_scalar(a, b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")
--- 2689,10 ---

*** 2646,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Long512VectorTests::ROL_unary);
      }
  
- 
- 
      @Test(dataProvider = "longBinaryOpMaskProvider")
      static void ROLLong512VectorTestsScalarShiftMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 2709,10 ---

*** 2666,12 ***
              }
          }
  
          assertShiftArraysEquals(r, a, b, mask, Long512VectorTests::ROL_unary);
      }
- 
- 
      static long LSHR_binary_const(long a) {
          return (long)((a >>> CONST_SHIFT));
      }
  
      @Test(dataProvider = "longUnaryOpProvider")
--- 2727,10 ---

*** 2687,12 ***
          }
  
          assertShiftConstEquals(r, a, Long512VectorTests::LSHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void LSHRLong512VectorTestsScalarShiftMaskedConst(IntFunction<long[]> fa,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2746,10 ---

*** 2707,16 ***
          }
  
          assertShiftConstEquals(r, a, mask, Long512VectorTests::LSHR_binary_const);
      }
  
- 
- 
- 
- 
- 
- 
      static long LSHL_binary_const(long a) {
          return (long)((a << CONST_SHIFT));
      }
  
      @Test(dataProvider = "longUnaryOpProvider")
--- 2764,10 ---

*** 2732,12 ***
          }
  
          assertShiftConstEquals(r, a, Long512VectorTests::LSHL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void LSHLLong512VectorTestsScalarShiftMaskedConst(IntFunction<long[]> fa,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2783,10 ---

*** 2752,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Long512VectorTests::LSHL_binary_const);
      }
  
- 
- 
      static long ASHR_binary_const(long a) {
          return (long)((a >> CONST_SHIFT));
      }
  
      @Test(dataProvider = "longUnaryOpProvider")
--- 2801,10 ---

*** 2773,12 ***
          }
  
          assertShiftConstEquals(r, a, Long512VectorTests::ASHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ASHRLong512VectorTestsScalarShiftMaskedConst(IntFunction<long[]> fa,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2820,10 ---

*** 2793,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Long512VectorTests::ASHR_binary_const);
      }
  
- 
- 
      static long ROR_binary_const(long a) {
          return (long)(ROR_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "longUnaryOpProvider")
--- 2838,10 ---

*** 2814,12 ***
          }
  
          assertShiftConstEquals(r, a, Long512VectorTests::ROR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void RORLong512VectorTestsScalarShiftMaskedConst(IntFunction<long[]> fa,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2857,10 ---

*** 2834,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Long512VectorTests::ROR_binary_const);
      }
  
- 
- 
      static long ROL_binary_const(long a) {
          return (long)(ROL_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "longUnaryOpProvider")
--- 2875,10 ---

*** 2855,12 ***
          }
  
          assertShiftConstEquals(r, a, Long512VectorTests::ROL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ROLLong512VectorTestsScalarShiftMaskedConst(IntFunction<long[]> fa,
                                            IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 2894,10 ---

*** 2896,10 ***
--- 2933,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::MIN);
      }
+ 
      static long min(long a, long b) {
          return (long)(Math.min(a, b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 2914,10 ***
--- 2952,11 ---
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::min);
      }
+ 
      static long MAX(long a, long b) {
          return (long)(Math.max(a, b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 2934,10 ***
--- 2973,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Long512VectorTests::MAX);
      }
+ 
      static long max(long a, long b) {
          return (long)(Math.max(a, b));
      }
  
      @Test(dataProvider = "longBinaryOpProvider")

*** 3027,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void ANDReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = -1;
--- 3067,10 ---

*** 3053,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::ANDReduce, Long512VectorTests::ANDReduceAll);
      }
  
- 
      static long ANDReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = -1;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res &= a[i];
--- 3092,10 ---

*** 3073,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ANDReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3111,10 ---

*** 3101,11 ***
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::ANDReduceMasked, Long512VectorTests::ANDReduceAllMasked);
      }
  
- 
      static long ORReduce(long[] a, int idx) {
          long res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res |= a[i];
          }
--- 3138,10 ---

*** 3120,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void ORReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = 0;
--- 3156,10 ---

*** 3146,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::ORReduce, Long512VectorTests::ORReduceAll);
      }
  
- 
      static long ORReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res |= a[i];
--- 3181,10 ---

*** 3166,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ORReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3200,10 ---

*** 3194,11 ***
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::ORReduceMasked, Long512VectorTests::ORReduceAllMasked);
      }
  
- 
      static long XORReduce(long[] a, int idx) {
          long res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res ^= a[i];
          }
--- 3227,10 ---

*** 3213,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void XORReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = 0;
--- 3245,10 ---

*** 3239,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::XORReduce, Long512VectorTests::XORReduceAll);
      }
  
- 
      static long XORReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res ^= a[i];
--- 3270,10 ---

*** 3259,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void XORReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3289,10 ---

*** 3304,10 ***
--- 3333,11 ---
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void ADDReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = 0;

*** 3328,10 ***
--- 3358,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::ADDReduce, Long512VectorTests::ADDReduceAll);
      }
+ 
      static long ADDReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res += a[i];

*** 3346,10 ***
--- 3377,11 ---
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ADDReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

*** 3372,10 ***
--- 3404,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::ADDReduceMasked, Long512VectorTests::ADDReduceAllMasked);
      }
+ 
      static long MULReduce(long[] a, int idx) {
          long res = 1;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res *= a[i];
          }

*** 3389,10 ***
--- 3422,11 ---
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void MULReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = 1;

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

*** 3431,10 ***
--- 3466,11 ---
              res *= MULReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void MULReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

*** 3457,10 ***
--- 3493,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::MULReduceMasked, Long512VectorTests::MULReduceAllMasked);
      }
+ 
      static long MINReduce(long[] a, int idx) {
          long res = Long.MAX_VALUE;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = (long) Math.min(res, a[i]);
          }

*** 3474,10 ***
--- 3511,11 ---
              res = (long) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void MINReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = Long.MAX_VALUE;

*** 3498,10 ***
--- 3536,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::MINReduce, Long512VectorTests::MINReduceAll);
      }
+ 
      static long MINReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = Long.MAX_VALUE;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (long) Math.min(res, a[i]);

*** 3516,10 ***
--- 3555,11 ---
              res = (long) Math.min(res, MINReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void MINReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

*** 3542,10 ***
--- 3582,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::MINReduceMasked, Long512VectorTests::MINReduceAllMasked);
      }
+ 
      static long MAXReduce(long[] a, int idx) {
          long res = Long.MIN_VALUE;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = (long) Math.max(res, a[i]);
          }

*** 3559,10 ***
--- 3600,11 ---
              res = (long) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void MAXReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = Long.MIN_VALUE;

*** 3583,10 ***
--- 3625,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::MAXReduce, Long512VectorTests::MAXReduceAll);
      }
+ 
      static long MAXReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = Long.MIN_VALUE;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = (long) Math.max(res, a[i]);

*** 3601,10 ***
--- 3644,11 ---
              res = (long) Math.max(res, MAXReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void MAXReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

*** 3627,10 ***
--- 3671,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  Long512VectorTests::MAXReduceMasked, Long512VectorTests::MAXReduceAllMasked);
      }
+ 
      static long FIRST_NONZEROReduce(long[] a, int idx) {
          long res = (long) 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res = firstNonZero(res, a[i]);
          }

*** 3644,10 ***
--- 3689,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void FIRST_NONZEROReduceLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          long ra = (long) 0;

*** 3668,10 ***
--- 3714,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Long512VectorTests::FIRST_NONZEROReduce, Long512VectorTests::FIRST_NONZEROReduceAll);
      }
+ 
      static long FIRST_NONZEROReduceMasked(long[] a, int idx, boolean[] mask) {
          long res = (long) 0;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              if (mask[i % SPECIES.length()])
                  res = firstNonZero(res, a[i]);

*** 3686,10 ***
--- 3733,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

*** 3722,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "boolUnaryOpProvider")
      static void anyTrueLong512VectorTests(IntFunction<boolean[]> fm) {
          boolean[] mask = fm.apply(SPECIES.length());
          boolean[] r = fmr.apply(SPECIES.length());
  
--- 3770,10 ---

*** 3738,21 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, Long512VectorTests::anyTrue);
      }
  
- 
      static boolean allTrue(boolean[] a, int idx) {
          boolean res = true;
          for (int i = idx; i < (idx + SPECIES.length()); i++) {
              res &= a[i];
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "boolUnaryOpProvider")
      static void allTrueLong512VectorTests(IntFunction<boolean[]> fm) {
          boolean[] mask = fm.apply(SPECIES.length());
          boolean[] r = fmr.apply(SPECIES.length());
  
--- 3785,19 ---

*** 3764,11 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, Long512VectorTests::allTrue);
      }
  
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void withLong512VectorTests(IntFunction<long []> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
  
--- 3809,10 ---

*** 3782,10 ***
--- 3826,11 ---
  
          for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
              assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
          }
      }
+ 
      static boolean testIS_DEFAULT(long a) {
          return bits(a)==0;
      }
  
      @Test(dataProvider = "longTestOpProvider")

*** 3822,10 ***
--- 3867,11 ---
                      Assert.assertEquals(mv.laneIsSet(j),  vmask.laneIsSet(j) && testIS_DEFAULT(a[i + j]));
                  }
              }
          }
      }
+ 
      static boolean testIS_NEGATIVE(long a) {
          return bits(a)<0;
      }
  
      @Test(dataProvider = "longTestOpProvider")

*** 3863,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void LTLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 3909,10 ---

*** 3885,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void ltLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 3928,10 ---

*** 3928,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void GTLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 3970,10 ---

*** 3971,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void EQLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4012,10 ---

*** 3991,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void eqLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4031,10 ---

*** 4034,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void NELong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4073,10 ---

*** 4077,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void LELong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4115,10 ---

*** 4120,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void GELong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4157,10 ---

*** 4163,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void UNSIGNED_LTLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4199,10 ---

*** 4184,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void UNSIGNED_LTLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4218,10 ---

*** 4209,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void UNSIGNED_GTLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4241,10 ---

*** 4231,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void UNSIGNED_GTLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4260,10 ---

*** 4256,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void UNSIGNED_LELong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4283,10 ---

*** 4278,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void UNSIGNED_LELong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4302,10 ---

*** 4303,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void UNSIGNED_GELong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4325,10 ---

*** 4325,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void UNSIGNED_GELong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4344,10 ---

*** 4350,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "longCompareOpProvider")
      static void LTLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
  
--- 4367,10 ---

*** 4368,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void LTLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa,
                                  IntFunction<long[]> fb, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4383,10 ---

*** 4406,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "longCompareOpMaskProvider")
      static void EQLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa,
                                  IntFunction<long[]> fb, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4420,10 ---

*** 4486,10 ***
--- 4499,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void compressLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void expandLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "longUnaryOpProvider")
      static void getLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
  

*** 4656,14 ***
          }
  
          assertBroadcastArraysEquals(r, a);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void ZeroLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = new long[a.length];
  
--- 4706,10 ---

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

*** 4702,10 ***
--- 4745,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, Long512VectorTests::sliceUnary);
      }
+ 
      static long[] sliceBinary(long[] a, long[] b, int origin, int idx) {
          long[] res = new long[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = a[idx+i+origin];

*** 4731,10 ***
--- 4775,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, Long512VectorTests::sliceBinary);
      }
+ 
      static long[] slice(long[] a, long[] b, int origin, boolean[] mask, int idx) {
          long[] res = new long[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] : (long)0;

*** 4764,10 ***
--- 4809,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, mask, Long512VectorTests::slice);
      }
+ 
      static long[] unsliceUnary(long[] a, int origin, int idx) {
          long[] res = new long[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i < origin)
                  res[i] = (long)0;

*** 4791,10 ***
--- 4837,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, Long512VectorTests::unsliceUnary);
      }
+ 
      static long[] unsliceBinary(long[] a, long[] b, int origin, int part, int idx) {
          long[] res = new long[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if (part == 0) {
                  if (i < origin)

*** 4830,10 ***
--- 4877,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, part, Long512VectorTests::unsliceBinary);
      }
+ 
      static long[] unslice(long[] a, long[] b, int origin, int part, boolean[] mask, int idx) {
          long[] res = new long[SPECIES.length()];
          for (int i = 0, j = 0; i < SPECIES.length(); i++){
              if(i+origin < SPECIES.length())
                  res[i] = b[idx+i+origin];

*** 4887,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Long512VectorTests::unslice);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static long BITWISE_BLEND(long a, long b, long c) {
          return (long)((a&~(c))|(b&c));
      }
      static long bitwiseBlend(long a, long b, long c) {
          return (long)((a&~(c))|(b&c));
      }
  
- 
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());
--- 4935,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Long512VectorTests::unslice);
      }
  
      static long BITWISE_BLEND(long a, long b, long c) {
          return (long)((a&~(c))|(b&c));
      }
+ 
      static long bitwiseBlend(long a, long b, long c) {
          return (long)((a&~(c))|(b&c));
      }
  
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());

*** 4935,10 ***
--- 4961,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLong512VectorTests(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());

*** 4952,11 ***
          }
  
          assertArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "longTernaryOpMaskProvider")
      static void BITWISE_BLENDLong512VectorTestsMasked(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<long[]> fc, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 4979,10 ---

*** 4975,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());
--- 5001,10 ---

*** 5007,10 ***
--- 5030,11 ---
              LongVector cv = LongVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());

*** 5037,11 ***
              av.bitwiseBlend(b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "longTernaryOpMaskProvider")
      static void BITWISE_BLENDLong512VectorTestsBroadcastMaskedSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<long[]> fc, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 5061,10 ---

*** 5076,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLong512VectorTestsDoubleBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());
--- 5099,10 ---

*** 5093,10 ***
--- 5113,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Long512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLong512VectorTestsDoubleBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb, IntFunction<long[]> fc) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
          long[] c = fc.apply(SPECIES.length());

*** 5108,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Long512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "longTernaryOpMaskProvider")
      static void BITWISE_BLENDLong512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb,
                                            IntFunction<long[]> fc, IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());
--- 5129,10 ---

*** 5127,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Long512VectorTests::BITWISE_BLEND);
      }
  
- 
      static long NEG(long a) {
          return (long)(-((long)a));
      }
  
      static long neg(long a) {
--- 5147,10 ---

*** 5240,21 ***
          }
  
          assertArraysEquals(r, a, mask, Long512VectorTests::ABS);
      }
  
- 
      static long NOT(long a) {
          return (long)(~((long)a));
      }
  
      static long not(long a) {
          return (long)(~((long)a));
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void NOTLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
  
--- 5259,18 ---

*** 5281,12 ***
          }
  
          assertArraysEquals(r, a, Long512VectorTests::not);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void NOTMaskedLong512VectorTests(IntFunction<long[]> fa,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 5297,10 ---

*** 5301,18 ***
          }
  
          assertArraysEquals(r, a, mask, Long512VectorTests::NOT);
      }
  
- 
- 
      static long ZOMO(long a) {
          return (long)((a==0?0:-1));
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpProvider")
      static void ZOMOLong512VectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
  
--- 5315,14 ---

*** 5324,12 ***
          }
  
          assertArraysEquals(r, a, Long512VectorTests::ZOMO);
      }
  
- 
- 
      @Test(dataProvider = "longUnaryOpMaskProvider")
      static void ZOMOMaskedLong512VectorTests(IntFunction<long[]> fa,
                                                  IntFunction<boolean[]> fm) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
--- 5334,10 ---

*** 5344,13 ***
--- 5352,194 ---
          }
  
          assertArraysEquals(r, a, mask, Long512VectorTests::ZOMO);
      }
  
+     static long BIT_COUNT(long a) {
+         return (long)(Long.bitCount(a));
+     }
  
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void BIT_COUNTLong512VectorTests(IntFunction<long[]> fa) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
  
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Long512VectorTests::BIT_COUNT);
+     }
  
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Long512VectorTests::BIT_COUNT);
+     }
+ 
+     static long TRAILING_ZEROS_COUNT(long a) {
+         return (long)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTLong512VectorTests(IntFunction<long[]> fa) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Long512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Long512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static long LEADING_ZEROS_COUNT(long a) {
+         return (long)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTLong512VectorTests(IntFunction<long[]> fa) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Long512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Long512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static long REVERSE(long a) {
+         return (long)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void REVERSELong512VectorTests(IntFunction<long[]> fa) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Long512VectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void REVERSEMaskedLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Long512VectorTests::REVERSE);
+     }
+ 
+     static long REVERSE_BYTES(long a) {
+         return (long)(Long.reverseBytes(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void REVERSE_BYTESLong512VectorTests(IntFunction<long[]> fa) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Long512VectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedLong512VectorTests(IntFunction<long[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         long[] a = fa.apply(SPECIES.length());
+         long[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Long> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 LongVector av = LongVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Long512VectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "longCompareOpProvider")
      static void ltLong512VectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());

*** 5683,10 ***
--- 5872,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, Long512VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressLong512VectorTestsSmokeTest(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},

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

*** 5745,10 ***
--- 5965,18 ---
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongLong512VectorTestsSmokeTest(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 ElementSizeLong512VectorTestsSmokeTest() {
          LongVector av = LongVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Long.SIZE);

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