< prev index next >

test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java

Print this page
*** 264,10 ***
--- 264,59 ---
              int idx = i + j;
              Assert.assertEquals(r[i+j], a[i+order[i+j]], "at index #" + idx + ", input = " + a[i+order[i+j]]);
          }
      }
  
+     static void assertcompressArraysEquals(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++) {

*** 887,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(
--- 936,10 ---

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

*** 1059,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);
              }),
--- 1105,10 ---

*** 1200,10 ***
--- 1245,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) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 3061,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::ANDReduce, ShortMaxVectorTests::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];
--- 3022,10 ---

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

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

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

*** 3154,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::ORReduce, ShortMaxVectorTests::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];
--- 3111,10 ---

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

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

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

*** 3247,11 ***
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::XORReduce, ShortMaxVectorTests::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];
--- 3200,10 ---

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

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

*** 3336,10 ***
--- 3288,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::ADDReduce, ShortMaxVectorTests::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];

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

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

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

*** 3421,10 ***
--- 3377,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::MULReduce, ShortMaxVectorTests::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];

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

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

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

*** 3506,10 ***
--- 3466,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::MINReduce, ShortMaxVectorTests::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]);

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

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

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

*** 3591,10 ***
--- 3555,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::MAXReduce, ShortMaxVectorTests::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]);

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

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

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

*** 3676,10 ***
--- 3644,11 ---
          }
  
          assertReductionArraysEquals(r, ra, a,
                  ShortMaxVectorTests::FIRST_NONZEROReduce, ShortMaxVectorTests::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]);

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

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

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

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

*** 3790,10 ***
--- 3756,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")

*** 3830,10 ***
--- 3797,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")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*** 4566,10 ***
--- 4499,47 ---
              av.rearrange(VectorShuffle.fromArray(SPECIES, order, i), vmask).intoArray(r, i);
          }
  
          assertRearrangeArraysEquals(r, a, order, mask, SPECIES.length());
      }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void compressShortMaxVectorTests(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 expandShortMaxVectorTests(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 getShortMaxVectorTests(IntFunction<short[]> fa) {
          short[] a = fa.apply(SPECIES.length());
          short[] r = fr.apply(SPECIES.length());
  

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

*** 4754,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];
--- 4720,10 ---

*** 4782,10 ***
--- 4745,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, ShortMaxVectorTests::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];

*** 4811,10 ***
--- 4775,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, ShortMaxVectorTests::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;

*** 4844,10 ***
--- 4809,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, mask, ShortMaxVectorTests::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;

*** 4871,10 ***
--- 4837,11 ---
              }
          }
  
          assertArraysEquals(r, a, origin, ShortMaxVectorTests::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)

*** 4910,10 ***
--- 4877,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, origin, part, ShortMaxVectorTests::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];

*** 4967,40 ***
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, ShortMaxVectorTests::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_BLENDShortMaxVectorTests(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());
--- 4935,18 ---
          }
  
          assertArraysEquals(r, a, b, origin, part, mask, ShortMaxVectorTests::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_BLENDShortMaxVectorTests(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());

*** 5015,10 ***
--- 4961,11 ---
              }
          }
  
          assertArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShortMaxVectorTests(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());

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

*** 5055,13 ***
          }
  
          assertArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShortMaxVectorTestsBroadcastSmokeTest(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());
--- 5001,10 ---

*** 5087,10 ***
--- 5030,11 ---
              ShortVector cv = ShortVector.fromArray(SPECIES, c, i);
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], cv).intoArray(r, i);
          }
          assertAltBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShortMaxVectorTestsBroadcastSmokeTest(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());

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

*** 5156,13 ***
          }
  
          assertAltBroadcastArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND);
      }
  
- 
- 
- 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void BITWISE_BLENDShortMaxVectorTestsDoubleBroadcastSmokeTest(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());
--- 5099,10 ---

*** 5173,10 ***
--- 5113,11 ---
              av.lanewise(VectorOperators.BITWISE_BLEND, b[i], c[i]).intoArray(r, i);
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, ShortMaxVectorTests::BITWISE_BLEND);
      }
+ 
      @Test(dataProvider = "shortTernaryOpProvider")
      static void bitwiseBlendShortMaxVectorTestsDoubleBroadcastSmokeTest(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());

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

*** 5207,11 ***
          }
  
          assertDoubleBroadcastArraysEquals(r, a, b, c, mask, ShortMaxVectorTests::BITWISE_BLEND);
      }
  
- 
      static short NEG(short a) {
          return (short)(-((short)a));
      }
  
      static short neg(short a) {
--- 5147,10 ---

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

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

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

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

*** 5424,13 ***
--- 5352,194 ---
          }
  
          assertArraysEquals(r, a, mask, ShortMaxVectorTests::ZOMO);
      }
  
+     static short BIT_COUNT(short a) {
+         return (short)(Integer.bitCount((int)a & 0xFFFF));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void BIT_COUNTShortMaxVectorTests(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, ShortMaxVectorTests::BIT_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void BIT_COUNTMaskedShortMaxVectorTests(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, ShortMaxVectorTests::BIT_COUNT);
+     }
+ 
+     static short TRAILING_ZEROS_COUNT(short a) {
+         return (short)(TRAILING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void TRAILING_ZEROS_COUNTShortMaxVectorTests(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, ShortMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void TRAILING_ZEROS_COUNTMaskedShortMaxVectorTests(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, ShortMaxVectorTests::TRAILING_ZEROS_COUNT);
+     }
+ 
+     static short LEADING_ZEROS_COUNT(short a) {
+         return (short)(LEADING_ZEROS_COUNT_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void LEADING_ZEROS_COUNTShortMaxVectorTests(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, ShortMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void LEADING_ZEROS_COUNTMaskedShortMaxVectorTests(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, ShortMaxVectorTests::LEADING_ZEROS_COUNT);
+     }
+ 
+     static short REVERSE(short a) {
+         return (short)(REVERSE_scalar(a));
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void REVERSEShortMaxVectorTests(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, ShortMaxVectorTests::REVERSE);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void REVERSEMaskedShortMaxVectorTests(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, ShortMaxVectorTests::REVERSE);
+     }
+ 
+     static short REVERSE_BYTES(short a) {
+         return (short)(Short.reverseBytes(a));
+     }
  
+     @Test(dataProvider = "shortUnaryOpProvider")
+     static void REVERSE_BYTESShortMaxVectorTests(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, ShortMaxVectorTests::REVERSE_BYTES);
+     }
+ 
+     @Test(dataProvider = "shortUnaryOpMaskProvider")
+     static void REVERSE_BYTESMaskedShortMaxVectorTests(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, ShortMaxVectorTests::REVERSE_BYTES);
+     }
  
      @Test(dataProvider = "shortCompareOpProvider")
      static void ltShortMaxVectorTestsBroadcastSmokeTest(IntFunction<short[]> fa, IntFunction<short[]> fb) {
          short[] a = fa.apply(SPECIES.length());
          short[] b = fb.apply(SPECIES.length());

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

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

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

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