< prev index next >

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java

Print this page
@@ -27,11 +27,10 @@
  import java.nio.ByteBuffer;
  import java.nio.ByteOrder;
  import java.nio.ReadOnlyBufferException;
  import java.util.Arrays;
  import java.util.Objects;
- import java.util.function.BinaryOperator;
  import java.util.function.Function;
  import java.util.function.UnaryOperator;
  
  import jdk.internal.misc.ScopedMemoryAccess;
  import jdk.internal.misc.Unsafe;

@@ -171,10 +170,13 @@
                               FUnOp f);
      @ForceInline
      final
      ShortVector uOpTemplate(VectorMask<Short> m,
                                       FUnOp f) {
+         if (m == null) {
+             return uOpTemplate(f);
+         }
          short[] vec = vec();
          short[] res = new short[length()];
          boolean[] mbits = ((AbstractMask<Short>)m).getBits();
          for (int i = 0; i < res.length; i++) {
              res[i] = mbits[i] ? f.apply(i, vec[i]) : vec[i];

@@ -214,10 +216,13 @@
      @ForceInline
      final
      ShortVector bOpTemplate(Vector<Short> o,
                                       VectorMask<Short> m,
                                       FBinOp f) {
+         if (m == null) {
+             return bOpTemplate(o, f);
+         }
          short[] res = new short[length()];
          short[] vec1 = this.vec();
          short[] vec2 = ((ShortVector)o).vec();
          boolean[] mbits = ((AbstractMask<Short>)m).getBits();
          for (int i = 0; i < res.length; i++) {

@@ -263,10 +268,13 @@
      final
      ShortVector tOpTemplate(Vector<Short> o1,
                                       Vector<Short> o2,
                                       VectorMask<Short> m,
                                       FTriOp f) {
+         if (m == null) {
+             return tOpTemplate(o1, o2, f);
+         }
          short[] res = new short[length()];
          short[] vec1 = this.vec();
          short[] vec2 = ((ShortVector)o1).vec();
          short[] vec3 = ((ShortVector)o2).vec();
          boolean[] mbits = ((AbstractMask<Short>)m).getBits();

@@ -278,11 +286,26 @@
  
      // Reduction operator
  
      /*package-private*/
      abstract
-     short rOp(short v, FBinOp f);
+     short rOp(short v, VectorMask<Short> m, FBinOp f);
+ 
+     @ForceInline
+     final
+     short rOpTemplate(short v, VectorMask<Short> m, FBinOp f) {
+         if (m == null) {
+             return rOpTemplate(v, f);
+         }
+         short[] vec = vec();
+         boolean[] mbits = ((AbstractMask<Short>)m).getBits();
+         for (int i = 0; i < vec.length; i++) {
+             v = mbits[i] ? f.apply(i, v, vec[i]) : v;
+         }
+         return v;
+     }
+ 
      @ForceInline
      final
      short rOpTemplate(short v, FBinOp f) {
          short[] vec = vec();
          for (int i = 0; i < vec.length; i++) {

@@ -547,41 +570,65 @@
          if (opKind(op, VO_SPECIAL)) {
              if (op == ZOMO) {
                  return blend(broadcast(-1), compare(NE, 0));
              }
              if (op == NOT) {
-                 return broadcast(-1).lanewiseTemplate(XOR, this);
+                 return broadcast(-1).lanewise(XOR, this);
              } else if (op == NEG) {
                  // FIXME: Support this in the JIT.
-                 return broadcast(0).lanewiseTemplate(SUB, this);
+                 return broadcast(0).lanewise(SUB, this);
              }
          }
          int opc = opCode(op);
          return VectorSupport.unaryOp(
-             opc, getClass(), short.class, length(),
-             this,
-             UN_IMPL.find(op, opc, (opc_) -> {
-               switch (opc_) {
-                 case VECTOR_OP_NEG: return v0 ->
-                         v0.uOp((i, a) -> (short) -a);
-                 case VECTOR_OP_ABS: return v0 ->
-                         v0.uOp((i, a) -> (short) Math.abs(a));
-                 default: return null;
-               }}));
+             opc, getClass(), null, short.class, length(),
+             this, null,
+             UN_IMPL.find(op, opc, ShortVector::unaryOperations));
      }
-     private static final
-     ImplCache<Unary,UnaryOperator<ShortVector>> UN_IMPL
-         = new ImplCache<>(Unary.class, ShortVector.class);
  
      /**
       * {@inheritDoc} <!--workaround-->
       */
-     @ForceInline
-     public final
+     @Override
+     public abstract
      ShortVector lanewise(VectorOperators.Unary op,
-                                   VectorMask<Short> m) {
-         return blend(lanewise(op), m);
+                                   VectorMask<Short> m);
+     @ForceInline
+     final
+     ShortVector lanewiseTemplate(VectorOperators.Unary op,
+                                           Class<? extends VectorMask<Short>> maskClass,
+                                           VectorMask<Short> m) {
+         m.check(maskClass, this);
+         if (opKind(op, VO_SPECIAL)) {
+             if (op == ZOMO) {
+                 return blend(broadcast(-1), compare(NE, 0, m));
+             }
+             if (op == NOT) {
+                 return lanewise(XOR, broadcast(-1), m);
+             } else if (op == NEG) {
+                 return lanewise(NOT, m).lanewise(ADD, broadcast(1), m);
+             }
+         }
+         int opc = opCode(op);
+         return VectorSupport.unaryOp(
+             opc, getClass(), maskClass, short.class, length(),
+             this, m,
+             UN_IMPL.find(op, opc, ShortVector::unaryOperations));
+     }
+ 
+     private static final
+     ImplCache<Unary, UnaryOperation<ShortVector, VectorMask<Short>>>
+         UN_IMPL = new ImplCache<>(Unary.class, ShortVector.class);
+ 
+     private static UnaryOperation<ShortVector, VectorMask<Short>> unaryOperations(int opc_) {
+         switch (opc_) {
+             case VECTOR_OP_NEG: return (v0, m) ->
+                     v0.uOp(m, (i, a) -> (short) -a);
+             case VECTOR_OP_ABS: return (v0, m) ->
+                     v0.uOp(m, (i, a) -> (short) Math.abs(a));
+             default: return null;
+         }
      }
  
      // Binary lanewise support
  
      /**

@@ -597,10 +644,11 @@
      final
      ShortVector lanewiseTemplate(VectorOperators.Binary op,
                                            Vector<Short> v) {
          ShortVector that = (ShortVector) v;
          that.check(this);
+ 
          if (opKind(op, VO_SPECIAL  | VO_SHIFT)) {
              if (op == FIRST_NONZERO) {
                  // FIXME: Support this in the JIT.
                  VectorMask<Short> thisNZ
                      = this.viewAsIntegralLanes().compare(NE, (short) 0);

@@ -615,78 +663,114 @@
              if (op == AND_NOT) {
                  // FIXME: Support this in the JIT.
                  that = that.lanewise(NOT);
                  op = AND;
              } else if (op == DIV) {
-                 VectorMask<Short> eqz = that.eq((short)0);
+                 VectorMask<Short> eqz = that.eq((short) 0);
                  if (eqz.anyTrue()) {
                      throw that.divZeroException();
                  }
              }
          }
+ 
          int opc = opCode(op);
          return VectorSupport.binaryOp(
-             opc, getClass(), short.class, length(),
-             this, that,
-             BIN_IMPL.find(op, opc, (opc_) -> {
-               switch (opc_) {
-                 case VECTOR_OP_ADD: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a + b));
-                 case VECTOR_OP_SUB: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a - b));
-                 case VECTOR_OP_MUL: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a * b));
-                 case VECTOR_OP_DIV: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a / b));
-                 case VECTOR_OP_MAX: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)Math.max(a, b));
-                 case VECTOR_OP_MIN: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)Math.min(a, b));
-                 case VECTOR_OP_AND: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a & b));
-                 case VECTOR_OP_OR: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a | b));
-                 case VECTOR_OP_XOR: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, b) -> (short)(a ^ b));
-                 case VECTOR_OP_LSHIFT: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, n) -> (short)(a << n));
-                 case VECTOR_OP_RSHIFT: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, n) -> (short)(a >> n));
-                 case VECTOR_OP_URSHIFT: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, n) -> (short)((a & LSHR_SETUP_MASK) >>> n));
-                 case VECTOR_OP_LROTATE: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n));
-                 case VECTOR_OP_RROTATE: return (v0, v1) ->
-                         v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n));
-                 default: return null;
-                 }}));
+             opc, getClass(), null, short.class, length(),
+             this, that, null,
+             BIN_IMPL.find(op, opc, ShortVector::binaryOperations));
      }
-     private static final
-     ImplCache<Binary,BinaryOperator<ShortVector>> BIN_IMPL
-         = new ImplCache<>(Binary.class, ShortVector.class);
  
      /**
       * {@inheritDoc} <!--workaround-->
       * @see #lanewise(VectorOperators.Binary,short,VectorMask)
       */
-     @ForceInline
-     public final
+     @Override
+     public abstract
      ShortVector lanewise(VectorOperators.Binary op,
                                    Vector<Short> v,
-                                   VectorMask<Short> m) {
+                                   VectorMask<Short> m);
+     @ForceInline
+     final
+     ShortVector lanewiseTemplate(VectorOperators.Binary op,
+                                           Class<? extends VectorMask<Short>> maskClass,
+                                           Vector<Short> v, VectorMask<Short> m) {
          ShortVector that = (ShortVector) v;
-         if (op == DIV) {
-             VectorMask<Short> eqz = that.eq((short)0);
-             if (eqz.and(m).anyTrue()) {
-                 throw that.divZeroException();
+         that.check(this);
+         m.check(maskClass, this);
+ 
+         if (opKind(op, VO_SPECIAL  | VO_SHIFT)) {
+             if (op == FIRST_NONZERO) {
+                 // FIXME: Support this in the JIT.
+                 VectorMask<Short> thisNZ
+                     = this.viewAsIntegralLanes().compare(NE, (short) 0);
+                 that = that.blend((short) 0, thisNZ.cast(vspecies()));
+                 op = OR_UNCHECKED;
+             }
+             if (opKind(op, VO_SHIFT)) {
+                 // As per shift specification for Java, mask the shift count.
+                 // This allows the JIT to ignore some ISA details.
+                 that = that.lanewise(AND, SHIFT_MASK);
+             }
+             if (op == AND_NOT) {
+                 // FIXME: Support this in the JIT.
+                 that = that.lanewise(NOT);
+                 op = AND;
+             } else if (op == DIV) {
+                 VectorMask<Short> eqz = that.eq((short)0);
+                 if (eqz.and(m).anyTrue()) {
+                     throw that.divZeroException();
+                 }
+                 // suppress div/0 exceptions in unset lanes
+                 that = that.lanewise(NOT, eqz);
              }
-             // suppress div/0 exceptions in unset lanes
-             that = that.lanewise(NOT, eqz);
-             return blend(lanewise(DIV, that), m);
          }
-         return blend(lanewise(op, v), m);
+ 
+         int opc = opCode(op);
+         return VectorSupport.binaryOp(
+             opc, getClass(), maskClass, short.class, length(),
+             this, that, m,
+             BIN_IMPL.find(op, opc, ShortVector::binaryOperations));
+     }
+ 
+     private static final
+     ImplCache<Binary, BinaryOperation<ShortVector, VectorMask<Short>>>
+         BIN_IMPL = new ImplCache<>(Binary.class, ShortVector.class);
+ 
+     private static BinaryOperation<ShortVector, VectorMask<Short>> binaryOperations(int opc_) {
+         switch (opc_) {
+             case VECTOR_OP_ADD: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a + b));
+             case VECTOR_OP_SUB: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a - b));
+             case VECTOR_OP_MUL: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a * b));
+             case VECTOR_OP_DIV: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a / b));
+             case VECTOR_OP_MAX: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)Math.max(a, b));
+             case VECTOR_OP_MIN: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)Math.min(a, b));
+             case VECTOR_OP_AND: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a & b));
+             case VECTOR_OP_OR: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a | b));
+             case VECTOR_OP_XOR: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, b) -> (short)(a ^ b));
+             case VECTOR_OP_LSHIFT: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, n) -> (short)(a << n));
+             case VECTOR_OP_RSHIFT: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, n) -> (short)(a >> n));
+             case VECTOR_OP_URSHIFT: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, n) -> (short)((a & LSHR_SETUP_MASK) >>> n));
+             case VECTOR_OP_LROTATE: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n));
+             case VECTOR_OP_RROTATE: return (v0, v1, vm) ->
+                     v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n));
+             default: return null;
+         }
      }
