--- old/src/hotspot/share/opto/vectornode.cpp 2018-04-20 10:39:30.464813618 -0700 +++ new/src/hotspot/share/opto/vectornode.cpp 2018-04-20 10:39:30.324813619 -0700 @@ -685,8 +685,14 @@ vopc = Op_XorReductionV; break; case Op_SubI: - assert(bt == T_INT, "must be"); - vopc = Op_SubReductionV; + switch(bt) { + case T_BYTE: + case T_SHORT: + case T_INT: + vopc = Op_SubReductionV; + break; + default: ShouldNotReachHere(); return 0; + } break; case Op_SubL: assert(bt == T_LONG, "must be"); --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 2018-04-20 10:39:30.844813617 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 2018-04-20 10:39:30.704813618 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((byte) -1, (i, a, b) -> (byte) (a & b))); } + @Override + @ForceInline + public byte subAll() { + return (byte) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Byte128Vector.class, byte.class, LENGTH, + this, + v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java 2018-04-20 10:39:31.200813616 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java 2018-04-20 10:39:31.060813616 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((byte) -1, (i, a, b) -> (byte) (a & b))); } + @Override + @ForceInline + public byte subAll() { + return (byte) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Byte256Vector.class, byte.class, LENGTH, + this, + v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java 2018-04-20 10:39:31.532813614 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java 2018-04-20 10:39:31.392813615 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((byte) -1, (i, a, b) -> (byte) (a & b))); } + @Override + @ForceInline + public byte subAll() { + return (byte) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Byte512Vector.class, byte.class, LENGTH, + this, + v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java 2018-04-20 10:39:31.868813613 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java 2018-04-20 10:39:31.728813614 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((byte) -1, (i, a, b) -> (byte) (a & b))); } + @Override + @ForceInline + public byte subAll() { + return (byte) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Byte64Vector.class, byte.class, LENGTH, + this, + v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2018-04-20 10:39:32.200813612 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2018-04-20 10:39:32.060813612 -0700 @@ -482,6 +482,15 @@ @Override @ForceInline + public int subAll() { + return (int) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Int128Vector.class, int.class, LENGTH, + this, + v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); + } + + @Override + @ForceInline public int mulAll() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int128Vector.class, int.class, LENGTH, @@ -507,15 +516,6 @@ v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a ^ b))); } - @Override - @ForceInline - public int subAll() { - return (int) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Int128Vector.class, int.class, LENGTH, - this, - v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java 2018-04-20 10:39:32.536813611 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java 2018-04-20 10:39:32.396813611 -0700 @@ -482,6 +482,15 @@ @Override @ForceInline + public int subAll() { + return (int) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Int256Vector.class, int.class, LENGTH, + this, + v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); + } + + @Override + @ForceInline public int mulAll() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int256Vector.class, int.class, LENGTH, @@ -507,15 +516,6 @@ v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a ^ b))); } - @Override - @ForceInline - public int subAll() { - return (int) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Int256Vector.class, int.class, LENGTH, - this, - v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java 2018-04-20 10:39:32.872813609 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java 2018-04-20 10:39:32.732813610 -0700 @@ -482,6 +482,15 @@ @Override @ForceInline + public int subAll() { + return (int) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Int512Vector.class, int.class, LENGTH, + this, + v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); + } + + @Override + @ForceInline public int mulAll() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int512Vector.class, int.class, LENGTH, @@ -507,15 +516,6 @@ v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a ^ b))); } - @Override - @ForceInline - public int subAll() { - return (int) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Int512Vector.class, int.class, LENGTH, - this, - v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java 2018-04-20 10:39:33.204813608 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java 2018-04-20 10:39:33.064813609 -0700 @@ -482,6 +482,15 @@ @Override @ForceInline + public int subAll() { + return (int) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Int64Vector.class, int.class, LENGTH, + this, + v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); + } + + @Override + @ForceInline public int mulAll() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int64Vector.class, int.class, LENGTH, @@ -507,15 +516,6 @@ v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a ^ b))); } - @Override - @ForceInline - public int subAll() { - return (int) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Int64Vector.class, int.class, LENGTH, - this, - v -> (long) v.rOp((int) 0, (i, a, b) -> (int) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java 2018-04-20 10:39:33.540813607 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java 2018-04-20 10:39:33.396813607 -0700 @@ -445,6 +445,15 @@ @Override @ForceInline + public long subAll() { + return (long) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Long128Vector.class, long.class, LENGTH, + this, + v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); + } + + @Override + @ForceInline public long mulAll() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long128Vector.class, long.class, LENGTH, @@ -470,15 +479,6 @@ v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a ^ b))); } - @Override - @ForceInline - public long subAll() { - return (long) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Long128Vector.class, long.class, LENGTH, - this, - v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java 2018-04-20 10:39:33.876813605 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java 2018-04-20 10:39:33.732813606 -0700 @@ -445,6 +445,15 @@ @Override @ForceInline + public long subAll() { + return (long) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Long256Vector.class, long.class, LENGTH, + this, + v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); + } + + @Override + @ForceInline public long mulAll() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long256Vector.class, long.class, LENGTH, @@ -470,15 +479,6 @@ v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a ^ b))); } - @Override - @ForceInline - public long subAll() { - return (long) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Long256Vector.class, long.class, LENGTH, - this, - v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java 2018-04-20 10:39:34.248813604 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java 2018-04-20 10:39:34.108813605 -0700 @@ -445,6 +445,15 @@ @Override @ForceInline + public long subAll() { + return (long) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Long512Vector.class, long.class, LENGTH, + this, + v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); + } + + @Override + @ForceInline public long mulAll() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long512Vector.class, long.class, LENGTH, @@ -470,15 +479,6 @@ v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a ^ b))); } - @Override - @ForceInline - public long subAll() { - return (long) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Long512Vector.class, long.class, LENGTH, - this, - v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java 2018-04-20 10:39:34.584813603 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java 2018-04-20 10:39:34.444813603 -0700 @@ -445,6 +445,15 @@ @Override @ForceInline + public long subAll() { + return (long) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Long64Vector.class, long.class, LENGTH, + this, + v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); + } + + @Override + @ForceInline public long mulAll() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long64Vector.class, long.class, LENGTH, @@ -470,15 +479,6 @@ v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a ^ b))); } - @Override - @ForceInline - public long subAll() { - return (long) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, Long64Vector.class, long.class, LENGTH, - this, - v -> (long) v.rOp((long) 0, (i, a, b) -> (long) (a - b))); - } - // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java 2018-04-20 10:39:34.920813601 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java 2018-04-20 10:39:34.776813602 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((short) -1, (i, a, b) -> (short) (a & b))); } + @Override + @ForceInline + public short subAll() { + return (short) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Short128Vector.class, short.class, LENGTH, + this, + v -> (long) v.rOp((short) 0, (i, a, b) -> (short) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java 2018-04-20 10:39:35.252813600 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java 2018-04-20 10:39:35.112813601 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((short) -1, (i, a, b) -> (short) (a & b))); } + @Override + @ForceInline + public short subAll() { + return (short) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Short256Vector.class, short.class, LENGTH, + this, + v -> (long) v.rOp((short) 0, (i, a, b) -> (short) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java 2018-04-20 10:39:35.584813599 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java 2018-04-20 10:39:35.444813599 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((short) -1, (i, a, b) -> (short) (a & b))); } + @Override + @ForceInline + public short subAll() { + return (short) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Short512Vector.class, short.class, LENGTH, + this, + v -> (long) v.rOp((short) 0, (i, a, b) -> (short) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java 2018-04-20 10:39:35.920813598 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java 2018-04-20 10:39:35.776813598 -0700 @@ -443,6 +443,15 @@ v -> (long) v.rOp((short) -1, (i, a, b) -> (short) (a & b))); } + @Override + @ForceInline + public short subAll() { + return (short) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, Short64Vector.class, short.class, LENGTH, + this, + v -> (long) v.rOp((short) 0, (i, a, b) -> (short) (a - b))); + } + // Memory operations @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template 2018-04-20 10:39:36.252813596 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template 2018-04-20 10:39:36.112813597 -0700 @@ -594,6 +594,15 @@ this, v -> (long) v.rOp(($type$) -1, (i, a, b) -> ($type$) (a & b))); } + + @Override + @ForceInline + public $type$ subAll() { + return ($type$) VectorIntrinsics.reductionCoerced( + VECTOR_OP_SUB, $vectortype$.class, $type$.class, LENGTH, + this, + v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a - b))); + } #end[BITWISE] #if[intOrLong] @@ -623,15 +632,6 @@ this, v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a ^ b))); } - - @Override - @ForceInline - public $type$ subAll() { - return ($type$) VectorIntrinsics.reductionCoerced( - VECTOR_OP_SUB, $vectortype$.class, $type$.class, LENGTH, - this, - v -> (long) v.rOp(($type$) 0, (i, a, b) -> ($type$) (a - b))); - } #end[intOrLong] #if[FP] @Override