< prev index next >

test/jdk/jdk/incubator/vector/ByteMaxVectorTests.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(byte[] r, byte[] 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], (byte)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], (byte)0, "at index #" + idx);
+             }
+         }
+     }
+ 
+     static void assertexpandArraysEquals(byte[] r, byte[] 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], (byte)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], (byte)0, "at index #" + idx);
+             }
+         }
+     }
+ 
      static void assertSelectFromArraysEquals(byte[] r, byte[] a, byte[] order, int vector_len) {
          int i = 0, j = 0;
          try {
              for (; i < a.length; i += vector_len) {
                  for (j = 0; j < vector_len; j++) {

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

*** 992,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);
--- 1040,10 ---

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

*** 1210,10 ***
--- 1255,25 ---
  
      static byte ROR_scalar(byte a, byte b) {
          return (byte)(((((byte)a) & 0xFF) >>> (b & 7)) | ((((byte)a) & 0xFF) << (8 - (b & 7))));
      }
  
+     static byte TRAILING_ZEROS_COUNT_scalar(byte a) {
+         return (byte) (a != 0 ? Integer.numberOfTrailingZeros(a) : 8);
+     }
+ 
+     static byte LEADING_ZEROS_COUNT_scalar(byte a) {
+         return (byte) (a >= 0 ? Integer.numberOfLeadingZeros(a) - 24 : 0);
+     }
+ 
+     static byte REVERSE_scalar(byte a) {
+         byte b = (byte) ROL_scalar(a, (byte) 4);
+         b = (byte) (((b & 0x55) << 1) | ((b & 0xAA) >>> 1));
+         b = (byte) (((b & 0x33) << 2) | ((b & 0xCC) >>> 2));
+         return b;
+     }
+ 
      static boolean eq(byte a, byte b) {
          return a == b;
      }
  
      static boolean neq(byte a, byte b) {

*** 1359,10 ***
--- 1419,11 ---
              a.div(b, m);
              Assert.fail();
          } catch (ArithmeticException e) {
          }
      }
+ 
      static byte ADD(byte a, byte b) {
          return (byte)(a + b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1379,10 ***
--- 1440,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::ADD);
      }
+ 
      static byte add(byte a, byte b) {
          return (byte)(a + b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1435,10 ***
--- 1497,11 ---
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::add);
      }
+ 
      static byte SUB(byte a, byte b) {
          return (byte)(a - b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1455,10 ***
--- 1518,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::SUB);
      }
+ 
      static byte sub(byte a, byte b) {
          return (byte)(a - b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1511,10 ***
--- 1575,11 ---
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::sub);
      }
+ 
      static byte MUL(byte a, byte b) {
          return (byte)(a * b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1531,10 ***
--- 1596,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::MUL);
      }
+ 
      static byte mul(byte a, byte b) {
          return (byte)(a * b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1588,12 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::mul);
      }
  
- 
- 
      static byte DIV(byte a, byte b) {
          return (byte)(a / b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 1654,10 ---

*** 1612,10 ***
--- 1676,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::DIV);
      }
+ 
      static byte div(byte a, byte b) {
          return (byte)(a / b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1635,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void DIVByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 1700,10 ---

*** 1742,10 ***
--- 1805,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::AND);
      }
+ 
      static byte and(byte a, byte b) {
          return (byte)(a & b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1761,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ANDByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 1825,10 ---

*** 1783,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND);
      }
  
- 
      static byte AND_NOT(byte a, byte b) {
          return (byte)(a & ~b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 1845,10 ---

*** 1805,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::AND_NOT);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void AND_NOTByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 1866,10 ---

*** 1827,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND_NOT);
      }
  
- 
      static byte OR(byte a, byte b) {
          return (byte)(a | b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 1886,10 ---

*** 1848,10 ***
--- 1906,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::OR);
      }
+ 
      static byte or(byte a, byte b) {
          return (byte)(a | b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 1867,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ORByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 1926,10 ---

*** 1889,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR);
      }
  
- 
      static byte XOR(byte a, byte b) {
          return (byte)(a ^ b);
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 1946,10 ---

*** 1911,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::XOR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void XORByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 1967,10 ---

*** 1933,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::XOR);
      }
  
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void addByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 1987,10 ---

