< prev index next >

test/jdk/jdk/incubator/vector/IntMaxVectorTests.java

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

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

*** 982,12 ***
                      return new Object[] {fa, fm};
                  })).
                  toArray(Object[][]::new);
      }
  
- 
- 
      @DataProvider
      public Object[][] maskProvider() {
          return BOOLEAN_MASK_GENERATORS.stream().
                  map(f -> new Object[]{f}).
                  toArray(Object[][]::new);
--- 1030,10 ---

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

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

*** 1324,10 ***
--- 1381,11 ---
              a.div(b, m);
              Assert.fail();
          } catch (ArithmeticException e) {
          }
      }
+ 
      static int ADD(int a, int b) {
          return (int)(a + b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1344,10 ***
--- 1402,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::ADD);
      }
+ 
      static int add(int a, int b) {
          return (int)(a + b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1400,10 ***
--- 1459,11 ---
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::add);
      }
+ 
      static int SUB(int a, int b) {
          return (int)(a - b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1420,10 ***
--- 1480,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::SUB);
      }
+ 
      static int sub(int a, int b) {
          return (int)(a - b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1476,10 ***
--- 1537,11 ---
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::sub);
      }
+ 
      static int MUL(int a, int b) {
          return (int)(a * b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1496,10 ***
--- 1558,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::MUL);
      }
+ 
      static int mul(int a, int b) {
          return (int)(a * b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1553,12 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::mul);
      }
  
- 
- 
      static int DIV(int a, int b) {
          return (int)(a / b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 1616,10 ---

*** 1577,10 ***
--- 1638,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::DIV);
      }
+ 
      static int div(int a, int b) {
          return (int)(a / b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1600,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void DIVIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 1662,10 ---

*** 1707,10 ***
--- 1767,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::AND);
      }
+ 
      static int and(int a, int b) {
          return (int)(a & b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1726,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ANDIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 1787,10 ---

*** 1748,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::AND);
      }
  
- 
      static int AND_NOT(int a, int b) {
          return (int)(a & ~b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 1807,10 ---

*** 1770,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::AND_NOT);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void AND_NOTIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 1828,10 ---

*** 1792,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::AND_NOT);
      }
  
- 
      static int OR(int a, int b) {
          return (int)(a | b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 1848,10 ---

*** 1813,10 ***
--- 1868,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::OR);
      }
+ 
      static int or(int a, int b) {
          return (int)(a | b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 1832,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ORIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 1888,10 ---

*** 1854,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::OR);
      }
  
- 
      static int XOR(int a, int b) {
          return (int)(a ^ b);
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 1908,10 ---

*** 1876,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::XOR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void XORIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 1929,10 ---

*** 1898,10 ***
--- 1949,91 ---
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::XOR);
      }
  
+     static int COMPRESS_BITS(int a, int b) {
+         return (int)(Integer.compress(a, b));
+     }
+ 
+     @Test(dataProvider = "intBinaryOpProvider")
+     static void COMPRESS_BITSIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] b = fb.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 IntVector bv = IntVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.COMPRESS_BITS, bv).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, IntMaxVectorTests::COMPRESS_BITS);
+     }
+ 
+     @Test(dataProvider = "intBinaryOpMaskProvider")
+     static void COMPRESS_BITSIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
+                                           IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] b = fb.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 IntVector bv = IntVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.COMPRESS_BITS, bv, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, mask, IntMaxVectorTests::COMPRESS_BITS);
+     }
+ 
+     static int EXPAND_BITS(int a, int b) {
+         return (int)(Integer.expand(a, b));
+     }
+ 
+     @Test(dataProvider = "intBinaryOpProvider")
+     static void EXPAND_BITSIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] b = fb.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 IntVector bv = IntVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.EXPAND_BITS, bv).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, IntMaxVectorTests::EXPAND_BITS);
+     }
+ 
+     @Test(dataProvider = "intBinaryOpMaskProvider")
+     static void EXPAND_BITSIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
+                                           IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] b = fb.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 IntVector bv = IntVector.fromArray(SPECIES, b, i);
+                 av.lanewise(VectorOperators.EXPAND_BITS, bv, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, b, mask, IntMaxVectorTests::EXPAND_BITS);
+     }
  
      @Test(dataProvider = "intBinaryOpProvider")
      static void addIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());