+ 
      // FIXME: Maybe all of the public final methods in this file (the
      // simple ones that just call lanewise) should be pushed down to
      // the X-VectorBits template.  They can't optimize properly at
      // this level, and must rely on inlining.  Does it work?
      // (If it works, of course keep the code here.)

@@ -745,11 +829,17 @@
      @ForceInline
      public final
      ShortVector lanewise(VectorOperators.Binary op,
                                    short e,
                                    VectorMask<Short> m) {
-         return blend(lanewise(op, e), m);
+         if (opKind(op, VO_SHIFT) && (short)(int)e == e) {
+             return lanewiseShift(op, (int) e, m);
+         }
+         if (op == AND_NOT) {
+             op = AND; e = (short) ~e;
+         }
+         return lanewise(op, broadcast(e), m);
      }
  
      /**
       * {@inheritDoc} <!--workaround-->
       * @apiNote

@@ -765,12 +855,11 @@
      ShortVector lanewise(VectorOperators.Binary op,
                                    long e) {
          short e1 = (short) e;
          if ((long)e1 != e
              // allow shift ops to clip down their int parameters
-             && !(opKind(op, VO_SHIFT) && (int)e1 == e)
-             ) {
+             && !(opKind(op, VO_SHIFT) && (int)e1 == e)) {
              vspecies().checkValue(e);  // for exception
          }
          return lanewise(op, e1);
      }
  

@@ -786,11 +875,17 @@
       */
      @ForceInline
      public final
      ShortVector lanewise(VectorOperators.Binary op,
                                    long e, VectorMask<Short> m) {
-         return blend(lanewise(op, e), m);
+         short e1 = (short) e;
+         if ((long)e1 != e
+             // allow shift ops to clip down their int parameters
+             && !(opKind(op, VO_SHIFT) && (int)e1 == e)) {
+             vspecies().checkValue(e);  // for exception
+         }
+         return lanewise(op, e1, m);
      }
  
      /*package-private*/
      abstract ShortVector
      lanewiseShift(VectorOperators.Binary op, int e);

