< prev index next >

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

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

*** 977,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);
--- 1025,10 ---

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

*** 1195,10 ***
--- 1240,26 ---
  
      static short ROR_scalar(short a, short b) {
          return (short)(((((short)a) & 0xFFFF) >>> (b & 15)) | ((((short)a) & 0xFFFF) << (16 - (b & 15))));
      }
  
+     static short TRAILING_ZEROS_COUNT_scalar(short a) {
+         return (short) (a != 0 ? Integer.numberOfTrailingZeros(a) : 16);
+     }
+ 
+     static short LEADING_ZEROS_COUNT_scalar(short a) {
+         return (short) (a >= 0 ? Integer.numberOfLeadingZeros(a) - 16 : 0);
+     }
+ 
+     static short REVERSE_scalar(short a) {
+         short b = ROL_scalar(a, (short) 8);
+         b = (short) (((b & 0x5555) << 1) | ((b & 0xAAAA) >>> 1));
+         b = (short) (((b & 0x3333) << 2) | ((b & 0xCCCC) >>> 2));
+         b = (short) (((b & 0x0F0F) << 4) | ((b & 0xF0F0) >>> 4));
+         return b;
+     }
+ 
      static boolean eq(short a, short b) {
          return a == b;
      }
  
      static boolean neq(short a, short b) {

*** 1344,10 ***
--- 1405,11 ---
              a.div(b, m);
              Assert.fail();
          } catch (ArithmeticException e) {
          }
      }
+ 
      static short ADD(short a, short b) {
          return (short)(a + b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1364,10 ***
--- 1426,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::ADD);
      }
+ 
      static short add(short a, short b) {
          return (short)(a + b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1420,10 ***
--- 1483,11 ---
              av.add(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::add);
      }
+ 
      static short SUB(short a, short b) {
          return (short)(a - b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1440,10 ***
--- 1504,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::SUB);
      }
+ 
      static short sub(short a, short b) {
          return (short)(a - b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1496,10 ***
--- 1561,11 ---
              av.sub(bv, vmask).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::sub);
      }
+ 
      static short MUL(short a, short b) {
          return (short)(a * b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1516,10 ***
--- 1582,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::MUL);
      }
+ 
      static short mul(short a, short b) {
          return (short)(a * b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1573,12 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::mul);
      }
  
- 
- 
      static short DIV(short a, short b) {
          return (short)(a / b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 1640,10 ---

*** 1597,10 ***
--- 1662,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::DIV);
      }
+ 
      static short div(short a, short b) {
          return (short)(a / b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1620,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void DIVShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 1686,10 ---

*** 1727,10 ***
--- 1791,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::AND);
      }
+ 
      static short and(short a, short b) {
          return (short)(a & b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1746,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ANDShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 1811,10 ---

*** 1768,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::AND);
      }
  
- 
      static short AND_NOT(short a, short b) {
          return (short)(a & ~b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 1831,10 ---

*** 1790,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::AND_NOT);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void AND_NOTShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 1852,10 ---

*** 1812,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::AND_NOT);
      }
  
- 
      static short OR(short a, short b) {
          return (short)(a | b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 1872,10 ---

*** 1833,10 ***
--- 1892,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::OR);
      }
+ 
      static short or(short a, short b) {
          return (short)(a | b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 1852,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ORShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 1912,10 ---

*** 1874,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::OR);
      }
  
- 
      static short XOR(short a, short b) {
          return (short)(a ^ b);
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 1932,10 ---

*** 1896,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::XOR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void XORShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 1953,10 ---

*** 1918,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::XOR);
      }
  
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void addShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 1973,10 ---

*** 2012,13 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::mul);
      }
  
- 
- 
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void divShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2066,10 ---

*** 2031,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Short512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void divShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2082,10 ---

*** 2052,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::div);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void ORShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2101,10 ---

*** 2082,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Short512VectorTests::or);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ORShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2129,10 ---

*** 2101,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void ANDShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2146,10 ---

*** 2131,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, Short512VectorTests::and);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ANDShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2174,10 ---

*** 2150,12 ***
          }
  
          assertBroadcastArraysEquals(r, a, b, mask, Short512VectorTests::AND);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void ORShort512VectorTestsBroadcastLongSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2191,10 ---

*** 2166,12 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, Short512VectorTests::OR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ORShort512VectorTestsBroadcastMaskedLongSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2205,10 ---