*** 2027,13 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::mul);
      }
  
- 
- 
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void divByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2080,10 ---

*** 2046,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void divByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2096,10 ---

*** 2067,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void ORByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2115,10 ---

*** 2097,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ORByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2143,10 ---

*** 2116,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void ANDByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2160,10 ---

*** 2146,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, ByteMaxVectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ANDByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2188,10 ---

*** 2165,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, ByteMaxVectorTests::AND);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void ORByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2205,10 ---

*** 2181,12 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, ByteMaxVectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ORByteMaxVectorTestsBroadcastMaskedLongSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2219,10 ---

*** 2200,11 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, ByteMaxVectorTests::OR);
      }
  
- 
      @Test(dataProvider = "byteBinaryOpProvider")
      static void ADDByteMaxVectorTestsBroadcastLongSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2236,10 ---

*** 2232,12 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, ByteMaxVectorTests::ADD);
      }
  
- 
- 
      static byte LSHL(byte a, byte b) {
          return (byte)((a << (b & 0x7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2267,10 ---

*** 2255,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::LSHL);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void LSHLByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2288,10 ---

*** 2277,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHL);
      }
  
- 
- 
- 
- 
- 
      static byte ASHR(byte a, byte b) {
          return (byte)((a >> (b & 0x7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2308,10 ---

*** 2303,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::ASHR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ASHRByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2329,10 ---

*** 2325,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ASHR);
      }
  
- 
- 
- 
- 
- 
      static byte LSHR(byte a, byte b) {
          return (byte)(((a & 0xFF) >>> (b & 0x7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2349,10 ---

*** 2351,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::LSHR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void LSHRByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2370,10 ---

*** 2373,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHR);
      }
  
- 
- 
- 
- 
- 
      static byte LSHL_unary(byte a, byte b) {
          return (byte)((a << (b & 7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2390,10 ---

*** 2398,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::LSHL_unary);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void LSHLByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2410,10 ---

*** 2419,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHL_unary);
      }
  
- 
- 
- 
- 
- 
      static byte LSHR_unary(byte a, byte b) {
          return (byte)(((a & 0xFF) >>> (b & 7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2429,10 ---

*** 2444,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::LSHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void LSHRByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2449,10 ---

*** 2465,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::LSHR_unary);
      }
  
- 
- 
- 
- 
- 
      static byte ASHR_unary(byte a, byte b) {
          return (byte)((a >> (b & 7)));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2468,10 ---

*** 2490,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ASHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ASHRByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2488,10 ---

*** 2511,13 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ASHR_unary);
      }
  
- 
- 
- 
      static byte ROR(byte a, byte b) {
          return (byte)(ROR_scalar(a,b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2507,10 ---

*** 2535,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::ROR);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void RORByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2528,10 ---

*** 2557,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR);
      }
  
- 
      static byte ROL(byte a, byte b) {
          return (byte)(ROL_scalar(a,b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2548,10 ---

*** 2579,12 ***
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::ROL);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ROLByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2569,10 ---

*** 2601,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL);
      }
  
- 
      static byte ROR_unary(byte a, byte b) {
          return (byte)(ROR_scalar(a, b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2589,10 ---

*** 2622,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROR_unary);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void RORByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2609,10 ---

*** 2643,11 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROR_unary);
      }
  
- 
      static byte ROL_unary(byte a, byte b) {
          return (byte)(ROL_scalar(a, b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")
--- 2628,10 ---

*** 2664,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, ByteMaxVectorTests::ROL_unary);
      }
  
- 
- 
      @Test(dataProvider = "byteBinaryOpMaskProvider")
      static void ROLByteMaxVectorTestsScalarShiftMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 2648,10 ---

*** 2684,14 ***
              }
          }
  
          assertShiftArraysEquals(r, a, b, mask, ByteMaxVectorTests::ROL_unary);
      }
- 
- 
- 
- 
      static byte LSHR_binary_const(byte a) {
          return (byte)(((a & 0xFF) >>> CONST_SHIFT));
      }
  
      @Test(dataProvider = "byteUnaryOpProvider")
--- 2666,10 ---

*** 2707,12 ***
          }
  
          assertShiftConstEquals(r, a, ByteMaxVectorTests::LSHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void LSHRByteMaxVectorTestsScalarShiftMaskedConst(IntFunction<byte[]> fa,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2685,10 ---

*** 2727,14 ***
          }
  
          assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::LSHR_binary_const);
      }
  
- 
- 
- 
- 
      static byte LSHL_binary_const(byte a) {
          return (byte)((a << CONST_SHIFT));
      }
  
      @Test(dataProvider = "byteUnaryOpProvider")
--- 2703,10 ---

*** 2750,12 ***
          }
  
          assertShiftConstEquals(r, a, ByteMaxVectorTests::LSHL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void LSHLByteMaxVectorTestsScalarShiftMaskedConst(IntFunction<byte[]> fa,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2722,10 ---

*** 2770,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::LSHL_binary_const);
      }
  
- 
- 
      static byte ASHR_binary_const(byte a) {
          return (byte)((a >> CONST_SHIFT));
      }
  
      @Test(dataProvider = "byteUnaryOpProvider")
--- 2740,10 ---

*** 2791,12 ***
          }
  
          assertShiftConstEquals(r, a, ByteMaxVectorTests::ASHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ASHRByteMaxVectorTestsScalarShiftMaskedConst(IntFunction<byte[]> fa,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2759,10 ---

*** 2811,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::ASHR_binary_const);
      }
  
- 
- 
      static byte ROR_binary_const(byte a) {
          return (byte)(ROR_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "byteUnaryOpProvider")
--- 2777,10 ---

*** 2832,12 ***
          }
  
          assertShiftConstEquals(r, a, ByteMaxVectorTests::ROR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void RORByteMaxVectorTestsScalarShiftMaskedConst(IntFunction<byte[]> fa,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2796,10 ---

*** 2852,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, ByteMaxVectorTests::ROR_binary_const);
      }
  
- 
- 
      static byte ROL_binary_const(byte a) {
          return (byte)(ROL_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "byteUnaryOpProvider")
--- 2814,10 ---

*** 2873,12 ***
          }
  
          assertShiftConstEquals(r, a, ByteMaxVectorTests::ROL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ROLByteMaxVectorTestsScalarShiftMaskedConst(IntFunction<byte[]> fa,
                                            IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 2833,10 ---

*** 2914,10 ***
--- 2872,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::MIN);
      }
+ 
      static byte min(byte a, byte b) {
          return (byte)(Math.min(a, b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 2932,10 ***
--- 2891,11 ---
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::min);
      }
+ 
      static byte MAX(byte a, byte b) {
          return (byte)(Math.max(a, b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 2952,10 ***
--- 2912,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, ByteMaxVectorTests::MAX);
      }
+ 
      static byte max(byte a, byte b) {
          return (byte)(Math.max(a, b));
      }
  
      @Test(dataProvider = "byteBinaryOpProvider")

*** 3045,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void ANDReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = -1;
--- 3006,10 ---

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

*** 3091,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ANDReduceByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3050,10 ---

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

*** 3138,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void ORReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = 0;
--- 3095,10 ---

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

*** 3184,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ORReduceByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3139,10 ---

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

*** 3231,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void XORReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = 0;
--- 3184,10 ---

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

*** 3277,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void XORReduceByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3228,10 ---

*** 3322,10 ***
--- 3272,11 ---
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void ADDReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = 0;

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

*** 3364,10 ***
--- 3316,11 ---
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ADDReduceByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

*** 3407,10 ***
--- 3361,11 ---
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void MULReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = 1;

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

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

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

*** 3492,10 ***
--- 3450,11 ---
              res = (byte) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void MINReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = Byte.MAX_VALUE;

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

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

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

*** 3577,10 ***
--- 3539,11 ---
              res = (byte) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void MAXReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = Byte.MIN_VALUE;

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

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

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

*** 3662,10 ***
--- 3628,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void FIRST_NONZEROReduceByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          byte ra = (byte) 0;

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

*** 3704,10 ***
--- 3672,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

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

*** 3782,11 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, ByteMaxVectorTests::allTrue);
      }
  
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void withByteMaxVectorTests(IntFunction<byte []> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
  
--- 3748,10 ---

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

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

*** 3881,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void LTByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 3848,10 ---

*** 3903,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void ltByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 3867,10 ---

*** 3946,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void GTByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 3909,10 ---

*** 3989,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void EQByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 3951,10 ---

*** 4009,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void eqByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 3970,10 ---

*** 4052,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void NEByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4012,10 ---

*** 4095,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void LEByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4054,10 ---

*** 4138,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void GEByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4096,10 ---

*** 4181,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void UNSIGNED_LTByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4138,10 ---

*** 4202,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "byteCompareOpMaskProvider")
      static void UNSIGNED_LTByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                                  IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4157,10 ---

*** 4227,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void UNSIGNED_GTByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4180,10 ---

*** 4249,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "byteCompareOpMaskProvider")
      static void UNSIGNED_GTByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                                  IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4199,10 ---