@@ -803,31 +898,56 @@
          assert(opKind(op, VO_SHIFT));
          // As per shift specification for Java, mask the shift count.
          e &= SHIFT_MASK;
          int opc = opCode(op);
          return VectorSupport.broadcastInt(
-             opc, getClass(), short.class, length(),
-             this, e,
-             BIN_INT_IMPL.find(op, opc, (opc_) -> {
-               switch (opc_) {
-                 case VECTOR_OP_LSHIFT: return (v, n) ->
-                         v.uOp((i, a) -> (short)(a << n));
-                 case VECTOR_OP_RSHIFT: return (v, n) ->
-                         v.uOp((i, a) -> (short)(a >> n));
-                 case VECTOR_OP_URSHIFT: return (v, n) ->
-                         v.uOp((i, a) -> (short)((a & LSHR_SETUP_MASK) >>> n));
-                 case VECTOR_OP_LROTATE: return (v, n) ->
-                         v.uOp((i, a) -> rotateLeft(a, (int)n));
-                 case VECTOR_OP_RROTATE: return (v, n) ->
-                         v.uOp((i, a) -> rotateRight(a, (int)n));
-                 default: return null;
-                 }}));
+             opc, getClass(), null, short.class, length(),
+             this, e, null,
+             BIN_INT_IMPL.find(op, opc, ShortVector::broadcastIntOperations));
+     }
+ 
+     /*package-private*/
+     abstract ShortVector
+     lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m);
+ 
+     /*package-private*/
+     @ForceInline
+     final ShortVector
+     lanewiseShiftTemplate(VectorOperators.Binary op,
+                           Class<? extends VectorMask<Short>> maskClass,
+                           int e, VectorMask<Short> m) {
+         m.check(maskClass, this);
+         assert(opKind(op, VO_SHIFT));
+         // As per shift specification for Java, mask the shift count.
+         e &= SHIFT_MASK;
+         int opc = opCode(op);
+         return VectorSupport.broadcastInt(
+             opc, getClass(), maskClass, short.class, length(),
+             this, e, m,
+             BIN_INT_IMPL.find(op, opc, ShortVector::broadcastIntOperations));
      }
+ 
      private static final