*** 2185,11 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Short512VectorTests::OR);
      }
  
- 
      @Test(dataProvider = "shortBinaryOpProvider")
      static void ADDShort512VectorTestsBroadcastLongSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2222,10 ---

*** 2217,14 ***
          }
  
          assertBroadcastLongArraysEquals(r, a, b, mask, Short512VectorTests::ADD);
      }
  
- 
- 
- 
- 
      static short LSHL(short a, short b) {
          return (short)((a << (b & 0xF)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2253,10 ---

*** 2242,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::LSHL);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void LSHLShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2274,10 ---

*** 2264,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::LSHL);
      }
  
- 
- 
- 
- 
- 
      static short ASHR(short a, short b) {
          return (short)((a >> (b & 0xF)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2294,10 ---

*** 2290,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::ASHR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ASHRShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2315,10 ---

*** 2312,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::ASHR);
      }
  
- 
- 
- 
- 
- 
      static short LSHR(short a, short b) {
          return (short)(((a & 0xFFFF) >>> (b & 0xF)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2335,10 ---

*** 2338,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::LSHR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void LSHRShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2356,10 ---

*** 2360,15 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::LSHR);
      }
  
- 
- 
- 
- 
- 
      static short LSHL_unary(short a, short b) {
          return (short)((a << (b & 15)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2376,10 ---

*** 2385,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Short512VectorTests::LSHL_unary);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void LSHLShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2396,10 ---

*** 2406,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::LSHL_unary);
      }
  
- 
- 
- 
- 
- 
      static short LSHR_unary(short a, short b) {
          return (short)(((a & 0xFFFF) >>> (b & 15)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2415,10 ---

*** 2431,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Short512VectorTests::LSHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void LSHRShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2435,10 ---

*** 2452,15 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::LSHR_unary);
      }
  
- 
- 
- 
- 
- 
      static short ASHR_unary(short a, short b) {
          return (short)((a >> (b & 15)));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2454,10 ---

*** 2477,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Short512VectorTests::ASHR_unary);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ASHRShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2474,10 ---

*** 2498,11 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ASHR_unary);
      }
  
- 
      static short ROR(short a, short b) {
          return (short)(ROR_scalar(a,b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2493,10 ---

*** 2520,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::ROR);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void RORShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2514,10 ---

*** 2542,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::ROR);
      }
  
- 
      static short ROL(short a, short b) {
          return (short)(ROL_scalar(a,b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2534,10 ---

*** 2564,12 ***
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::ROL);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ROLShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2555,10 ---

*** 2586,11 ***
          }
  
          assertArraysEquals(r, a, b, mask, Short512VectorTests::ROL);
      }
  
- 
      static short ROR_unary(short a, short b) {
          return (short)(ROR_scalar(a, b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2575,10 ---

*** 2607,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Short512VectorTests::ROR_unary);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void RORShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2595,10 ---

*** 2628,11 ***
          }
  
          assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROR_unary);
      }
  
- 
      static short ROL_unary(short a, short b) {
          return (short)(ROL_scalar(a, b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")
--- 2614,10 ---

*** 2649,12 ***
          }
  
          assertShiftArraysEquals(r, a, b, Short512VectorTests::ROL_unary);
      }
  
- 
- 
      @Test(dataProvider = "shortBinaryOpMaskProvider")
      static void ROLShort512VectorTestsScalarShiftMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 2634,10 ---

*** 2669,16 ***
              }
          }
  
          assertShiftArraysEquals(r, a, b, mask, Short512VectorTests::ROL_unary);
      }
- 
- 
- 
- 
- 
- 
      static short LSHR_binary_const(short a) {
          return (short)(((a & 0xFFFF) >>> CONST_SHIFT));
      }
  
      @Test(dataProvider = "shortUnaryOpProvider")
--- 2652,10 ---

*** 2694,12 ***
          }
  
          assertShiftConstEquals(r, a, Short512VectorTests::LSHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void LSHRShort512VectorTestsScalarShiftMaskedConst(IntFunction<short[]> fa,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2671,10 ---

*** 2714,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Short512VectorTests::LSHR_binary_const);
      }
  
- 
- 
      static short LSHL_binary_const(short a) {
          return (short)((a << CONST_SHIFT));
      }
  
      @Test(dataProvider = "shortUnaryOpProvider")
--- 2689,10 ---

