< prev index next >

test/jdk/jdk/incubator/vector/LongMaxVectorTests.java

Print this page
*** 221,10 ***
--- 221,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++) {

*** 877,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(
--- 926,10 ---

*** 979,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);
--- 1027,10 ---

*** 1055,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);
              }),
--- 1102,10 ---

*** 1167,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;
              }
--- 1213,10 ---

*** 1192,10 ***
--- 1237,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) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 1920,10 ***
--- 1971,91 ---
          }
  
          assertArraysEquals(r, a, b, mask, LongMaxVectorTests::XOR);
      }
  
+     static long COMPRESS_BITS(long a, long b) {
+         return (long)(Long.compress(a, b));
+     }
+ 
+     @Test(dataProvider = "longBinaryOpProvider")
+     static void COMPRESS_BITSLongMaxVectorTests(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, LongMaxVectorTests::COMPRESS_BITS);
+     }
+ 
+     @Test(dataProvider = "longBinaryOpMaskProvider")
+     static void COMPRESS_BITSLongMaxVectorTestsMasked(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, LongMaxVectorTests::COMPRESS_BITS);
+     }
+ 
+     static long EXPAND_BITS(long a, long b) {
+         return (long)(Long.expand(a, b));
+     }
+ 
+     @Test(dataProvider = "longBinaryOpProvider")
+     static void EXPAND_BITSLongMaxVectorTests(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, LongMaxVectorTests::EXPAND_BITS);
+     }
+ 
+     @Test(dataProvider = "longBinaryOpMaskProvider")
+     static void EXPAND_BITSLongMaxVectorTestsMasked(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, LongMaxVectorTests::EXPAND_BITS);
+     }
  
      @Test(dataProvider = "longBinaryOpProvider")
      static void addLongMaxVectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 3058,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::ANDReduce, LongMaxVectorTests::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];
--- 3097,10 ---

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

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

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

*** 3151,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::ORReduce, LongMaxVectorTests::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];
--- 3186,10 ---

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

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

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

*** 3244,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::XORReduce, LongMaxVectorTests::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];
--- 3275,10 ---

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

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

*** 3333,10 ***
--- 3363,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::ADDReduce, LongMaxVectorTests::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];

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

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

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

*** 3418,10 ***
--- 3452,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::MULReduce, LongMaxVectorTests::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];

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

*** 3462,10 ***
--- 3498,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  LongMaxVectorTests::MULReduceMasked, LongMaxVectorTests::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]);
          }

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

*** 3503,10 ***
--- 3541,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::MINReduce, LongMaxVectorTests::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]);

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

*** 3547,10 ***
--- 3587,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  LongMaxVectorTests::MINReduceMasked, LongMaxVectorTests::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]);
          }

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

*** 3588,10 ***
--- 3630,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::MAXReduce, LongMaxVectorTests::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]);

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

*** 3632,10 ***
--- 3676,11 ---
          }
  
          assertReductionArraysEqualsMasked(r, ra, a, mask,
                  LongMaxVectorTests::MAXReduceMasked, LongMaxVectorTests::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]);
          }

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

*** 3673,10 ***
--- 3719,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  LongMaxVectorTests::FIRST_NONZEROReduce, LongMaxVectorTests::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]);

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

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

*** 3743,21 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, LongMaxVectorTests::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 allTrueLongMaxVectorTests(IntFunction<boolean[]> fm) {
          boolean[] mask = fm.apply(SPECIES.length());
          boolean[] r = fmr.apply(SPECIES.length());
  
--- 3790,19 ---

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

*** 3787,10 ***
--- 3831,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")

*** 3827,10 ***
--- 3872,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")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 4491,10 ***
--- 4504,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void compressLongMaxVectorTests(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 expandLongMaxVectorTests(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 getLongMaxVectorTests(IntFunction<long[]> fa) {
          long[] a = fa.apply(SPECIES.length());
          long[] r = fr.apply(SPECIES.length());
  

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

*** 4679,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];
--- 4725,10 ---

*** 4707,10 ***
--- 4750,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, LongMaxVectorTests::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];

*** 4736,10 ***
--- 4780,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, LongMaxVectorTests::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;

*** 4769,10 ***
--- 4814,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, mask, LongMaxVectorTests::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;

*** 4796,10 ***
--- 4842,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, LongMaxVectorTests::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)

*** 4835,10 ***
--- 4882,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, part, LongMaxVectorTests::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];

*** 4892,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, LongMaxVectorTests::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_BLENDLongMaxVectorTests(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());
--- 4940,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, LongMaxVectorTests::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_BLENDLongMaxVectorTests(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());

*** 4940,10 ***
--- 4966,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLongMaxVectorTests(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());

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

*** 4980,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLongMaxVectorTestsBroadcastSmokeTest(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());
--- 5006,10 ---

*** 5012,10 ***
--- 5035,11 ---
              LongVector cv = LongVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLongMaxVectorTestsBroadcastSmokeTest(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());

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

*** 5081,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "longTernaryOpProvider")
      static void BITWISE_BLENDLongMaxVectorTestsDoubleBroadcastSmokeTest(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());
--- 5104,10 ---

*** 5098,10 ***
--- 5118,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, LongMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "longTernaryOpProvider")
      static void bitwiseBlendLongMaxVectorTestsDoubleBroadcastSmokeTest(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());

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

*** 5132,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, LongMaxVectorTests::BITWISE_BLEND);
      }
  
- 
      static long NEG(long a) {
          return (long)(-((long)a));
      }
  
      static long neg(long a) {
--- 5152,10 ---

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

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

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

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

*** 5349,13 ***
--- 5357,194 ---
          }
  
          assertArraysEquals(r, a, mask, LongMaxVectorTests::ZOMO);
      }
  
+     static long BIT_COUNT(long a) {
+         return (long)(Long.bitCount(a));
+     }
  
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void BIT_COUNTLongMaxVectorTests(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, LongMaxVectorTests::BIT_COUNT);
+     }
  
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedLongMaxVectorTests(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, LongMaxVectorTests::BIT_COUNT);
+     }
+ 
+     static long TRAILING_ZEROS_COUNT(long a) {
+         return (long)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTLongMaxVectorTests(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, LongMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedLongMaxVectorTests(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, LongMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static long LEADING_ZEROS_COUNT(long a) {
+         return (long)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTLongMaxVectorTests(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, LongMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedLongMaxVectorTests(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, LongMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static long REVERSE(long a) {
+         return (long)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void REVERSELongMaxVectorTests(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, LongMaxVectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void REVERSEMaskedLongMaxVectorTests(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, LongMaxVectorTests::REVERSE);
+     }
+ 
+     static long REVERSE_BYTES(long a) {
+         return (long)(Long.reverseBytes(a));
+     }
+ 
+     @Test(dataProvider = "longUnaryOpProvider")
+     static void REVERSE_BYTESLongMaxVectorTests(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, LongMaxVectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "longUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedLongMaxVectorTests(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, LongMaxVectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "longCompareOpProvider")
      static void ltLongMaxVectorTestsBroadcastSmokeTest(IntFunction<long[]> fa, IntFunction<long[]> fb) {
          long[] a = fa.apply(SPECIES.length());
          long[] b = fb.apply(SPECIES.length());

*** 5688,10 ***
--- 5877,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, LongMaxVectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressLongMaxVectorTestsSmokeTest(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[][] offsetProvider() {
          return new Object[][]{
                  {0},

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

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

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