*** 1992,13 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::mul);
      }
  
- 
- 
- 
      @Test(dataProvider = "intBinaryOpProvider")
      static void divIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2124,10 ---

*** 2011,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void divIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2140,10 ---

*** 2032,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpProvider")
      static void ORIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2159,10 ---

*** 2062,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ORIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2187,10 ---

*** 2081,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpProvider")
      static void ANDIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2204,10 ---

*** 2111,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, IntMaxVectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ANDIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2232,10 ---

*** 2130,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, IntMaxVectorTests::AND);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpProvider")
      static void ORIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2249,10 ---

*** 2146,12 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, IntMaxVectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ORIntMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2263,10 ---

*** 2165,11 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, IntMaxVectorTests::OR);
      }
  
- 
      @Test(dataProvider = "intBinaryOpProvider")
      static void ADDIntMaxVectorTestsBroadcastLongSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2280,10 ---

*** 2218,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::LSHL);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void LSHLIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2332,10 ---

*** 2240,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHL);
      }
  
- 
- 
- 
- 
- 
      static int ASHR(int a, int b) {
          return (int)((a >> b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2352,10 ---

*** 2266,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::ASHR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ASHRIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2373,10 ---

*** 2288,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ASHR);
      }
  
- 
- 
- 
- 
- 
      static int LSHR(int a, int b) {
          return (int)((a >>> b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2393,10 ---

*** 2314,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::LSHR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void LSHRIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2414,10 ---

*** 2336,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHR);
      }
  
- 
- 
- 
- 
- 
      static int LSHL_unary(int a, int b) {
          return (int)((a << b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2434,10 ---

*** 2361,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, IntMaxVectorTests::LSHL_unary);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void LSHLIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2454,10 ---

*** 2382,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHL_unary);
      }
  
- 
- 
- 
- 
- 
      static int LSHR_unary(int a, int b) {
          return (int)((a >>> b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2473,10 ---

*** 2407,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, IntMaxVectorTests::LSHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void LSHRIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2493,10 ---

*** 2428,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::LSHR_unary);
      }
  
- 
- 
- 
- 
- 
      static int ASHR_unary(int a, int b) {
          return (int)((a >> b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2512,10 ---

*** 2453,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ASHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ASHRIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2532,10 ---

*** 2474,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ASHR_unary);
      }
  
- 
- 
- 
- 
- 
      static int ROR(int a, int b) {
          return (int)(ROR_scalar(a,b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2551,10 ---

*** 2500,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::ROR);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void RORIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2572,10 ---

*** 2522,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR);
      }
  
- 
      static int ROL(int a, int b) {
          return (int)(ROL_scalar(a,b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2592,10 ---

*** 2544,12 ***
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::ROL);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ROLIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2613,10 ---

*** 2566,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL);
      }
  
- 
      static int ROR_unary(int a, int b) {
          return (int)(ROR_scalar(a, b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2633,10 ---

*** 2587,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROR_unary);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void RORIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2653,10 ---

*** 2608,11 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROR_unary);
      }
  
- 
      static int ROL_unary(int a, int b) {
          return (int)(ROL_scalar(a, b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")
--- 2672,10 ---

*** 2629,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, IntMaxVectorTests::ROL_unary);
      }
  
- 
- 
      @Test(dataProvider = "intBinaryOpMaskProvider")
      static void ROLIntMaxVectorTestsScalarShiftMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 2692,10 ---

*** 2649,12 ***
              }
          }
  
          assertShiftArraysEquals(r, a, b, mask, IntMaxVectorTests::ROL_unary);
      }
- 
- 
      static int LSHR_binary_const(int a) {
          return (int)((a >>> CONST_SHIFT));
      }
  
      @Test(dataProvider = "intUnaryOpProvider")
--- 2710,10 ---

*** 2670,12 ***
          }
  
          assertShiftConstEquals(r, a, IntMaxVectorTests::LSHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void LSHRIntMaxVectorTestsScalarShiftMaskedConst(IntFunction<int[]> fa,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2729,10 ---

*** 2690,16 ***
          }
  
          assertShiftConstEquals(r, a, mask, IntMaxVectorTests::LSHR_binary_const);
      }
  
- 
- 
- 
- 
- 
- 
      static int LSHL_binary_const(int a) {
          return (int)((a << CONST_SHIFT));
      }
  
      @Test(dataProvider = "intUnaryOpProvider")
--- 2747,10 ---

*** 2715,12 ***
          }
  
          assertShiftConstEquals(r, a, IntMaxVectorTests::LSHL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void LSHLIntMaxVectorTestsScalarShiftMaskedConst(IntFunction<int[]> fa,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2766,10 ---

*** 2735,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, IntMaxVectorTests::LSHL_binary_const);
      }
  