*** 2735,12 ***
          }
  
          assertShiftConstEquals(r, a, Short512VectorTests::LSHL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void LSHLShort512VectorTestsScalarShiftMaskedConst(IntFunction<short[]> fa,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2708,10 ---

*** 2755,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Short512VectorTests::LSHL_binary_const);
      }
  
- 
- 
      static short ASHR_binary_const(short a) {
          return (short)((a >> CONST_SHIFT));
      }
  
      @Test(dataProvider = "shortUnaryOpProvider")
--- 2726,10 ---

*** 2776,12 ***
          }
  
          assertShiftConstEquals(r, a, Short512VectorTests::ASHR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ASHRShort512VectorTestsScalarShiftMaskedConst(IntFunction<short[]> fa,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2745,10 ---

*** 2796,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Short512VectorTests::ASHR_binary_const);
      }
  
- 
- 
      static short ROR_binary_const(short a) {
          return (short)(ROR_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "shortUnaryOpProvider")
--- 2763,10 ---

*** 2817,12 ***
          }
  
          assertShiftConstEquals(r, a, Short512VectorTests::ROR_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void RORShort512VectorTestsScalarShiftMaskedConst(IntFunction<short[]> fa,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2782,10 ---

*** 2837,12 ***
          }
  
          assertShiftConstEquals(r, a, mask, Short512VectorTests::ROR_binary_const);
      }
  
- 
- 
      static short ROL_binary_const(short a) {
          return (short)(ROL_scalar(a, CONST_SHIFT));
      }
  
      @Test(dataProvider = "shortUnaryOpProvider")
--- 2800,10 ---

*** 2858,12 ***
          }
  
          assertShiftConstEquals(r, a, Short512VectorTests::ROL_binary_const);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ROLShort512VectorTestsScalarShiftMaskedConst(IntFunction<short[]> fa,
                                            IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 2819,10 ---

*** 2899,10 ***
--- 2858,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::MIN);
      }
+ 
      static short min(short a, short b) {
          return (short)(Math.min(a, b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 2917,10 ***
--- 2877,11 ---
              av.min(bv).intoArray(r, i);
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::min);
      }
+ 
      static short MAX(short a, short b) {
          return (short)(Math.max(a, b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 2937,10 ***
--- 2898,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, Short512VectorTests::MAX);
      }
+ 
      static short max(short a, short b) {
          return (short)(Math.max(a, b));
      }
  
      @Test(dataProvider = "shortBinaryOpProvider")

*** 3030,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void ANDReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = -1;
--- 2992,10 ---

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

*** 3076,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ANDReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3036,10 ---

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

*** 3123,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void ORReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = 0;
--- 3081,10 ---

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

*** 3169,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ORReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3125,10 ---

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

*** 3216,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void XORReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = 0;
--- 3170,10 ---

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

*** 3262,11 ***
          }
  
          return res;
      }
  
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void XORReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());
--- 3214,10 ---

*** 3307,10 ***
--- 3258,11 ---
              res += ADDReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void ADDReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = 0;

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

*** 3349,10 ***
--- 3302,11 ---
              res += ADDReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ADDReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

*** 3392,10 ***
--- 3347,11 ---
              res *= MULReduce(a, i);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void MULReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = 1;

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

*** 3434,10 ***
--- 3391,11 ---
              res *= MULReduceMasked(a, i, mask);
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void MULReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

*** 3477,10 ***
--- 3436,11 ---
              res = (short) Math.min(res, MINReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void MINReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = Short.MAX_VALUE;

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

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

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

*** 3562,10 ***
--- 3525,11 ---
              res = (short) Math.max(res, MAXReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void MAXReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = Short.MIN_VALUE;

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

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

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

*** 3647,10 ***
--- 3614,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduce(a, i));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void FIRST_NONZEROReduceShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          short ra = (short) 0;

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

*** 3689,10 ***
--- 3658,11 ---
              res = firstNonZero(res, FIRST_NONZEROReduceMasked(a, i, mask));
          }
  
          return res;
      }
+ 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void FIRST_NONZEROReduceShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
          boolean[] mask = fm.apply(SPECIES.length());

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

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