*** 4274,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void UNSIGNED_LEByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4222,10 ---

*** 4296,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "byteCompareOpMaskProvider")
      static void UNSIGNED_LEByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                                  IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4241,10 ---

*** 4321,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void UNSIGNED_GEByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4264,10 ---

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

*** 4368,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "byteCompareOpProvider")
      static void LTByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
  
--- 4306,10 ---

*** 4386,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpMaskProvider")
      static void LTByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa,
                                  IntFunction<byte[]> fb, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4322,10 ---

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

*** 4460,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "byteCompareOpMaskProvider")
      static void EQByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa,
                                  IntFunction<byte[]> fb, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4394,10 ---

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

*** 4576,10 ***
--- 4508,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void compressByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void expandByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void getByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
  

*** 4746,14 ***
          }
  
          assertBroadcastArraysEquals(r, a);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void ZeroByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = new byte[a.length];
  
--- 4715,10 ---

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

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

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

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

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

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

*** 4977,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, ByteMaxVectorTests::unslice);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static byte BITWISE_BLEND(byte a, byte b, byte c) {
          return (byte)((a&~(c))|(b&c));
      }
      static byte bitwiseBlend(byte a, byte b, byte c) {
          return (byte)((a&~(c))|(b&c));
      }
  