- 
- 
      static int ASHR_binary_const(int a) {
          return (int)((a >> CONST_SHIFT));
      }
  
      @Test(dataProvider = "intUnaryOpProvider")
--- 2784,10 ---

*** 2756,12 ***
          }
  
          assertShiftConstEquals(r, a, IntMaxVectorTests::ASHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ASHRIntMaxVectorTestsScalarShiftMaskedConst(IntFunction<int[]> fa,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2803,10 ---

*** 2776,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, IntMaxVectorTests::ASHR_binary_const);
      }
  
- 
- 
      static int ROR_binary_const(int a) {
          return (int)(ROR_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "intUnaryOpProvider")
--- 2821,10 ---

*** 2797,12 ***
          }
  
          assertShiftConstEquals(r, a, IntMaxVectorTests::ROR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void RORIntMaxVectorTestsScalarShiftMaskedConst(IntFunction<int[]> fa,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2840,10 ---

*** 2817,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, IntMaxVectorTests::ROR_binary_const);
      }
  
- 
- 
      static int ROL_binary_const(int a) {
          return (int)(ROL_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "intUnaryOpProvider")
--- 2858,10 ---

*** 2838,12 ***
          }
  
          assertShiftConstEquals(r, a, IntMaxVectorTests::ROL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ROLIntMaxVectorTestsScalarShiftMaskedConst(IntFunction<int[]> fa,
                                            IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 2877,10 ---

*** 2879,10 ***
--- 2916,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::MIN);
      }
+ 
      static int min(int a, int b) {
          return (int)(Math.min(a, b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 2897,10 ***
--- 2935,11 ---
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::min);
      }
+ 
      static int MAX(int a, int b) {
          return (int)(Math.max(a, b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 2917,10 ***
--- 2956,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, IntMaxVectorTests::MAX);
      }
+ 
      static int max(int a, int b) {
          return (int)(Math.max(a, b));
      }
  
      @Test(dataProvider = "intBinaryOpProvider")

*** 3010,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void ANDReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = -1;
--- 3050,10 ---

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

*** 3056,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ANDReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3094,10 ---

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

*** 3103,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void ORReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = 0;
--- 3139,10 ---

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

*** 3149,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ORReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3183,10 ---

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

*** 3196,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void XORReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = 0;
--- 3228,10 ---

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

*** 3242,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void XORReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3272,10 ---

*** 3287,10 ***
--- 3316,11 ---
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void ADDReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = 0;

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

*** 3329,10 ***
--- 3360,11 ---
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ADDReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

*** 3372,10 ***
--- 3405,11 ---
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void MULReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = 1;

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

*** 3414,10 ***
--- 3449,11 ---
              res *= MULReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void MULReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

*** 3457,10 ***
--- 3494,11 ---
              res = (int) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void MINReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = Integer.MAX_VALUE;

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

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

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

*** 3542,10 ***
--- 3583,11 ---
              res = (int) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void MAXReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = Integer.MIN_VALUE;

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

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

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

*** 3627,10 ***
--- 3672,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void FIRST_NONZEROReduceIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          int ra = (int) 0;

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

*** 3669,10 ***
--- 3716,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

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

*** 3747,11 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, IntMaxVectorTests::allTrue);
      }
  
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void withIntMaxVectorTests(IntFunction<int []> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
  
--- 3792,10 ---

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

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

*** 3846,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void LTIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 3892,10 ---

*** 3868,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void ltIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 3911,10 ---

*** 3911,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void GTIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 3953,10 ---

*** 3954,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void EQIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 3995,10 ---

*** 3974,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void eqIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4014,10 ---

*** 4017,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void NEIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4056,10 ---

*** 4060,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void LEIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4098,10 ---

*** 4103,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void GEIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4140,10 ---

*** 4146,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void UNSIGNED_LTIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4182,10 ---

*** 4167,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpMaskProvider")
      static void UNSIGNED_LTIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 4201,10 ---

*** 4192,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void UNSIGNED_GTIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4224,10 ---

*** 4214,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpMaskProvider")
      static void UNSIGNED_GTIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 4243,10 ---

*** 4239,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void UNSIGNED_LEIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4266,10 ---

*** 4261,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpMaskProvider")
      static void UNSIGNED_LEIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 4285,10 ---

*** 4286,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void UNSIGNED_GEIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4308,10 ---

*** 4308,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpMaskProvider")
      static void UNSIGNED_GEIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 4327,10 ---

*** 4333,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "intCompareOpProvider")
      static void LTIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
  