*** 3767,11 ***
          }
  
          assertReductionBoolArraysEquals(r, mask, Short512VectorTests::allTrue);
      }
  
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void withShort512VectorTests(IntFunction<short []> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
  
--- 3734,10 ---

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

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

*** 3866,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void LTShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3834,10 ---

*** 3888,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void ltShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3853,10 ---

*** 3931,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void GTShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3895,10 ---

*** 3974,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void EQShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3937,10 ---

*** 3994,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void eqShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3956,10 ---

*** 4037,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void NEShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 3998,10 ---

*** 4080,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void LEShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4040,10 ---

*** 4123,11 ***
                  }
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void GEShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4082,10 ---

*** 4166,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void UNSIGNED_LTShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4124,10 ---

*** 4187,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void UNSIGNED_LTShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4143,10 ---

*** 4212,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void UNSIGNED_GTShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4166,10 ---

*** 4234,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void UNSIGNED_GTShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4185,10 ---

*** 4259,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void UNSIGNED_LEShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4208,10 ---

*** 4281,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void UNSIGNED_LEShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4227,10 ---

*** 4306,13 ***
                  }
              }
          }
      }
  
- 
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void UNSIGNED_GEShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4250,10 ---

*** 4328,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void UNSIGNED_GEShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4269,10 ---

*** 4353,12 ***
                  }
              }
          }
      }
  
- 
- 
      @Test(dataProvider = "shortCompareOpProvider")
      static void LTShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
  
--- 4292,10 ---

*** 4371,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] < b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void LTShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa,
                                  IntFunction<short[]> fb, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4308,10 ---

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

*** 4445,11 ***
                  Assert.assertEquals(mv.laneIsSet(j), a[i + j] == b[i]);
              }
          }
      }
  
- 
      @Test(dataProvider = "shortCompareOpMaskProvider")
      static void EQShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa,
                                  IntFunction<short[]> fb, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4380,10 ---

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

*** 4561,10 ***
--- 4494,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void compressShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.compress(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertcompressArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void expandShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.expand(vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertexpandArraysEquals(r, a, mask, SPECIES.length());
+     }
+ 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void getShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
  

*** 4731,14 ***
          }
  
          assertBroadcastArraysEquals(r, a);
      }
  
- 
- 
- 
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void ZeroShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = new short[a.length];
  
--- 4701,10 ---

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

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

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

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

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

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

*** 4962,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Short512VectorTests::unslice);
      }
  
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
      static short BITWISE_BLEND(short a, short b, short c) {
          return (short)((a&~(c))|(b&c));
      }
      static short bitwiseBlend(short a, short b, short c) {
          return (short)((a&~(c))|(b&c));
      }
  
- 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());
--- 4930,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, Short512VectorTests::unslice);
      }
  
      static short BITWISE_BLEND(short a, short b, short c) {
          return (short)((a&~(c))|(b&c));
      }
+ 
      static short bitwiseBlend(short a, short b, short c) {
          return (short)((a&~(c))|(b&c));
      }
  
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());

*** 5010,10 ***
--- 4956,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShort512VectorTests(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());

*** 5027,11 ***
          }
  
          assertArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "shortTernaryOpMaskProvider")
      static void BITWISE_BLENDShort512VectorTestsMasked(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<short[]> fc, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 4974,10 ---

*** 5050,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());
--- 4996,10 ---

*** 5082,10 ***
--- 5025,11 ---
              ShortVector cv = ShortVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());

*** 5112,11 ***
              av.bitwiseBlend(b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "shortTernaryOpMaskProvider")
      static void BITWISE_BLENDShort512VectorTestsBroadcastMaskedSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<short[]> fc, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 5056,10 ---

*** 5151,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShort512VectorTestsDoubleBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());
--- 5094,10 ---

*** 5168,10 ***
--- 5108,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Short512VectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShort512VectorTestsDoubleBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb, IntFunction<short[]> fc) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
          short[] c = fc.apply(SPECIES.length());

*** 5183,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, Short512VectorTests::bitwiseBlend);
      }
  
- 
      @Test(dataProvider = "shortTernaryOpMaskProvider")
      static void BITWISE_BLENDShort512VectorTestsDoubleBroadcastMaskedSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb,
                                            IntFunction<short[]> fc, IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());
--- 5124,10 ---

*** 5202,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, Short512VectorTests::BITWISE_BLEND);
      }
  
- 
      static short NEG(short a) {
          return (short)(-((short)a));
      }
  
      static short neg(short a) {
--- 5142,10 ---

*** 5315,21 ***
          }
  
          assertArraysEquals(r, a, mask, Short512VectorTests::ABS);
      }
  