- 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());
--- 4944,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, ByteMaxVectorTests::unslice);
      }
  
      static byte BITWISE_BLEND(byte a, byte b, byte c) {
          return (byte)((a&~(c))|(b&c));
      }
+ 
      static byte bitwiseBlend(byte a, byte b, byte c) {
          return (byte)((a&~(c))|(b&c));
      }
  
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());

*** 5025,10 ***
--- 4970,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByteMaxVectorTests(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());

*** 5042,11 ***
          }
  
          assertArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "byteTernaryOpMaskProvider")
      static void BITWISE_BLENDByteMaxVectorTestsMasked(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<byte[]> fc, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 4988,10 ---

*** 5065,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());
--- 5010,10 ---

*** 5097,10 ***
--- 5039,11 ---
              ByteVector cv = ByteVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());

*** 5127,11 ***
              av.bitwiseBlend(b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "byteTernaryOpMaskProvider")
      static void BITWISE_BLENDByteMaxVectorTestsBroadcastMaskedSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<byte[]> fc, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 5070,10 ---

*** 5166,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByteMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());
--- 5108,10 ---

*** 5183,10 ***
--- 5122,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByteMaxVectorTestsDoubleBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb, IntFunction<byte[]> fc) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
          byte[] c = fc.apply(SPECIES.length());