-     ImplCache<Binary,VectorBroadcastIntOp<ShortVector>> BIN_INT_IMPL
+     ImplCache<Binary,VectorBroadcastIntOp<ShortVector, VectorMask<Short>>> BIN_INT_IMPL
          = new ImplCache<>(Binary.class, ShortVector.class);
  
+     private static VectorBroadcastIntOp<ShortVector, VectorMask<Short>> broadcastIntOperations(int opc_) {
+         switch (opc_) {
+             case VECTOR_OP_LSHIFT: return (v, n, m) ->
+                     v.uOp(m, (i, a) -> (short)(a << n));
+             case VECTOR_OP_RSHIFT: return (v, n, m) ->
+                     v.uOp(m, (i, a) -> (short)(a >> n));
+             case VECTOR_OP_URSHIFT: return (v, n, m) ->
+                     v.uOp(m, (i, a) -> (short)((a & LSHR_SETUP_MASK) >>> n));
+             case VECTOR_OP_LROTATE: return (v, n, m) ->
+                     v.uOp(m, (i, a) -> rotateLeft(a, (int)n));
+             case VECTOR_OP_RROTATE: return (v, n, m) ->
+                     v.uOp(m, (i, a) -> rotateRight(a, (int)n));
+             default: return null;
+         }
+     }
+ 
      // As per shift specification for Java, mask the shift count.
      // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte).
      // The latter two maskings go beyond the JLS, but seem reasonable
      // since our lane types are first-class types, not just dressed
      // up ints.

@@ -876,34 +996,63 @@
              that = this.lanewise(XOR, that).lanewise(AND, tother);
              return this.lanewise(XOR, that);
          }
          int opc = opCode(op);
          return VectorSupport.ternaryOp(
-             opc, getClass(), short.class, length(),
-             this, that, tother,
-             TERN_IMPL.find(op, opc, (opc_) -> {
-               switch (opc_) {
-                 default: return null;
-                 }}));
+             opc, getClass(), null, short.class, length(),
+             this, that, tother, null,
+             TERN_IMPL.find(op, opc, ShortVector::ternaryOperations));
      }
-     private static final
-     ImplCache<Ternary,TernaryOperation<ShortVector>> TERN_IMPL
-         = new ImplCache<>(Ternary.class, ShortVector.class);
  
      /**
       * {@inheritDoc} <!--workaround-->
       * @see #lanewise(VectorOperators.Ternary,short,short,VectorMask)
       * @see #lanewise(VectorOperators.Ternary,Vector,short,VectorMask)
       * @see #lanewise(VectorOperators.Ternary,short,Vector,VectorMask)
       */