- 
      static short NOT(short a) {
          return (short)(~((short)a));
      }
  
      static short not(short a) {
          return (short)(~((short)a));
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void NOTShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
  
--- 5254,18 ---

*** 5356,12 ***
          }
  
          assertArraysEquals(r, a, Short512VectorTests::not);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void NOTMaskedShort512VectorTests(IntFunction<short[]> fa,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 5292,10 ---

*** 5376,18 ***
          }
  
          assertArraysEquals(r, a, mask, Short512VectorTests::NOT);
      }
  
- 
- 
      static short ZOMO(short a) {
          return (short)((a==0?0:-1));
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpProvider")
      static void ZOMOShort512VectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
  
--- 5310,14 ---

*** 5399,12 ***
          }
  
          assertArraysEquals(r, a, Short512VectorTests::ZOMO);
      }
  
- 
- 
      @Test(dataProvider = "shortUnaryOpMaskProvider")
      static void ZOMOMaskedShort512VectorTests(IntFunction<short[]> fa,
                                                  IntFunction<boolean[]> fm) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
--- 5329,10 ---

*** 5419,13 ***
--- 5347,194 ---
          }
  
          assertArraysEquals(r, a, mask, Short512VectorTests::ZOMO);
      }
  
+     static short BIT_COUNT(short a) {
+         return (short)(Integer.bitCount((int)a & 0xFFFF));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void BIT_COUNTShort512VectorTests(IntFunction<short[]> fa) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Short512VectorTests::BIT_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.BIT_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Short512VectorTests::BIT_COUNT);
+     }
+ 
+     static short TRAILING_ZEROS_COUNT(short a) {
+         return (short)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTShort512VectorTests(IntFunction<short[]> fa) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Short512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.TRAILING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Short512VectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static short LEADING_ZEROS_COUNT(short a) {
+         return (short)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTShort512VectorTests(IntFunction<short[]> fa) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Short512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.LEADING_ZEROS_COUNT, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Short512VectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static short REVERSE(short a) {
+         return (short)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void REVERSEShort512VectorTests(IntFunction<short[]> fa) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, Short512VectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void REVERSEMaskedShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Short512VectorTests::REVERSE);
+     }
+ 
+     static short REVERSE_BYTES(short a) {
+         return (short)(Short.reverseBytes(a));
+     }
  
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void REVERSE_BYTESShort512VectorTests(IntFunction<short[]> fa) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
  
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES).intoArray(r, i);
+             }
+         }
  
+         assertArraysEquals(r, a, Short512VectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedShort512VectorTests(IntFunction<short[]> fa,
+                                                 IntFunction<boolean[]> fm) {
+         short[] a = fa.apply(SPECIES.length());
+         short[] r = fr.apply(SPECIES.length());
+         boolean[] mask = fm.apply(SPECIES.length());
+         VectorMask<Short> vmask = VectorMask.fromArray(SPECIES, mask, 0);
+ 
+         for (int ic = 0; ic < INVOC_COUNT; ic++) {
+             for (int i = 0; i < a.length; i += SPECIES.length()) {
+                 ShortVector av = ShortVector.fromArray(SPECIES, a, i);
+                 av.lanewise(VectorOperators.REVERSE_BYTES, vmask).intoArray(r, i);
+             }
+         }
+ 
+         assertArraysEquals(r, a, mask, Short512VectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "shortCompareOpProvider")
      static void ltShort512VectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());

*** 5824,10 ***
--- 5933,27 ---
          }
  
          assertMaskReductionArraysEquals(r, a, Short512VectorTests::maskFirstTrue);
      }
  
+     @Test(dataProvider = "maskProvider")
+     static void maskCompressShort512VectorTestsSmokeTest(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},

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

*** 5886,10 ***
--- 6026,18 ---
          int actualLoopBound = SPECIES.loopBound(length);
          int expectedLoopBound = length - Math.floorMod(length, SPECIES.length());
          Assert.assertEquals(actualLoopBound, expectedLoopBound);
      }
  
+     @Test(dataProvider = "lengthProvider")
+     static void loopBoundLongShort512VectorTestsSmokeTest(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 ElementSizeShort512VectorTestsSmokeTest() {
          ShortVector av = ShortVector.zero(SPECIES);
          int elsize = av.elementSize();
          Assert.assertEquals(elsize, Short.SIZE);

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