*** 5198,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, ByteMaxVectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "byteTernaryOpMaskProvider")
      static void BITWISE_BLENDByteMaxVectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb,
                                            IntFunction<byte[]> fc, IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());
--- 5138,10 ---

*** 5217,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ByteMaxVectorTests::BITWISE_BLEND);
      }
  
- 
      static byte NEG(byte a) {
          return (byte)(-((byte)a));
      }
  
      static byte neg(byte a) {
--- 5156,10 ---

*** 5330,21 ***
          }
  
          assertArraysEquals(r, a, mask, ByteMaxVectorTests::ABS);
      }
  
- 
      static byte NOT(byte a) {
          return (byte)(~((byte)a));
      }
  
      static byte not(byte a) {
          return (byte)(~((byte)a));
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void NOTByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
  
--- 5268,18 ---

*** 5371,12 ***
          }
  
          assertArraysEquals(r, a, ByteMaxVectorTests::not);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void NOTMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
                                                  IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 5306,10 ---

*** 5391,18 ***
          }
  
          assertArraysEquals(r, a, mask, ByteMaxVectorTests::NOT);
      }
  
- 
- 
      static byte ZOMO(byte a) {
          return (byte)((a==0?0:-1));
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpProvider")
      static void ZOMOByteMaxVectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
  
--- 5324,14 ---

*** 5414,12 ***
          }
  
          assertArraysEquals(r, a, ByteMaxVectorTests::ZOMO);
      }
  
- 
- 
      @Test(dataProvider = "byteUnaryOpMaskProvider")
      static void ZOMOMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
                                                  IntFunction<boolean[]> fm) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
--- 5343,10 ---

*** 5434,13 ***
--- 5361,194 ---
          }
  
          assertArraysEquals(r, a, mask, ByteMaxVectorTests::ZOMO);
      }
  
+     static byte BIT_COUNT(byte a) {
+         return (byte)(Integer.bitCount((int)a & 0xFF));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void BIT_COUNTByteMaxVectorTests(IntFunction<byte[]> fa) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, ByteMaxVectorTests::BIT_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, ByteMaxVectorTests::BIT_COUNT);
+     }
+ 
+     static byte TRAILING_ZEROS_COUNT(byte a) {
+         return (byte)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTByteMaxVectorTests(IntFunction<byte[]> fa) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, ByteMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, ByteMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static byte LEADING_ZEROS_COUNT(byte a) {
+         return (byte)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTByteMaxVectorTests(IntFunction<byte[]> fa) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, ByteMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, ByteMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static byte REVERSE(byte a) {
+         return (byte)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void REVERSEByteMaxVectorTests(IntFunction<byte[]> fa) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, ByteMaxVectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void REVERSEMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, ByteMaxVectorTests::REVERSE);
+     }
+ 
+     static byte REVERSE_BYTES(byte a) {
+         return (byte)(a);
+     }
  
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void REVERSE_BYTESByteMaxVectorTests(IntFunction<byte[]> fa) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
  
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES).intoArray(r, i);
+             }
+         }
  
+         assertArraysEquals(r, a, ByteMaxVectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedByteMaxVectorTests(IntFunction<byte[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         byte[] a = fa.apply(SPECIES.length());
+         byte[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Byte> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ByteVector av = ByteVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, ByteMaxVectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "byteCompareOpProvider")
      static void ltByteMaxVectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());

*** 5850,10 ***
--- 5958,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, ByteMaxVectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressByteMaxVectorTestsSmokeTest(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},

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

*** 5896,10 ***
--- 6035,18 ---
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongByteMaxVectorTestsSmokeTest(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 ElementSizeByteMaxVectorTestsSmokeTest() {
          ByteVector av = ByteVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Byte.SIZE);

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