-     @ForceInline
-     public final
+     @Override
+     public abstract
      ShortVector lanewise(VectorOperators.Ternary op,
                                    Vector<Short> v1,
                                    Vector<Short> v2,
-                                   VectorMask<Short> m) {
-         return blend(lanewise(op, v1, v2), m);
+                                   VectorMask<Short> m);
+     @ForceInline
+     final
+     ShortVector lanewiseTemplate(VectorOperators.Ternary op,
+                                           Class<? extends VectorMask<Short>> maskClass,
+                                           Vector<Short> v1,
+                                           Vector<Short> v2,
+                                           VectorMask<Short> m) {
+         ShortVector that = (ShortVector) v1;
+         ShortVector tother = (ShortVector) v2;
+         // It's a word: https://www.dictionary.com/browse/tother
+         // See also Chapter 11 of Dickens, Our Mutual Friend:
+         // "Totherest Governor," replied Mr Riderhood...
+         that.check(this);
+         tother.check(this);
+         m.check(maskClass, this);
+ 
+         if (op == BITWISE_BLEND) {
+             // FIXME: Support this in the JIT.
+             that = this.lanewise(XOR, that).lanewise(AND, tother);
+             return this.lanewise(XOR, that, m);
+         }
+         int opc = opCode(op);
+         return VectorSupport.ternaryOp(
+             opc, getClass(), maskClass, short.class, length(),
+             this, that, tother, m,
+             TERN_IMPL.find(op, opc, ShortVector::ternaryOperations));
+     }
+ 
+     private static final
+     ImplCache<Ternary, TernaryOperation<ShortVector, VectorMask<Short>>>
+         TERN_IMPL = new ImplCache<>(Ternary.class, ShortVector.class);
+ 
+     private static TernaryOperation<ShortVector, VectorMask<Short>> ternaryOperations(int opc_) {
+         switch (opc_) {
+             default: return null;
+         }
      }
  
      /**
       * Combines the lane values of this vector
       * with the values of two broadcast scalars.

@@ -956,11 +1105,11 @@
      public final
      ShortVector lanewise(VectorOperators.Ternary op, //(op,e1,e2,m)
                                    short e1,
                                    short e2,
                                    VectorMask<Short> m) {
-         return blend(lanewise(op, e1, e2), m);
+         return lanewise(op, broadcast(e1), broadcast(e2), m);
      }
  
      /**
       * Combines the lane values of this vector
       * with the values of another vector and a broadcast scalar.

@@ -1014,11 +1163,11 @@
      public final
      ShortVector lanewise(VectorOperators.Ternary op, //(op,v1,e2,m)
                                    Vector<Short> v1,
                                    short e2,
                                    VectorMask<Short> m) {
-         return blend(lanewise(op, v1, e2), m);
+         return lanewise(op, v1, broadcast(e2), m);
      }
  
      /**
       * Combines the lane values of this vector
       * with the values of another vector and a broadcast scalar.

@@ -1071,11 +1220,11 @@
      public final
      ShortVector lanewise(VectorOperators.Ternary op, //(op,e1,v2,m)
                                    short e1,
                                    Vector<Short> v2,
                                    VectorMask<Short> m) {
-         return blend(lanewise(op, e1, v2), m);
+         return lanewise(op, broadcast(e1), v2, m);
      }
  
      // (Thus endeth the Great and Mighty Ternary Ogdoad.)
      // https://en.wikipedia.org/wiki/Ogdoad
  

@@ -1743,28 +1892,48 @@
      /*package-private*/
      @ForceInline
      final
      <M extends VectorMask<Short>>
      M compareTemplate(Class<M> maskType, Comparison op, Vector<Short> v) {
-         Objects.requireNonNull(v);
-         ShortSpecies vsp = vspecies();
          ShortVector that = (ShortVector) v;
          that.check(this);
          int opc = opCode(op);
          return VectorSupport.compare(
              opc, getClass(), maskType, short.class, length(),
-             this, that,
-             (cond, v0, v1) -> {
+             this, that, null,
+             (cond, v0, v1, m1) -> {
                  AbstractMask<Short> m
                      = v0.bTest(cond, v1, (cond_, i, a, b)
                                 -> compareWithOp(cond, a, b));
                  @SuppressWarnings("unchecked")
                  M m2 = (M) m;
                  return m2;
              });
      }
  
+     /*package-private*/
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     M compareTemplate(Class<M> maskType, Comparison op, Vector<Short> v, M m) {
+         ShortVector that = (ShortVector) v;
+         that.check(this);
+         m.check(maskType, this);
+         int opc = opCode(op);
+         return VectorSupport.compare(
+             opc, getClass(), maskType, short.class, length(),
+             this, that, m,
+             (cond, v0, v1, m1) -> {
+                 AbstractMask<Short> cmpM
+                     = v0.bTest(cond, v1, (cond_, i, a, b)
+                                -> compareWithOp(cond, a, b));
+                 @SuppressWarnings("unchecked")
+                 M m2 = (M) cmpM.and(m1);
+                 return m2;
+             });
+     }
+ 
      @ForceInline
      private static boolean compareWithOp(int cond, short a, short b) {
          return switch (cond) {
              case BT_eq -> a == b;
              case BT_ne -> a != b;

@@ -1778,22 +1947,10 @@
              case BT_uge -> Short.compareUnsigned(a, b) >= 0;
              default -> throw new AssertionError();
          };
      }
  
-     /**
-      * {@inheritDoc} <!--workaround-->
-      */
-     @Override
-     @ForceInline
-     public final
-     VectorMask<Short> compare(VectorOperators.Comparison op,
-                                   Vector<Short> v,
-                                   VectorMask<Short> m) {
-         return compare(op, v).and(m);
-     }
- 
      /**
       * Tests this vector by comparing it with an input scalar,
       * according to the given comparison operation.
       *
       * This is a lane-wise binary test operation which applies

@@ -1848,11 +2005,11 @@
       */
      @ForceInline
      public final VectorMask<Short> compare(VectorOperators.Comparison op,
                                                 short e,
                                                 VectorMask<Short> m) {
-         return compare(op, e).and(m);
+         return compare(op, broadcast(e), m);
      }
  
      /**
       * {@inheritDoc} <!--workaround-->
       */

@@ -2099,13 +2256,13 @@
      final
      <S extends VectorShuffle<Short>>
      ShortVector rearrangeTemplate(Class<S> shuffletype, S shuffle) {
          shuffle.checkIndexes();
          return VectorSupport.rearrangeOp(
-             getClass(), shuffletype, short.class, length(),
-             this, shuffle,
-             (v1, s_) -> v1.uOp((i, a) -> {
+             getClass(), shuffletype, null, short.class, length(),
+             this, shuffle, null,
+             (v1, s_, m_) -> v1.uOp((i, a) -> {
                  int ei = s_.laneSource(i);
                  return v1.lane(ei);
              }));
      }
  

@@ -2118,28 +2275,29 @@
                                     VectorMask<Short> m);
  
      /*package-private*/
      @ForceInline
      final
-     <S extends VectorShuffle<Short>>
+     <S extends VectorShuffle<Short>, M extends VectorMask<Short>>
      ShortVector rearrangeTemplate(Class<S> shuffletype,
+                                            Class<M> masktype,
                                             S shuffle,
-                                            VectorMask<Short> m) {
-         ShortVector unmasked =
-             VectorSupport.rearrangeOp(
-                 getClass(), shuffletype, short.class, length(),
-                 this, shuffle,
-                 (v1, s_) -> v1.uOp((i, a) -> {
-                     int ei = s_.laneSource(i);
-                     return ei < 0 ? 0 : v1.lane(ei);
-                 }));
+                                            M m) {
+ 
+         m.check(masktype, this);
          VectorMask<Short> valid = shuffle.laneIsValid();
          if (m.andNot(valid).anyTrue()) {
              shuffle.checkIndexes();
              throw new AssertionError();
          }
-         return broadcast((short)0).blend(unmasked, m);
+         return VectorSupport.rearrangeOp(
+                    getClass(), shuffletype, masktype, short.class, length(),
+                    this, shuffle, m,
+                    (v1, s_, m_) -> v1.uOp((i, a) -> {
+                         int ei = s_.laneSource(i);
+                         return ei < 0  || !m_.laneIsSet(i) ? 0 : v1.lane(ei);
+                    }));
      }
  
      /**
       * {@inheritDoc} <!--workaround-->
       */

@@ -2158,21 +2316,21 @@
          VectorMask<Short> valid = shuffle.laneIsValid();
          @SuppressWarnings("unchecked")
          S ws = (S) shuffle.wrapIndexes();
          ShortVector r0 =
              VectorSupport.rearrangeOp(
-                 getClass(), shuffletype, short.class, length(),
-                 this, ws,
-                 (v0, s_) -> v0.uOp((i, a) -> {
+                 getClass(), shuffletype, null, short.class, length(),
+                 this, ws, null,
+                 (v0, s_, m_) -> v0.uOp((i, a) -> {
                      int ei = s_.laneSource(i);
                      return v0.lane(ei);
                  }));
          ShortVector r1 =
              VectorSupport.rearrangeOp(
-                 getClass(), shuffletype, short.class, length(),
-                 v, ws,
-                 (v1, s_) -> v1.uOp((i, a) -> {
+                 getClass(), shuffletype, null, short.class, length(),
+                 v, ws, null,
+                 (v1, s_, m_) -> v1.uOp((i, a) -> {
                      int ei = s_.laneSource(i);
                      return v1.lane(ei);
                  }));
          return r1.blend(r0, valid);
      }

@@ -2431,13 +2589,22 @@
  
      /*package-private*/
      @ForceInline
      final
      short reduceLanesTemplate(VectorOperators.Associative op,
+                                Class<? extends VectorMask<Short>> maskClass,
                                 VectorMask<Short> m) {
-         ShortVector v = reduceIdentityVector(op).blend(this, m);
-         return v.reduceLanesTemplate(op);
+         m.check(maskClass, this);
+         if (op == FIRST_NONZERO) {
+             ShortVector v = reduceIdentityVector(op).blend(this, m);
+             return v.reduceLanesTemplate(op);
+         }
+         int opc = opCode(op);
+         return fromBits(VectorSupport.reductionCoerced(
+             opc, getClass(), maskClass, short.class, length(),
+             this, m,
+             REDUCE_IMPL.find(op, opc, ShortVector::reductionOperations)));
      }
  
      /*package-private*/
      @ForceInline
      final

@@ -2448,34 +2615,38 @@
                  = this.viewAsIntegralLanes().compare(NE, (short) 0);
              return this.lane(thisNZ.firstTrue());
          }
          int opc = opCode(op);
          return fromBits(VectorSupport.reductionCoerced(
-             opc, getClass(), short.class, length(),
-             this,
-             REDUCE_IMPL.find(op, opc, (opc_) -> {
-               switch (opc_) {
-               case VECTOR_OP_ADD: return v ->
-                       toBits(v.rOp((short)0, (i, a, b) -> (short)(a + b)));
-               case VECTOR_OP_MUL: return v ->
-                       toBits(v.rOp((short)1, (i, a, b) -> (short)(a * b)));
-               case VECTOR_OP_MIN: return v ->
-                       toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (short) Math.min(a, b)));
-               case VECTOR_OP_MAX: return v ->
-                       toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (short) Math.max(a, b)));
-               case VECTOR_OP_AND: return v ->
-                       toBits(v.rOp((short)-1, (i, a, b) -> (short)(a & b)));
-               case VECTOR_OP_OR: return v ->
-                       toBits(v.rOp((short)0, (i, a, b) -> (short)(a | b)));
-               case VECTOR_OP_XOR: return v ->
-                       toBits(v.rOp((short)0, (i, a, b) -> (short)(a ^ b)));
-               default: return null;
-               }})));
+             opc, getClass(), null, short.class, length(),
+             this, null,
+             REDUCE_IMPL.find(op, opc, ShortVector::reductionOperations)));
      }