--- 4350,10 ---

*** 4351,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "intCompareOpMaskProvider")
      static void LTIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<int[]> fa,
                                  IntFunction<int[]> fb, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 4366,10 ---

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

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

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

*** 4541,10 ***
--- 4552,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void compressIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void expandIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "intUnaryOpProvider")
      static void getIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
  

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

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

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

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

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

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

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

*** 4942,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, IntMaxVectorTests::unslice);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static int BITWISE_BLEND(int a, int b, int c) {
          return (int)((a&~(c))|(b&c));
      }
      static int bitwiseBlend(int a, int b, int c) {
          return (int)((a&~(c))|(b&c));
      }
  
- 
      @Test(dataProvider = "intTernaryOpProvider")
      static void BITWISE_BLENDIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());
--- 4988,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, IntMaxVectorTests::unslice);
      }
  
      static int BITWISE_BLEND(int a, int b, int c) {
          return (int)((a&~(c))|(b&c));
      }
+ 
      static int bitwiseBlend(int a, int b, int c) {
          return (int)((a&~(c))|(b&c));
      }
  
      @Test(dataProvider = "intTernaryOpProvider")
      static void BITWISE_BLENDIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());

*** 4990,10 ***
--- 5014,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "intTernaryOpProvider")
      static void bitwiseBlendIntMaxVectorTests(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());

*** 5007,11 ***
          }
  
          assertArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "intTernaryOpMaskProvider")
      static void BITWISE_BLENDIntMaxVectorTestsMasked(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<int[]> fc, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 5032,10 ---

*** 5030,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "intTernaryOpProvider")
      static void BITWISE_BLENDIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());
--- 5054,10 ---

*** 5062,10 ***
--- 5083,11 ---
              IntVector cv = IntVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "intTernaryOpProvider")
      static void bitwiseBlendIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());

*** 5092,11 ***
              av.bitwiseBlend(b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "intTernaryOpMaskProvider")
      static void BITWISE_BLENDIntMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<int[]> fc, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 5114,10 ---

*** 5131,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "intTernaryOpProvider")
      static void BITWISE_BLENDIntMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());
--- 5152,10 ---

*** 5148,10 ***
--- 5166,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "intTernaryOpProvider")
      static void bitwiseBlendIntMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb, IntFunction<int[]> fc) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
          int[] c = fc.apply(SPECIES.length());

*** 5163,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, IntMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "intTernaryOpMaskProvider")
      static void BITWISE_BLENDIntMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb,
                                            IntFunction<int[]> fc, IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());
