< prev index next >

test/jdk/jdk/incubator/vector/Byte512VectorTests.java

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

*** 892,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(
--- 941,10 ---

*** 987,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);
--- 1035,10 ---

*** 1064,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);
              }),
--- 1110,10 ---

*** 1205,10 ***
--- 1250,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) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 3066,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::ANDReduce, Byte512VectorTests::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];
--- 3026,10 ---

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

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

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

*** 3159,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::ORReduce, Byte512VectorTests::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];
--- 3115,10 ---

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

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

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

*** 3252,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::XORReduce, Byte512VectorTests::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];
--- 3204,10 ---

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

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

*** 3341,10 ***
--- 3292,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::ADDReduce, Byte512VectorTests::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];

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

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

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

*** 3426,10 ***
--- 3381,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::MULReduce, Byte512VectorTests::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];

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

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

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

*** 3511,10 ***
--- 3470,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::MINReduce, Byte512VectorTests::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]);

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

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

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

*** 3596,10 ***
--- 3559,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::MAXReduce, Byte512VectorTests::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]);

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

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

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

*** 3681,10 ***
--- 3648,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  Byte512VectorTests::FIRST_NONZEROReduce, Byte512VectorTests::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]);

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

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

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

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

*** 3795,10 ***
--- 3760,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")

*** 3835,10 ***
--- 3801,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")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 4571,10 ***
--- 4503,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void compressByte512VectorTests(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 expandByte512VectorTests(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 getByte512VectorTests(IntFunction<byte[]> fa) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] r = fr.apply(SPECIES.length());
  

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

*** 4759,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];
--- 4724,10 ---

*** 4787,10 ***
--- 4749,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, Byte512VectorTests::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];

*** 4816,10 ***
--- 4779,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, Byte512VectorTests::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;

*** 4849,10 ***
--- 4813,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, mask, Byte512VectorTests::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;

*** 4876,10 ***
--- 4841,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, Byte512VectorTests::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)

*** 4915,10 ***
--- 4881,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, part, Byte512VectorTests::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];

*** 4972,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Byte512VectorTests::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_BLENDByte512VectorTests(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());
--- 4939,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Byte512VectorTests::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_BLENDByte512VectorTests(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());

*** 5020,10 ***
--- 4965,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByte512VectorTests(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());

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

*** 5060,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByte512VectorTestsBroadcastSmokeTest(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());
--- 5005,10 ---

*** 5092,10 ***
--- 5034,11 ---
              ByteVector cv = ByteVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByte512VectorTestsBroadcastSmokeTest(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());

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

*** 5161,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void BITWISE_BLENDByte512VectorTestsDoubleBroadcastSmokeTest(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());
--- 5103,10 ---

*** 5178,10 ***
--- 5117,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Byte512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "byteTernaryOpProvider")
      static void bitwiseBlendByte512VectorTestsDoubleBroadcastSmokeTest(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());

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

*** 5212,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Byte512VectorTests::BITWISE_BLEND);
      }
  
- 
      static byte NEG(byte a) {
          return (byte)(-((byte)a));
      }
  
      static byte neg(byte a) {
--- 5151,10 ---

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

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

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

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

*** 5429,13 ***
--- 5356,194 ---
          }
  
          assertArraysEquals(r, a, mask, Byte512VectorTests::ZOMO);
      }
  
+     static byte BIT_COUNT(byte a) {
+         return (byte)(Integer.bitCount((int)a & 0xFF));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void BIT_COUNTByte512VectorTests(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, Byte512VectorTests::BIT_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedByte512VectorTests(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, Byte512VectorTests::BIT_COUNT);
+     }
+ 
+     static byte TRAILING_ZEROS_COUNT(byte a) {
+         return (byte)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTByte512VectorTests(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, Byte512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedByte512VectorTests(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, Byte512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static byte LEADING_ZEROS_COUNT(byte a) {
+         return (byte)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTByte512VectorTests(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, Byte512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedByte512VectorTests(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, Byte512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static byte REVERSE(byte a) {
+         return (byte)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void REVERSEByte512VectorTests(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, Byte512VectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void REVERSEMaskedByte512VectorTests(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, Byte512VectorTests::REVERSE);
+     }
+ 
+     static byte REVERSE_BYTES(byte a) {
+         return (byte)(a);
+     }
  
+     @Test(dataProvider = "byteUnaryOpProvider")
+     static void REVERSE_BYTESByte512VectorTests(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, Byte512VectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "byteUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedByte512VectorTests(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, Byte512VectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "byteCompareOpProvider")
      static void ltByte512VectorTestsBroadcastSmokeTest(IntFunction<byte[]> fa, IntFunction<byte[]> fb) {
          byte[] a = fa.apply(SPECIES.length());
          byte[] b = fb.apply(SPECIES.length());

*** 5845,10 ***
--- 5953,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, Byte512VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressByte512VectorTestsSmokeTest(IntFunction<boolean[]> fa) {
+         int trueCount = 0;
+         boolean[] a = fa.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT * INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 var vmask = SPECIES.loadMask(a, i);
+                 trueCount = vmask.trueCount();
+                 var rmask = vmask.compress();
+                 for (int j = 0; j < SPECIES.length(); j++)  {
+                     Assert.assertEquals(rmask.laneIsSet(j), j < trueCount);
+                 }
+             }
+         }
+     }
+ 
      @DataProvider
      public static Object[][] longMaskProvider() {
          return new Object[][]{
                  {0xFFFFFFFFFFFFFFFFL},
                  {0x0000000000000000L},

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

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

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