+ 
      private static final
-     ImplCache<Associative,Function<ShortVector,Long>> REDUCE_IMPL
-         = new ImplCache<>(Associative.class, ShortVector.class);
+     ImplCache<Associative, ReductionOperation<ShortVector, VectorMask<Short>>>
+         REDUCE_IMPL = new ImplCache<>(Associative.class, ShortVector.class);
+ 
+     private static ReductionOperation<ShortVector, VectorMask<Short>> reductionOperations(int opc_) {
+         switch (opc_) {
+             case VECTOR_OP_ADD: return (v, m) ->
+                     toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a + b)));
+             case VECTOR_OP_MUL: return (v, m) ->
+                     toBits(v.rOp((short)1, m, (i, a, b) -> (short)(a * b)));
+             case VECTOR_OP_MIN: return (v, m) ->
+                     toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) Math.min(a, b)));
+             case VECTOR_OP_MAX: return (v, m) ->
+                     toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) Math.max(a, b)));
+             case VECTOR_OP_AND: return (v, m) ->
+                     toBits(v.rOp((short)-1, m, (i, a, b) -> (short)(a & b)));
+             case VECTOR_OP_OR: return (v, m) ->
+                     toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a | b)));
+             case VECTOR_OP_XOR: return (v, m) ->
+                     toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a ^ b)));
+             default: return null;
+         }
+     }
  
      private
      @ForceInline
      ShortVector reduceIdentityVector(VectorOperators.Associative op) {
          int opc = opCode(op);

@@ -2697,13 +2868,11 @@
                                         byte[] a, int offset,
                                         ByteOrder bo,
                                         VectorMask<Short> m) {
          ShortSpecies vsp = (ShortSpecies) species;
          if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) {
-             ShortVector zero = vsp.zero();
-             ShortVector v = zero.fromByteArray0(a, offset);
-             return zero.blend(v.maybeSwap(bo), m);
+             return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo);
          }
  
          // FIXME: optimize
          checkMaskFromIndexSize(offset, vsp, m, 2, a.length);
          ByteBuffer wb = wrapper(a, bo);