--- 5182,10 ---

*** 5182,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, IntMaxVectorTests::BITWISE_BLEND);
      }
  
- 
      static int NEG(int a) {
          return (int)(-((int)a));
      }
  
      static int neg(int a) {
--- 5200,10 ---

*** 5295,21 ***
          }
  
          assertArraysEquals(r, a, mask, IntMaxVectorTests::ABS);
      }
  
- 
      static int NOT(int a) {
          return (int)(~((int)a));
      }
  
      static int not(int a) {
          return (int)(~((int)a));
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void NOTIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
  
--- 5312,18 ---

*** 5336,12 ***
          }
  
          assertArraysEquals(r, a, IntMaxVectorTests::not);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void NOTMaskedIntMaxVectorTests(IntFunction<int[]> fa,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 5350,10 ---

*** 5356,18 ***
          }
  
          assertArraysEquals(r, a, mask, IntMaxVectorTests::NOT);
      }
  
- 
- 
      static int ZOMO(int a) {
          return (int)((a==0?0:-1));
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpProvider")
      static void ZOMOIntMaxVectorTests(IntFunction<int[]> fa) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
  
--- 5368,14 ---

*** 5379,12 ***
          }
  
          assertArraysEquals(r, a, IntMaxVectorTests::ZOMO);
      }
  
- 
- 
      @Test(dataProvider = "intUnaryOpMaskProvider")
      static void ZOMOMaskedIntMaxVectorTests(IntFunction<int[]> fa,
                                                  IntFunction<boolean[]> fm) {
          int[] a = fa.apply(SPECIES.length());
          int[] r = fr.apply(SPECIES.length());
--- 5387,10 ---

*** 5399,13 ***
--- 5405,194 ---
          }
  
          assertArraysEquals(r, a, mask, IntMaxVectorTests::ZOMO);
      }
  
+     static int BIT_COUNT(int a) {
+         return (int)(Integer.bitCount(a));
+     }
  
+     @Test(dataProvider = "intUnaryOpProvider")
+     static void BIT_COUNTIntMaxVectorTests(IntFunction<int[]> fa) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
  
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, IntMaxVectorTests::BIT_COUNT);
+     }
  
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, IntMaxVectorTests::BIT_COUNT);
+     }
+ 
+     static int TRAILING_ZEROS_COUNT(int a) {
+         return (int)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "intUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTIntMaxVectorTests(IntFunction<int[]> fa) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, IntMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, IntMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static int LEADING_ZEROS_COUNT(int a) {
+         return (int)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "intUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTIntMaxVectorTests(IntFunction<int[]> fa) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, IntMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, IntMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static int REVERSE(int a) {
+         return (int)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "intUnaryOpProvider")
+     static void REVERSEIntMaxVectorTests(IntFunction<int[]> fa) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, IntMaxVectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void REVERSEMaskedIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, IntMaxVectorTests::REVERSE);
+     }
+ 
+     static int REVERSE_BYTES(int a) {
+         return (int)(Integer.reverseBytes(a));
+     }
+ 
+     @Test(dataProvider = "intUnaryOpProvider")
+     static void REVERSE_BYTESIntMaxVectorTests(IntFunction<int[]> fa) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, IntMaxVectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "intUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedIntMaxVectorTests(IntFunction<int[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         int[] a = fa.apply(SPECIES.length());
+         int[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Integer> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 IntVector av = IntVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, IntMaxVectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "intCompareOpProvider")
      static void ltIntMaxVectorTestsBroadcastSmokeTest(IntFunction<int[]> fa, IntFunction<int[]> fb) {
          int[] a = fa.apply(SPECIES.length());
          int[] b = fb.apply(SPECIES.length());

*** 5804,10 ***
--- 5991,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, IntMaxVectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressIntMaxVectorTestsSmokeTest(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},

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

*** 5850,10 ***
--- 6068,18 ---
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongIntMaxVectorTestsSmokeTest(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 ElementSizeIntMaxVectorTestsSmokeTest() {
          IntVector av = IntVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Integer.SIZE);

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