@@ -2761,12 +2930,11 @@
      ShortVector fromArray(VectorSpecies<Short> species,
                                     short[] a, int offset,
                                     VectorMask<Short> m) {
          ShortSpecies vsp = (ShortSpecies) species;
          if (offset >= 0 && offset <= (a.length - species.length())) {
-             ShortVector zero = vsp.zero();
-             return zero.blend(zero.fromArray0(a, offset), m);
+             return vsp.dummyVector().fromArray0(a, offset, m);
          }
  
          // FIXME: optimize
          checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
          return vsp.vOp(m, i -> a[offset + i]);

@@ -2911,12 +3079,11 @@
      ShortVector fromCharArray(VectorSpecies<Short> species,
                                         char[] a, int offset,
                                         VectorMask<Short> m) {
          ShortSpecies vsp = (ShortSpecies) species;
          if (offset >= 0 && offset <= (a.length - species.length())) {
-             ShortVector zero = vsp.zero();
-             return zero.blend(zero.fromCharArray0(a, offset), m);
+             return vsp.dummyVector().fromCharArray0(a, offset, m);
          }
  
          // FIXME: optimize
          checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
          return vsp.vOp(m, i -> (short) a[offset + i]);

@@ -3097,13 +3264,11 @@
                                          ByteBuffer bb, int offset,
                                          ByteOrder bo,
                                          VectorMask<Short> m) {
          ShortSpecies vsp = (ShortSpecies) species;
          if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) {
-             ShortVector zero = vsp.zero();
-             ShortVector v = zero.fromByteBuffer0(bb, offset);
-             return zero.blend(v.maybeSwap(bo), m);
+             return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo);
          }
  
          // FIXME: optimize
          checkMaskFromIndexSize(offset, vsp, m, 2, bb.limit());
          ByteBuffer wb = wrapper(bb, bo);

@@ -3171,14 +3336,13 @@
      void intoArray(short[] a, int offset,
                     VectorMask<Short> m) {
          if (m.allTrue()) {
              intoArray(a, offset);
          } else {
-             // FIXME: optimize
              ShortSpecies vsp = vspecies();
              checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
-             stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v);
+             intoArray0(a, offset, m);
          }
      }
  
      /**
       * Scatters this vector into an array of type {@code short[]}

@@ -3319,14 +3483,13 @@
      void intoCharArray(char[] a, int offset,
                         VectorMask<Short> m) {
          if (m.allTrue()) {
              intoCharArray(a, offset);
          } else {
-             // FIXME: optimize
              ShortSpecies vsp = vspecies();
              checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
-             stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = (char) v);
+             intoCharArray0(a, offset, m);
          }
      }
  
      /**
       * Scatters this vector into an array of type {@code char[]}

@@ -3436,16 +3599,13 @@
                         ByteOrder bo,
                         VectorMask<Short> m) {
          if (m.allTrue()) {
              intoByteArray(a, offset, bo);
          } else {
-             // FIXME: optimize
              ShortSpecies vsp = vspecies();
              checkMaskFromIndexSize(offset, vsp, m, 2, a.length);
-             ByteBuffer wb = wrapper(a, bo);
-             this.stOp(wb, offset, m,
-                     (wb_, o, i, e) -> wb_.putShort(o + i * 2, e));
+             maybeSwap(bo).intoByteArray0(a, offset, m);
          }
      }
  
      /**
       * {@inheritDoc} <!--workaround-->

@@ -3453,11 +3613,11 @@
      @Override
      @ForceInline
      public final
      void intoByteBuffer(ByteBuffer bb, int offset,
                          ByteOrder bo) {
-         if (bb.isReadOnly()) {
+         if (ScopedMemoryAccess.isReadOnly(bb)) {
              throw new ReadOnlyBufferException();
          }
          offset = checkFromIndexSize(offset, byteSize(), bb.limit());
          maybeSwap(bo).intoByteBuffer0(bb, offset);
      }

@@ -3472,19 +3632,16 @@
                          ByteOrder bo,
                          VectorMask<Short> m) {
          if (m.allTrue()) {
              intoByteBuffer(bb, offset, bo);
          } else {
-             // FIXME: optimize
              if (bb.isReadOnly()) {
                  throw new ReadOnlyBufferException();
              }
              ShortSpecies vsp = vspecies();
              checkMaskFromIndexSize(offset, vsp, m, 2, bb.limit());
-             ByteBuffer wb = wrapper(bb, bo);
-             this.stOp(wb, offset, m,
-                     (wb_, o, i, e) -> wb_.putShort(o + i * 2, e));
+             maybeSwap(bo).intoByteBuffer0(bb, offset, m);
          }
      }
  
      // ================================================
  

@@ -3518,10 +3675,28 @@
              a, offset, vsp,
              (arr, off, s) -> s.ldOp(arr, off,
                                      (arr_, off_, i) -> arr_[off_ + i]));
      }
  
+     /*package-private*/
+     abstract
+     ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     ShortVector fromArray0Template(Class<M> maskClass, short[] a, int offset, M m) {
+         m.check(species());
+         ShortSpecies vsp = vspecies();
+         return VectorSupport.loadMasked(
+             vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+             a, arrayAddress(a, offset), m,
+             a, offset, vsp,
+             (arr, off, s, vm) -> s.ldOp(arr, off, vm,
+                                         (arr_, off_, i) -> arr_[off_ + i]));
+     }
+ 
+ 
      /*package-private*/
      abstract
      ShortVector fromCharArray0(char[] a, int offset);
      @ForceInline
      final

@@ -3533,10 +3708,27 @@
              a, offset, vsp,
              (arr, off, s) -> s.ldOp(arr, off,
                                      (arr_, off_, i) -> (short) arr_[off_ + i]));
      }
  
+     /*package-private*/
+     abstract
+     ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     ShortVector fromCharArray0Template(Class<M> maskClass, char[] a, int offset, M m) {
+         m.check(species());
+         ShortSpecies vsp = vspecies();
+         return VectorSupport.loadMasked(
+                 vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+                 a, charArrayAddress(a, offset), m,
+                 a, offset, vsp,
+                 (arr, off, s, vm) -> s.ldOp(arr, off, vm,
+                                             (arr_, off_, i) -> (short) arr_[off_ + i]));
+     }
+ 
  
      @Override
      abstract
      ShortVector fromByteArray0(byte[] a, int offset);
      @ForceInline

@@ -3552,10 +3744,29 @@
                  return s.ldOp(wb, off,
                          (wb_, o, i) -> wb_.getShort(o + i * 2));
              });
      }
  
+     abstract
+     ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     ShortVector fromByteArray0Template(Class<M> maskClass, byte[] a, int offset, M m) {
+         ShortSpecies vsp = vspecies();
+         m.check(vsp);
+         return VectorSupport.loadMasked(
+             vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+             a, byteArrayAddress(a, offset), m,
+             a, offset, vsp,
+             (arr, off, s, vm) -> {
+                 ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN);
+                 return s.ldOp(wb, off, vm,
+                         (wb_, o, i) -> wb_.getShort(o + i * 2));
+             });
+     }
+ 
      abstract
      ShortVector fromByteBuffer0(ByteBuffer bb, int offset);
      @ForceInline
      final
      ShortVector fromByteBuffer0Template(ByteBuffer bb, int offset) {

@@ -3568,10 +3779,28 @@
                      return s.ldOp(wb, off,
                              (wb_, o, i) -> wb_.getShort(o + i * 2));
                  });
      }
  
+     abstract
+     ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     ShortVector fromByteBuffer0Template(Class<M> maskClass, ByteBuffer bb, int offset, M m) {
+         ShortSpecies vsp = vspecies();
+         m.check(vsp);
+         return ScopedMemoryAccess.loadFromByteBufferMasked(
+                 vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+                 bb, offset, m, vsp,
+                 (buf, off, s, vm) -> {
+                     ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
+                     return s.ldOp(wb, off, vm,
+                             (wb_, o, i) -> wb_.getShort(o + i * 2));
+                 });
+     }
+ 
      // Unchecked storing operations in native byte order.
      // Caller is responsible for applying index checks, masking, and
      // byte swapping.
  
      abstract

@@ -3587,10 +3816,29 @@
              (arr, off, v)
              -> v.stOp(arr, off,
                        (arr_, off_, i, e) -> arr_[off_+i] = e));
      }
  
+     abstract
+     void intoArray0(short[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     void intoArray0Template(Class<M> maskClass, short[] a, int offset, M m) {
+         m.check(species());
+         ShortSpecies vsp = vspecies();
+         VectorSupport.storeMasked(
+             vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+             a, arrayAddress(a, offset),
+             this, m, a, offset,
+             (arr, off, v, vm)
+             -> v.stOp(arr, off, vm,
+                       (arr_, off_, i, e) -> arr_[off_ + i] = e));
+     }
+ 
+ 
+ 
      abstract
      void intoByteArray0(byte[] a, int offset);
      @ForceInline
      final
      void intoByteArray0Template(byte[] a, int offset) {

@@ -3604,10 +3852,29 @@
                  v.stOp(wb, off,
                          (tb_, o, i, e) -> tb_.putShort(o + i * 2, e));
              });
      }
  
+     abstract
+     void intoByteArray0(byte[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     void intoByteArray0Template(Class<M> maskClass, byte[] a, int offset, M m) {
+         ShortSpecies vsp = vspecies();
+         m.check(vsp);
+         VectorSupport.storeMasked(
+             vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+             a, byteArrayAddress(a, offset),
+             this, m, a, offset,
+             (arr, off, v, vm) -> {
+                 ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN);
+                 v.stOp(wb, off, vm,
+                         (tb_, o, i, e) -> tb_.putShort(o + i * 2, e));
+             });
+     }
+ 
      @ForceInline
      final
      void intoByteBuffer0(ByteBuffer bb, int offset) {
          ShortSpecies vsp = vspecies();
          ScopedMemoryAccess.storeIntoByteBuffer(

@@ -3618,10 +3885,46 @@
                      v.stOp(wb, off,
                              (wb_, o, i, e) -> wb_.putShort(o + i * 2, e));
                  });
      }
  
+     abstract
+     void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     void intoByteBuffer0Template(Class<M> maskClass, ByteBuffer bb, int offset, M m) {
+         ShortSpecies vsp = vspecies();
+         m.check(vsp);
+         ScopedMemoryAccess.storeIntoByteBufferMasked(
+                 vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+                 this, m, bb, offset,
+                 (buf, off, v, vm) -> {
+                     ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
+                     v.stOp(wb, off, vm,
+                             (wb_, o, i, e) -> wb_.putShort(o + i * 2, e));
+                 });
+     }
+ 
+     /*package-private*/
+     abstract
+     void intoCharArray0(char[] a, int offset, VectorMask<Short> m);
+     @ForceInline
+     final
+     <M extends VectorMask<Short>>
+     void intoCharArray0Template(Class<M> maskClass, char[] a, int offset, M m) {
+         m.check(species());
+         ShortSpecies vsp = vspecies();
+         VectorSupport.storeMasked(
+             vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
+             a, charArrayAddress(a, offset),
+             this, m, a, offset,
+             (arr, off, v, vm)
+             -> v.stOp(arr, off, vm,
+                       (arr_, off_, i, e) -> arr_[off_ + i] = (char) e));
+     }
+ 
      // End of low-level memory operations.
  
      private static
      void checkMaskFromIndexSize(int offset,
                                  ShortSpecies vsp,

@@ -3952,11 +4255,11 @@
          }
  
          /*package-private*/
          @ForceInline
          <M> ShortVector ldOp(M memory, int offset,
-                                       AbstractMask<Short> m,
+                                       VectorMask<Short> m,
                                        FLdOp<M> f) {
              return dummyVector().ldOp(memory, offset, m, f);
          }
  
          /*package-private*/
< prev index next >