--- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java 2019-04-26 14:48:56.333823500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java 2019-04-26 14:48:55.755806700 -0700 @@ -125,7 +125,7 @@ Class eType = species.elementType(); if (eType == byte.class) { - if (species.boxType() == ByteMaxVector.class) + if (species.vectorType() == ByteMaxVector.class) return (VectorMask) ByteMaxVector.ByteMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Byte64Vector.Byte64Mask.TRUE_MASK; @@ -135,7 +135,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == short.class) { - if (species.boxType() == ShortMaxVector.class) + if (species.vectorType() == ShortMaxVector.class) return (VectorMask) ShortMaxVector.ShortMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Short64Vector.Short64Mask.TRUE_MASK; @@ -145,7 +145,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == int.class) { - if (species.boxType() == IntMaxVector.class) + if (species.vectorType() == IntMaxVector.class) return (VectorMask) IntMaxVector.IntMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Int64Vector.Int64Mask.TRUE_MASK; @@ -155,7 +155,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == long.class) { - if (species.boxType() == LongMaxVector.class) + if (species.vectorType() == LongMaxVector.class) return (VectorMask) LongMaxVector.LongMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Long64Vector.Long64Mask.TRUE_MASK; @@ -165,7 +165,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == float.class) { - if (species.boxType() == FloatMaxVector.class) + if (species.vectorType() == FloatMaxVector.class) return (VectorMask) FloatMaxVector.FloatMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Float64Vector.Float64Mask.TRUE_MASK; @@ -175,7 +175,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == double.class) { - if (species.boxType() == DoubleMaxVector.class) + if (species.vectorType() == DoubleMaxVector.class) return (VectorMask) DoubleMaxVector.DoubleMaxMask.TRUE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Double64Vector.Double64Mask.TRUE_MASK; @@ -195,7 +195,7 @@ Class eType = species.elementType(); if (eType == byte.class) { - if (species.boxType() == ByteMaxVector.class) + if (species.vectorType() == ByteMaxVector.class) return (VectorMask) ByteMaxVector.ByteMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Byte64Vector.Byte64Mask.FALSE_MASK; @@ -205,7 +205,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == short.class) { - if (species.boxType() == ShortMaxVector.class) + if (species.vectorType() == ShortMaxVector.class) return (VectorMask) ShortMaxVector.ShortMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Short64Vector.Short64Mask.FALSE_MASK; @@ -215,7 +215,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == int.class) { - if (species.boxType() == IntMaxVector.class) + if (species.vectorType() == IntMaxVector.class) return (VectorMask) IntMaxVector.IntMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Int64Vector.Int64Mask.FALSE_MASK; @@ -225,7 +225,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == long.class) { - if (species.boxType() == LongMaxVector.class) + if (species.vectorType() == LongMaxVector.class) return (VectorMask) LongMaxVector.LongMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Long64Vector.Long64Mask.FALSE_MASK; @@ -235,7 +235,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == float.class) { - if (species.boxType() == FloatMaxVector.class) + if (species.vectorType() == FloatMaxVector.class) return (VectorMask) FloatMaxVector.FloatMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Float64Vector.Float64Mask.FALSE_MASK; @@ -245,7 +245,7 @@ default: throw new IllegalArgumentException(Integer.toString(species.bitSize())); } } else if (eType == double.class) { - if (species.boxType() == DoubleMaxVector.class) + if (species.vectorType() == DoubleMaxVector.class) return (VectorMask) DoubleMaxVector.DoubleMaxMask.FALSE_MASK; switch (species.bitSize()) { case 64: return (VectorMask) Double64Vector.Double64Mask.FALSE_MASK; --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java 2019-04-26 14:49:01.107538700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractSpecies.java 2019-04-26 14:49:00.476780900 -0700 @@ -46,14 +46,14 @@ @Stable protected final int elementSize; @Stable - protected final Class boxType; + protected final Class vectorType; @Stable protected final Class maskType; @Stable protected final VectorShape indexShape; AbstractSpecies(VectorShape shape, Class elementType, int elementSize, - Class boxType, Class maskType, Function> maskFactory, + Class vectorType, Class maskType, Function> maskFactory, Function> shuffleFromOpFactory, fShuffleFromArray shuffleFromArrayFactory) { @@ -64,13 +64,12 @@ this.shape = shape; this.elementType = elementType; this.elementSize = elementSize; - this.boxType = boxType; + this.vectorType = vectorType; this.maskType = maskType; - if (boxType == Long64Vector.class || boxType == Double64Vector.class) { + if (vectorType == Long64Vector.class || vectorType == Double64Vector.class) { indexShape = VectorShape.S_64_BIT; - } - else { + } else { int bitSize = Vector.bitSizeForVectorLength(int.class, shape.bitSize() / elementSize); indexShape = VectorShape.forBitSize(bitSize); } @@ -96,8 +95,8 @@ @Override @ForceInline - public Class boxType() { - return boxType; + public Class vectorType() { + return vectorType; } @Override --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 2019-04-26 14:49:05.765525100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java 2019-04-26 14:49:05.182538500 -0700 @@ -154,7 +154,7 @@ return VectorIntrinsics.cast( Byte128Vector.class, byte.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -292,7 +292,7 @@ @ForceInline public ByteVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) { return VectorIntrinsics.reinterpret( Byte128Vector.class, byte.class, LENGTH, @@ -301,7 +301,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) { return VectorIntrinsics.reinterpret( Byte128Vector.class, byte.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) { return VectorIntrinsics.reinterpret( Byte128Vector.class, byte.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) { return VectorIntrinsics.reinterpret( Byte128Vector.class, byte.class, LENGTH, @@ -329,7 +329,7 @@ (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) { return VectorIntrinsics.reinterpret( Byte128Vector.class, byte.class, LENGTH, @@ -656,48 +656,76 @@ @Override @ForceInline - public Byte128Vector shiftL(int s) { + public Byte128Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Byte128Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7)))); } @Override @ForceInline - public Byte128Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Byte128Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Byte128Vector shiftR(int s) { + public Byte128Vector shiftLeft(Vector s) { + Byte128Vector shiftv = (Byte128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7))); + } + + @Override + @ForceInline + public Byte128Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Byte128Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public Byte128Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Byte128Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Byte128Vector aShiftR(int s) { + public Byte128Vector shiftRight(Vector s) { + Byte128Vector shiftv = (Byte128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public Byte128Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Byte128Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7)))); + } + + @Override + @ForceInline + public Byte128Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Byte128Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Byte128Vector shiftArithmeticRight(Vector s) { + Byte128Vector shiftv = (Byte128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7))); } + // Ternary operations @@ -705,7 +733,7 @@ @Override @ForceInline - public byte addAll() { + public byte addLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Byte128Vector.class, byte.class, LENGTH, this, @@ -714,7 +742,7 @@ @Override @ForceInline - public byte andAll() { + public byte andLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Byte128Vector.class, byte.class, LENGTH, this, @@ -723,13 +751,13 @@ @Override @ForceInline - public byte andAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andAll(); + public byte andLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andLanes(); } @Override @ForceInline - public byte minAll() { + public byte minLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Byte128Vector.class, byte.class, LENGTH, this, @@ -738,7 +766,7 @@ @Override @ForceInline - public byte maxAll() { + public byte maxLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Byte128Vector.class, byte.class, LENGTH, this, @@ -747,7 +775,7 @@ @Override @ForceInline - public byte mulAll() { + public byte mulLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Byte128Vector.class, byte.class, LENGTH, this, @@ -756,7 +784,7 @@ @Override @ForceInline - public byte orAll() { + public byte orLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Byte128Vector.class, byte.class, LENGTH, this, @@ -765,13 +793,13 @@ @Override @ForceInline - public byte orAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orAll(); + public byte orLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orLanes(); } @Override @ForceInline - public byte xorAll() { + public byte xorLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Byte128Vector.class, byte.class, LENGTH, this, @@ -780,34 +808,34 @@ @Override @ForceInline - public byte xorAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorAll(); + public byte xorLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public byte addAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addAll(); + public byte addLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addLanes(); } @Override @ForceInline - public byte mulAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulAll(); + public byte mulLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public byte minAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minAll(); + public byte minLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public byte maxAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxAll(); + public byte maxLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1028,7 +1056,7 @@ @Override - public Byte128Vector rotateEL(int j) { + public Byte128Vector rotateLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1038,7 +1066,7 @@ } @Override - public Byte128Vector rotateER(int j) { + public Byte128Vector rotateLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1053,7 +1081,7 @@ } @Override - public Byte128Vector shiftEL(int j) { + public Byte128Vector shiftLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++) { @@ -1063,7 +1091,7 @@ } @Override - public Byte128Vector shiftER(int j) { + public Byte128Vector shiftLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java 2019-04-26 14:49:10.669077100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java 2019-04-26 14:49:10.053135000 -0700 @@ -154,7 +154,7 @@ return VectorIntrinsics.cast( Byte256Vector.class, byte.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -292,7 +292,7 @@ @ForceInline public ByteVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) { return VectorIntrinsics.reinterpret( Byte256Vector.class, byte.class, LENGTH, @@ -301,7 +301,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) { return VectorIntrinsics.reinterpret( Byte256Vector.class, byte.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) { return VectorIntrinsics.reinterpret( Byte256Vector.class, byte.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) { return VectorIntrinsics.reinterpret( Byte256Vector.class, byte.class, LENGTH, @@ -329,7 +329,7 @@ (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) { return VectorIntrinsics.reinterpret( Byte256Vector.class, byte.class, LENGTH, @@ -656,48 +656,76 @@ @Override @ForceInline - public Byte256Vector shiftL(int s) { + public Byte256Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Byte256Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7)))); } @Override @ForceInline - public Byte256Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Byte256Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Byte256Vector shiftR(int s) { + public Byte256Vector shiftLeft(Vector s) { + Byte256Vector shiftv = (Byte256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7))); + } + + @Override + @ForceInline + public Byte256Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Byte256Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public Byte256Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Byte256Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Byte256Vector aShiftR(int s) { + public Byte256Vector shiftRight(Vector s) { + Byte256Vector shiftv = (Byte256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public Byte256Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Byte256Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7)))); + } + + @Override + @ForceInline + public Byte256Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Byte256Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Byte256Vector shiftArithmeticRight(Vector s) { + Byte256Vector shiftv = (Byte256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7))); } + // Ternary operations @@ -705,7 +733,7 @@ @Override @ForceInline - public byte addAll() { + public byte addLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Byte256Vector.class, byte.class, LENGTH, this, @@ -714,7 +742,7 @@ @Override @ForceInline - public byte andAll() { + public byte andLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Byte256Vector.class, byte.class, LENGTH, this, @@ -723,13 +751,13 @@ @Override @ForceInline - public byte andAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andAll(); + public byte andLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andLanes(); } @Override @ForceInline - public byte minAll() { + public byte minLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Byte256Vector.class, byte.class, LENGTH, this, @@ -738,7 +766,7 @@ @Override @ForceInline - public byte maxAll() { + public byte maxLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Byte256Vector.class, byte.class, LENGTH, this, @@ -747,7 +775,7 @@ @Override @ForceInline - public byte mulAll() { + public byte mulLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Byte256Vector.class, byte.class, LENGTH, this, @@ -756,7 +784,7 @@ @Override @ForceInline - public byte orAll() { + public byte orLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Byte256Vector.class, byte.class, LENGTH, this, @@ -765,13 +793,13 @@ @Override @ForceInline - public byte orAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orAll(); + public byte orLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orLanes(); } @Override @ForceInline - public byte xorAll() { + public byte xorLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Byte256Vector.class, byte.class, LENGTH, this, @@ -780,34 +808,34 @@ @Override @ForceInline - public byte xorAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorAll(); + public byte xorLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public byte addAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addAll(); + public byte addLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addLanes(); } @Override @ForceInline - public byte mulAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulAll(); + public byte mulLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public byte minAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minAll(); + public byte minLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public byte maxAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxAll(); + public byte maxLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1028,7 +1056,7 @@ @Override - public Byte256Vector rotateEL(int j) { + public Byte256Vector rotateLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1038,7 +1066,7 @@ } @Override - public Byte256Vector rotateER(int j) { + public Byte256Vector rotateLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1053,7 +1081,7 @@ } @Override - public Byte256Vector shiftEL(int j) { + public Byte256Vector shiftLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++) { @@ -1063,7 +1091,7 @@ } @Override - public Byte256Vector shiftER(int j) { + public Byte256Vector shiftLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java 2019-04-26 14:49:15.153276600 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java 2019-04-26 14:49:14.503829600 -0700 @@ -154,7 +154,7 @@ return VectorIntrinsics.cast( Byte512Vector.class, byte.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -292,7 +292,7 @@ @ForceInline public ByteVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) { return VectorIntrinsics.reinterpret( Byte512Vector.class, byte.class, LENGTH, @@ -301,7 +301,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) { return VectorIntrinsics.reinterpret( Byte512Vector.class, byte.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) { return VectorIntrinsics.reinterpret( Byte512Vector.class, byte.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) { return VectorIntrinsics.reinterpret( Byte512Vector.class, byte.class, LENGTH, @@ -329,7 +329,7 @@ (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) { return VectorIntrinsics.reinterpret( Byte512Vector.class, byte.class, LENGTH, @@ -656,48 +656,76 @@ @Override @ForceInline - public Byte512Vector shiftL(int s) { + public Byte512Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Byte512Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7)))); } @Override @ForceInline - public Byte512Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Byte512Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Byte512Vector shiftR(int s) { + public Byte512Vector shiftLeft(Vector s) { + Byte512Vector shiftv = (Byte512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7))); + } + + @Override + @ForceInline + public Byte512Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Byte512Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public Byte512Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Byte512Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Byte512Vector aShiftR(int s) { + public Byte512Vector shiftRight(Vector s) { + Byte512Vector shiftv = (Byte512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public Byte512Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Byte512Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7)))); + } + + @Override + @ForceInline + public Byte512Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Byte512Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Byte512Vector shiftArithmeticRight(Vector s) { + Byte512Vector shiftv = (Byte512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7))); } + // Ternary operations @@ -705,7 +733,7 @@ @Override @ForceInline - public byte addAll() { + public byte addLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Byte512Vector.class, byte.class, LENGTH, this, @@ -714,7 +742,7 @@ @Override @ForceInline - public byte andAll() { + public byte andLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Byte512Vector.class, byte.class, LENGTH, this, @@ -723,13 +751,13 @@ @Override @ForceInline - public byte andAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andAll(); + public byte andLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andLanes(); } @Override @ForceInline - public byte minAll() { + public byte minLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Byte512Vector.class, byte.class, LENGTH, this, @@ -738,7 +766,7 @@ @Override @ForceInline - public byte maxAll() { + public byte maxLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Byte512Vector.class, byte.class, LENGTH, this, @@ -747,7 +775,7 @@ @Override @ForceInline - public byte mulAll() { + public byte mulLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Byte512Vector.class, byte.class, LENGTH, this, @@ -756,7 +784,7 @@ @Override @ForceInline - public byte orAll() { + public byte orLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Byte512Vector.class, byte.class, LENGTH, this, @@ -765,13 +793,13 @@ @Override @ForceInline - public byte orAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orAll(); + public byte orLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orLanes(); } @Override @ForceInline - public byte xorAll() { + public byte xorLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Byte512Vector.class, byte.class, LENGTH, this, @@ -780,34 +808,34 @@ @Override @ForceInline - public byte xorAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorAll(); + public byte xorLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public byte addAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addAll(); + public byte addLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addLanes(); } @Override @ForceInline - public byte mulAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulAll(); + public byte mulLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public byte minAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minAll(); + public byte minLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public byte maxAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxAll(); + public byte maxLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1028,7 +1056,7 @@ @Override - public Byte512Vector rotateEL(int j) { + public Byte512Vector rotateLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1038,7 +1066,7 @@ } @Override - public Byte512Vector rotateER(int j) { + public Byte512Vector rotateLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1053,7 +1081,7 @@ } @Override - public Byte512Vector shiftEL(int j) { + public Byte512Vector shiftLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++) { @@ -1063,7 +1091,7 @@ } @Override - public Byte512Vector shiftER(int j) { + public Byte512Vector shiftLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java 2019-04-26 14:49:19.712914200 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java 2019-04-26 14:49:19.126153400 -0700 @@ -154,7 +154,7 @@ return VectorIntrinsics.cast( Byte64Vector.class, byte.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -292,7 +292,7 @@ @ForceInline public ByteVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) { return VectorIntrinsics.reinterpret( Byte64Vector.class, byte.class, LENGTH, @@ -301,7 +301,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) { return VectorIntrinsics.reinterpret( Byte64Vector.class, byte.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) { return VectorIntrinsics.reinterpret( Byte64Vector.class, byte.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) { return VectorIntrinsics.reinterpret( Byte64Vector.class, byte.class, LENGTH, @@ -329,7 +329,7 @@ (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) { return VectorIntrinsics.reinterpret( Byte64Vector.class, byte.class, LENGTH, @@ -656,48 +656,76 @@ @Override @ForceInline - public Byte64Vector shiftL(int s) { + public Byte64Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Byte64Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7)))); } @Override @ForceInline - public Byte64Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Byte64Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Byte64Vector shiftR(int s) { + public Byte64Vector shiftLeft(Vector s) { + Byte64Vector shiftv = (Byte64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7))); + } + + @Override + @ForceInline + public Byte64Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Byte64Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public Byte64Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Byte64Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Byte64Vector aShiftR(int s) { + public Byte64Vector shiftRight(Vector s) { + Byte64Vector shiftv = (Byte64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public Byte64Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Byte64Vector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7)))); + } + + @Override + @ForceInline + public Byte64Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Byte64Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Byte64Vector shiftArithmeticRight(Vector s) { + Byte64Vector shiftv = (Byte64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7))); } + // Ternary operations @@ -705,7 +733,7 @@ @Override @ForceInline - public byte addAll() { + public byte addLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Byte64Vector.class, byte.class, LENGTH, this, @@ -714,7 +742,7 @@ @Override @ForceInline - public byte andAll() { + public byte andLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Byte64Vector.class, byte.class, LENGTH, this, @@ -723,13 +751,13 @@ @Override @ForceInline - public byte andAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andAll(); + public byte andLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andLanes(); } @Override @ForceInline - public byte minAll() { + public byte minLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Byte64Vector.class, byte.class, LENGTH, this, @@ -738,7 +766,7 @@ @Override @ForceInline - public byte maxAll() { + public byte maxLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Byte64Vector.class, byte.class, LENGTH, this, @@ -747,7 +775,7 @@ @Override @ForceInline - public byte mulAll() { + public byte mulLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Byte64Vector.class, byte.class, LENGTH, this, @@ -756,7 +784,7 @@ @Override @ForceInline - public byte orAll() { + public byte orLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Byte64Vector.class, byte.class, LENGTH, this, @@ -765,13 +793,13 @@ @Override @ForceInline - public byte orAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orAll(); + public byte orLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orLanes(); } @Override @ForceInline - public byte xorAll() { + public byte xorLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Byte64Vector.class, byte.class, LENGTH, this, @@ -780,34 +808,34 @@ @Override @ForceInline - public byte xorAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorAll(); + public byte xorLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public byte addAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addAll(); + public byte addLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addLanes(); } @Override @ForceInline - public byte mulAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulAll(); + public byte mulLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public byte minAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minAll(); + public byte minLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public byte maxAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxAll(); + public byte maxLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1028,7 +1056,7 @@ @Override - public Byte64Vector rotateEL(int j) { + public Byte64Vector rotateLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1038,7 +1066,7 @@ } @Override - public Byte64Vector rotateER(int j) { + public Byte64Vector rotateLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1053,7 +1081,7 @@ } @Override - public Byte64Vector shiftEL(int j) { + public Byte64Vector shiftLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++) { @@ -1063,7 +1091,7 @@ } @Override - public Byte64Vector shiftER(int j) { + public Byte64Vector shiftLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java 2019-04-26 14:49:24.547879700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java 2019-04-26 14:49:23.908426100 -0700 @@ -154,7 +154,7 @@ return VectorIntrinsics.cast( ByteMaxVector.class, byte.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -292,7 +292,7 @@ @ForceInline public ByteVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Byte64Vector.class)) { return VectorIntrinsics.reinterpret( ByteMaxVector.class, byte.class, LENGTH, @@ -301,7 +301,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Byte128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Byte128Vector.class)) { return VectorIntrinsics.reinterpret( ByteMaxVector.class, byte.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Byte256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Byte256Vector.class)) { return VectorIntrinsics.reinterpret( ByteMaxVector.class, byte.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Byte512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Byte512Vector.class)) { return VectorIntrinsics.reinterpret( ByteMaxVector.class, byte.class, LENGTH, @@ -329,7 +329,7 @@ (species, vector) -> (ByteVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ByteMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ByteMaxVector.class)) { return VectorIntrinsics.reinterpret( ByteMaxVector.class, byte.class, LENGTH, @@ -656,48 +656,76 @@ @Override @ForceInline - public ByteMaxVector shiftL(int s) { + public ByteMaxVector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, ByteMaxVector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a << (i & 0x7)))); } @Override @ForceInline - public ByteMaxVector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public ByteMaxVector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public ByteMaxVector shiftR(int s) { + public ByteMaxVector shiftLeft(Vector s) { + ByteMaxVector shiftv = (ByteMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a << (b & 0x7))); + } + + @Override + @ForceInline + public ByteMaxVector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, ByteMaxVector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public ByteMaxVector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public ByteMaxVector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public ByteMaxVector aShiftR(int s) { + public ByteMaxVector shiftRight(Vector s) { + ByteMaxVector shiftv = (ByteMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public ByteMaxVector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, ByteMaxVector.class, byte.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 0x7)))); + } + + @Override + @ForceInline + public ByteMaxVector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public ByteMaxVector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public ByteMaxVector shiftArithmeticRight(Vector s) { + ByteMaxVector shiftv = (ByteMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ByteVector.broadcast(SPECIES, (byte) 0x7)); + return this.bOp(shiftv, (i, a, b) -> (byte) (a >> (b & 0x7))); } + // Ternary operations @@ -705,7 +733,7 @@ @Override @ForceInline - public byte addAll() { + public byte addLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, ByteMaxVector.class, byte.class, LENGTH, this, @@ -714,7 +742,7 @@ @Override @ForceInline - public byte andAll() { + public byte andLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, ByteMaxVector.class, byte.class, LENGTH, this, @@ -723,13 +751,13 @@ @Override @ForceInline - public byte andAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andAll(); + public byte andLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) -1).blend(this, m).andLanes(); } @Override @ForceInline - public byte minAll() { + public byte minLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, ByteMaxVector.class, byte.class, LENGTH, this, @@ -738,7 +766,7 @@ @Override @ForceInline - public byte maxAll() { + public byte maxLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, ByteMaxVector.class, byte.class, LENGTH, this, @@ -747,7 +775,7 @@ @Override @ForceInline - public byte mulAll() { + public byte mulLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, ByteMaxVector.class, byte.class, LENGTH, this, @@ -756,7 +784,7 @@ @Override @ForceInline - public byte orAll() { + public byte orLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, ByteMaxVector.class, byte.class, LENGTH, this, @@ -765,13 +793,13 @@ @Override @ForceInline - public byte orAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orAll(); + public byte orLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).orLanes(); } @Override @ForceInline - public byte xorAll() { + public byte xorLanes() { return (byte) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, ByteMaxVector.class, byte.class, LENGTH, this, @@ -780,34 +808,34 @@ @Override @ForceInline - public byte xorAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorAll(); + public byte xorLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public byte addAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addAll(); + public byte addLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 0).blend(this, m).addLanes(); } @Override @ForceInline - public byte mulAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulAll(); + public byte mulLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, (byte) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public byte minAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minAll(); + public byte minLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public byte maxAll(VectorMask m) { - return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxAll(); + public byte maxLanes(VectorMask m) { + return ByteVector.broadcast(SPECIES, Byte.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1028,7 +1056,7 @@ @Override - public ByteMaxVector rotateEL(int j) { + public ByteMaxVector rotateLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1038,7 +1066,7 @@ } @Override - public ByteMaxVector rotateER(int j) { + public ByteMaxVector rotateLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length(); i++){ @@ -1053,7 +1081,7 @@ } @Override - public ByteMaxVector shiftEL(int j) { + public ByteMaxVector shiftLanesLeft(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++) { @@ -1063,7 +1091,7 @@ } @Override - public ByteMaxVector shiftER(int j) { + public ByteMaxVector shiftLanesRight(int j) { byte[] vec = getElements(); byte[] res = new byte[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java 2019-04-26 14:49:29.250417700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java 2019-04-26 14:49:28.644023000 -0700 @@ -111,7 +111,7 @@ @ForceInline @SuppressWarnings("unchecked") public static ByteVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), byte.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), byte.class, species.length(), 0, species, ((bits, s) -> ((ByteSpecies)s).op(i -> (byte)bits))); } @@ -141,7 +141,7 @@ public static ByteVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), byte.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), byte.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -199,7 +199,7 @@ public static ByteVector fromArray(VectorSpecies species, byte[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), byte.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), byte.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((ByteSpecies)s).op(n -> c[idx + n])); @@ -312,7 +312,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), byte.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), byte.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -368,7 +368,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -376,7 +376,7 @@ @SuppressWarnings("unchecked") public static ByteVector broadcast(VectorSpecies species, byte e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), byte.class, species.length(), + (Class) species.vectorType(), byte.class, species.length(), e, species, ((bits, sp) -> ((ByteSpecies)sp).op(i -> (byte)bits))); } @@ -400,7 +400,7 @@ public static ByteVector scalars(VectorSpecies species, byte... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), byte.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), byte.class, species.length(), es, Unsafe.ARRAY_BYTE_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((ByteSpecies)sp).op(n -> c[idx + n])); @@ -778,25 +778,25 @@ * {@inheritDoc} */ @Override - public abstract ByteVector rotateEL(int i); + public abstract ByteVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract ByteVector rotateER(int i); + public abstract ByteVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract ByteVector shiftEL(int i); + public abstract ByteVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract ByteVector shiftER(int i); + public abstract ByteVector shiftLanesRight(int i); @@ -976,16 +976,16 @@ *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. * * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftL(int s); + public abstract ByteVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, @@ -993,18 +993,53 @@ *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftL(int s, VectorMask m); + public abstract ByteVector shiftLeft(int s, VectorMask m); + /** + * Logically left shifts this vector by an input vector. + *

+ * This is a lane-wise binary operation which applies the primitive logical left shift + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @return the result of logically left shifting this vector by the input + * vector + */ + public abstract ByteVector shiftLeft(Vector v); + + /** + * Logically left shifts this vector by an input vector, selecting lane + * elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive logical left shift + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of logically left shifting this vector by the input + * vector + */ + public ByteVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); + } // logical, or unsigned, shift right @@ -1014,8 +1049,8 @@ *

* This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. * @@ -1023,7 +1058,7 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftR(int s); + public abstract ByteVector shiftRight(int s); /** * Logically right shifts (or unsigned right shifts) this vector by the @@ -1032,8 +1067,8 @@ *

* This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. * @@ -1042,8 +1077,44 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector shiftR(int s, VectorMask m); + public abstract ByteVector shiftRight(int s, VectorMask m); + + /** + * Logically right shifts (or unsigned right shifts) this vector by an + * input vector. + *

+ * This is a lane-wise binary operation which applies the primitive logical right shift + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @return the result of logically right shifting this vector by the + * input vector + */ + public abstract ByteVector shiftRight(Vector v); + /** + * Logically right shifts (or unsigned right shifts) this vector by an + * input vector, selecting lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive logical right shift + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of logically right shifting this vector by the + * input vector + */ + public ByteVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); + } /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1060,7 +1131,7 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector aShiftR(int s); + public abstract ByteVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1079,8 +1150,120 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ByteVector aShiftR(int s, VectorMask m); + public abstract ByteVector shiftArithmeticRight(int s, VectorMask m); + + /** + * Arithmetically right shifts (or signed right shifts) this vector by an + * input vector. + *

+ * This is a lane-wise binary operation which applies the primitive arithmetic right + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public abstract ByteVector shiftArithmeticRight(Vector v); + + /** + * Arithmetically right shifts (or signed right shifts) this vector by an + * input vector, selecting lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive arithmetic right + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public ByteVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); + } + + /** + * Rotates left this vector by the broadcast of an input scalar. + *

+ * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. + * + * @param s the input scalar; the number of the bits to rotate left + * @return the result of rotating left this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ByteVector rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); + } + + /** + * Rotates left this vector by the broadcast of an input scalar, selecting + * lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. + * + * @param s the input scalar; the number of the bits to rotate left + * @param m the mask controlling lane selection + * @return the result of rotating left this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ByteVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); + } + /** + * Rotates right this vector by the broadcast of an input scalar. + *

+ * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. + * + * @param s the input scalar; the number of the bits to rotate right + * @return the result of rotating right this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ByteVector rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); + } + + /** + * Rotates right this vector by the broadcast of an input scalar, selecting + * lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. + * + * @param s the input scalar; the number of the bits to rotate right + * @param m the mask controlling lane selection + * @return the result of rotating right this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ByteVector rotateRight(int s, VectorMask m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); + } /** * {@inheritDoc} @@ -1117,7 +1300,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract byte addAll(); + public abstract byte addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1130,7 +1313,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract byte addAll(VectorMask m); + public abstract byte addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1141,7 +1324,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract byte mulAll(); + public abstract byte mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1154,7 +1337,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract byte mulAll(VectorMask m); + public abstract byte mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1166,7 +1349,7 @@ * * @return the minimum lane element of this vector */ - public abstract byte minAll(); + public abstract byte minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1180,7 +1363,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract byte minAll(VectorMask m); + public abstract byte minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1192,7 +1375,7 @@ * * @return the maximum lane element of this vector */ - public abstract byte maxAll(); + public abstract byte maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1206,7 +1389,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract byte maxAll(VectorMask m); + public abstract byte maxLanes(VectorMask m); /** * Logically ORs all lane elements of this vector. @@ -1217,7 +1400,7 @@ * * @return the logical OR all the lane elements of this vector */ - public abstract byte orAll(); + public abstract byte orLanes(); /** * Logically ORs all lane elements of this vector, selecting lane elements @@ -1230,7 +1413,7 @@ * @param m the mask controlling lane selection * @return the logical OR all the lane elements of this vector */ - public abstract byte orAll(VectorMask m); + public abstract byte orLanes(VectorMask m); /** * Logically ANDs all lane elements of this vector. @@ -1241,7 +1424,7 @@ * * @return the logical AND all the lane elements of this vector */ - public abstract byte andAll(); + public abstract byte andLanes(); /** * Logically ANDs all lane elements of this vector, selecting lane elements @@ -1254,7 +1437,7 @@ * @param m the mask controlling lane selection * @return the logical AND all the lane elements of this vector */ - public abstract byte andAll(VectorMask m); + public abstract byte andLanes(VectorMask m); /** * Logically XORs all lane elements of this vector. @@ -1265,7 +1448,7 @@ * * @return the logical XOR all the lane elements of this vector */ - public abstract byte xorAll(); + public abstract byte xorLanes(); /** * Logically XORs all lane elements of this vector, selecting lane elements @@ -1278,7 +1461,7 @@ * @param m the mask controlling lane selection * @return the logical XOR all the lane elements of this vector */ - public abstract byte xorAll(VectorMask m); + public abstract byte xorLanes(VectorMask m); // Type specific accessors @@ -1425,13 +1608,13 @@ final Function vectorFactory; private ByteSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, byte.class, Byte.SIZE, boxType, maskType, maskFactory, + super(shape, byte.class, Byte.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java 2019-04-26 14:49:33.796673900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java 2019-04-26 14:49:33.151880000 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Double128Vector.class, double.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( Double128Vector.class, double.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Double128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Double128Vector.class)) { return VectorIntrinsics.reinterpret( Double128Vector.class, double.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Double256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Double256Vector.class)) { return VectorIntrinsics.reinterpret( Double128Vector.class, double.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Double512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Double512Vector.class)) { return VectorIntrinsics.reinterpret( Double128Vector.class, double.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == DoubleMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == DoubleMaxVector.class)) { return VectorIntrinsics.reinterpret( Double128Vector.class, double.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public double addAll() { + public double addLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Double128Vector.class, double.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public double mulAll() { + public double mulLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Double128Vector.class, double.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public double minAll() { + public double minLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Double128Vector.class, double.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public double maxAll() { + public double maxLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Double128Vector.class, double.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public double addAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addAll(); + public double addLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addLanes(); } @Override @ForceInline - public double mulAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulAll(); + public double mulLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public double minAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minAll(); + public double minLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public double maxAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxAll(); + public double maxLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Double128Vector rotateEL(int j) { + public Double128Vector rotateLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Double128Vector rotateER(int j) { + public Double128Vector rotateLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Double128Vector shiftEL(int j) { + public Double128Vector shiftLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Double128Vector shiftER(int j) { + public Double128Vector shiftLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java 2019-04-26 14:49:38.382466900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java 2019-04-26 14:49:37.797302800 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Double256Vector.class, double.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( Double256Vector.class, double.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Double128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Double128Vector.class)) { return VectorIntrinsics.reinterpret( Double256Vector.class, double.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Double256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Double256Vector.class)) { return VectorIntrinsics.reinterpret( Double256Vector.class, double.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Double512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Double512Vector.class)) { return VectorIntrinsics.reinterpret( Double256Vector.class, double.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == DoubleMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == DoubleMaxVector.class)) { return VectorIntrinsics.reinterpret( Double256Vector.class, double.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public double addAll() { + public double addLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Double256Vector.class, double.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public double mulAll() { + public double mulLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Double256Vector.class, double.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public double minAll() { + public double minLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Double256Vector.class, double.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public double maxAll() { + public double maxLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Double256Vector.class, double.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public double addAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addAll(); + public double addLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addLanes(); } @Override @ForceInline - public double mulAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulAll(); + public double mulLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public double minAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minAll(); + public double minLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public double maxAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxAll(); + public double maxLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Double256Vector rotateEL(int j) { + public Double256Vector rotateLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Double256Vector rotateER(int j) { + public Double256Vector rotateLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Double256Vector shiftEL(int j) { + public Double256Vector shiftLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Double256Vector shiftER(int j) { + public Double256Vector shiftLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java 2019-04-26 14:49:42.855503900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java 2019-04-26 14:49:42.282182900 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Double512Vector.class, double.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( Double512Vector.class, double.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Double128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Double128Vector.class)) { return VectorIntrinsics.reinterpret( Double512Vector.class, double.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Double256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Double256Vector.class)) { return VectorIntrinsics.reinterpret( Double512Vector.class, double.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Double512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Double512Vector.class)) { return VectorIntrinsics.reinterpret( Double512Vector.class, double.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == DoubleMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == DoubleMaxVector.class)) { return VectorIntrinsics.reinterpret( Double512Vector.class, double.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public double addAll() { + public double addLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Double512Vector.class, double.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public double mulAll() { + public double mulLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Double512Vector.class, double.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public double minAll() { + public double minLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Double512Vector.class, double.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public double maxAll() { + public double maxLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Double512Vector.class, double.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public double addAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addAll(); + public double addLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addLanes(); } @Override @ForceInline - public double mulAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulAll(); + public double mulLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public double minAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minAll(); + public double minLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public double maxAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxAll(); + public double maxLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Double512Vector rotateEL(int j) { + public Double512Vector rotateLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Double512Vector rotateER(int j) { + public Double512Vector rotateLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Double512Vector shiftEL(int j) { + public Double512Vector shiftLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Double512Vector shiftER(int j) { + public Double512Vector shiftLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java 2019-04-26 14:49:47.367686500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java 2019-04-26 14:49:46.755193700 -0700 @@ -162,7 +162,7 @@ return VectorIntrinsics.cast( Double64Vector.class, double.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -300,7 +300,7 @@ @ForceInline public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( Double64Vector.class, double.class, LENGTH, @@ -309,7 +309,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Double128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Double128Vector.class)) { return VectorIntrinsics.reinterpret( Double64Vector.class, double.class, LENGTH, @@ -318,7 +318,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Double256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Double256Vector.class)) { return VectorIntrinsics.reinterpret( Double64Vector.class, double.class, LENGTH, @@ -327,7 +327,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Double512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Double512Vector.class)) { return VectorIntrinsics.reinterpret( Double64Vector.class, double.class, LENGTH, @@ -337,7 +337,7 @@ (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == DoubleMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == DoubleMaxVector.class)) { return VectorIntrinsics.reinterpret( Double64Vector.class, double.class, LENGTH, @@ -838,7 +838,7 @@ @Override @ForceInline - public double addAll() { + public double addLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Double64Vector.class, double.class, LENGTH, this, @@ -851,7 +851,7 @@ @Override @ForceInline - public double mulAll() { + public double mulLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Double64Vector.class, double.class, LENGTH, this, @@ -864,7 +864,7 @@ @Override @ForceInline - public double minAll() { + public double minLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Double64Vector.class, double.class, LENGTH, this, @@ -877,7 +877,7 @@ @Override @ForceInline - public double maxAll() { + public double maxLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Double64Vector.class, double.class, LENGTH, this, @@ -891,27 +891,27 @@ @Override @ForceInline - public double addAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addAll(); + public double addLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addLanes(); } @Override @ForceInline - public double mulAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulAll(); + public double mulLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public double minAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minAll(); + public double minLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public double maxAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxAll(); + public double maxLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1154,7 +1154,7 @@ @Override - public Double64Vector rotateEL(int j) { + public Double64Vector rotateLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1164,7 +1164,7 @@ } @Override - public Double64Vector rotateER(int j) { + public Double64Vector rotateLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1179,7 +1179,7 @@ } @Override - public Double64Vector shiftEL(int j) { + public Double64Vector shiftLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++) { @@ -1189,7 +1189,7 @@ } @Override - public Double64Vector shiftER(int j) { + public Double64Vector shiftLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java 2019-04-26 14:49:51.934284800 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java 2019-04-26 14:49:51.346207700 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( DoubleMaxVector.class, double.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( DoubleMaxVector.class, double.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Double128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Double128Vector.class)) { return VectorIntrinsics.reinterpret( DoubleMaxVector.class, double.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Double256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Double256Vector.class)) { return VectorIntrinsics.reinterpret( DoubleMaxVector.class, double.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Double512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Double512Vector.class)) { return VectorIntrinsics.reinterpret( DoubleMaxVector.class, double.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (DoubleVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == DoubleMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == DoubleMaxVector.class)) { return VectorIntrinsics.reinterpret( DoubleMaxVector.class, double.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public double addAll() { + public double addLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, DoubleMaxVector.class, double.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public double mulAll() { + public double mulLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, DoubleMaxVector.class, double.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public double minAll() { + public double minLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, DoubleMaxVector.class, double.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public double maxAll() { + public double maxLanes() { long bits = (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, DoubleMaxVector.class, double.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public double addAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addAll(); + public double addLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 0).blend(this, m).addLanes(); } @Override @ForceInline - public double mulAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulAll(); + public double mulLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, (double) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public double minAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minAll(); + public double minLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public double maxAll(VectorMask m) { - return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxAll(); + public double maxLanes(VectorMask m) { + return DoubleVector.broadcast(SPECIES, Double.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public DoubleMaxVector rotateEL(int j) { + public DoubleMaxVector rotateLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public DoubleMaxVector rotateER(int j) { + public DoubleMaxVector rotateLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public DoubleMaxVector shiftEL(int j) { + public DoubleMaxVector shiftLanesLeft(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public DoubleMaxVector shiftER(int j) { + public DoubleMaxVector shiftLanesRight(int j) { double[] vec = getElements(); double[] res = new double[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java 2019-04-26 14:49:56.485302900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java 2019-04-26 14:49:55.887870900 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static DoubleVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), double.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), double.class, species.length(), Double.doubleToLongBits(0.0f), species, ((bits, s) -> ((DoubleSpecies)s).op(i -> Double.longBitsToDouble((long)bits)))); } @@ -142,7 +142,7 @@ public static DoubleVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), double.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), double.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static DoubleVector fromArray(VectorSpecies species, double[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), double.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), double.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_DOUBLE_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((DoubleSpecies)s).op(n -> c[idx + n])); @@ -266,8 +266,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class) species.boxType(), double.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class) species.vectorType(), double.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (double[] c, int idx, int[] iMap, int idy, VectorSpecies s) -> ((DoubleSpecies)s).op(n -> c[idx + iMap[idy+n]])); @@ -336,7 +336,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), double.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), double.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -392,7 +392,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -400,7 +400,7 @@ @SuppressWarnings("unchecked") public static DoubleVector broadcast(VectorSpecies species, double e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), double.class, species.length(), + (Class) species.vectorType(), double.class, species.length(), Double.doubleToLongBits(e), species, ((bits, sp) -> ((DoubleSpecies)sp).op(i -> Double.longBitsToDouble((long)bits)))); } @@ -424,7 +424,7 @@ public static DoubleVector scalars(VectorSpecies species, double... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), double.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), double.class, species.length(), es, Unsafe.ARRAY_DOUBLE_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((DoubleSpecies)sp).op(n -> c[idx + n])); @@ -802,25 +802,25 @@ * {@inheritDoc} */ @Override - public abstract DoubleVector rotateEL(int i); + public abstract DoubleVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract DoubleVector rotateER(int i); + public abstract DoubleVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract DoubleVector shiftEL(int i); + public abstract DoubleVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract DoubleVector shiftER(int i); + public abstract DoubleVector shiftLanesRight(int i); /** * Divides this vector by an input vector. @@ -1722,7 +1722,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract double addAll(); + public abstract double addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1744,7 +1744,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract double addAll(VectorMask m); + public abstract double addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1763,7 +1763,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract double mulAll(); + public abstract double mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1784,7 +1784,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract double mulAll(VectorMask m); + public abstract double mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1796,7 +1796,7 @@ * * @return the minimum lane element of this vector */ - public abstract double minAll(); + public abstract double minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1810,7 +1810,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract double minAll(VectorMask m); + public abstract double minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1822,7 +1822,7 @@ * * @return the maximum lane element of this vector */ - public abstract double maxAll(); + public abstract double maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1836,7 +1836,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract double maxAll(VectorMask m); + public abstract double maxLanes(VectorMask m); // Type specific accessors @@ -1980,13 +1980,13 @@ final Function vectorFactory; private DoubleSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, double.class, Double.SIZE, boxType, maskType, maskFactory, + super(shape, double.class, Double.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java 2019-04-26 14:50:01.035588100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java 2019-04-26 14:50:00.448805100 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Float128Vector.class, float.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public FloatVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Float64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Float64Vector.class)) { return VectorIntrinsics.reinterpret( Float128Vector.class, float.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Float128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Float128Vector.class)) { return VectorIntrinsics.reinterpret( Float128Vector.class, float.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Float256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Float256Vector.class)) { return VectorIntrinsics.reinterpret( Float128Vector.class, float.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Float512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Float512Vector.class)) { return VectorIntrinsics.reinterpret( Float128Vector.class, float.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == FloatMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == FloatMaxVector.class)) { return VectorIntrinsics.reinterpret( Float128Vector.class, float.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public float addAll() { + public float addLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Float128Vector.class, float.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public float mulAll() { + public float mulLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Float128Vector.class, float.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public float minAll() { + public float minLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Float128Vector.class, float.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public float maxAll() { + public float maxLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Float128Vector.class, float.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public float addAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addAll(); + public float addLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addLanes(); } @Override @ForceInline - public float mulAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulAll(); + public float mulLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public float minAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minAll(); + public float minLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public float maxAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxAll(); + public float maxLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Float128Vector rotateEL(int j) { + public Float128Vector rotateLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Float128Vector rotateER(int j) { + public Float128Vector rotateLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Float128Vector shiftEL(int j) { + public Float128Vector shiftLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Float128Vector shiftER(int j) { + public Float128Vector shiftLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java 2019-04-26 14:50:05.567167500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java 2019-04-26 14:50:04.963377900 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Float256Vector.class, float.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public FloatVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Float64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Float64Vector.class)) { return VectorIntrinsics.reinterpret( Float256Vector.class, float.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Float128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Float128Vector.class)) { return VectorIntrinsics.reinterpret( Float256Vector.class, float.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Float256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Float256Vector.class)) { return VectorIntrinsics.reinterpret( Float256Vector.class, float.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Float512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Float512Vector.class)) { return VectorIntrinsics.reinterpret( Float256Vector.class, float.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == FloatMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == FloatMaxVector.class)) { return VectorIntrinsics.reinterpret( Float256Vector.class, float.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public float addAll() { + public float addLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Float256Vector.class, float.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public float mulAll() { + public float mulLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Float256Vector.class, float.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public float minAll() { + public float minLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Float256Vector.class, float.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public float maxAll() { + public float maxLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Float256Vector.class, float.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public float addAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addAll(); + public float addLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addLanes(); } @Override @ForceInline - public float mulAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulAll(); + public float mulLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public float minAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minAll(); + public float minLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public float maxAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxAll(); + public float maxLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Float256Vector rotateEL(int j) { + public Float256Vector rotateLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Float256Vector rotateER(int j) { + public Float256Vector rotateLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Float256Vector shiftEL(int j) { + public Float256Vector shiftLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Float256Vector shiftER(int j) { + public Float256Vector shiftLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java 2019-04-26 14:50:10.048067500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java 2019-04-26 14:50:09.462100300 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Float512Vector.class, float.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public FloatVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Float64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Float64Vector.class)) { return VectorIntrinsics.reinterpret( Float512Vector.class, float.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Float128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Float128Vector.class)) { return VectorIntrinsics.reinterpret( Float512Vector.class, float.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Float256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Float256Vector.class)) { return VectorIntrinsics.reinterpret( Float512Vector.class, float.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Float512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Float512Vector.class)) { return VectorIntrinsics.reinterpret( Float512Vector.class, float.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == FloatMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == FloatMaxVector.class)) { return VectorIntrinsics.reinterpret( Float512Vector.class, float.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public float addAll() { + public float addLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Float512Vector.class, float.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public float mulAll() { + public float mulLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Float512Vector.class, float.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public float minAll() { + public float minLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Float512Vector.class, float.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public float maxAll() { + public float maxLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Float512Vector.class, float.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public float addAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addAll(); + public float addLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addLanes(); } @Override @ForceInline - public float mulAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulAll(); + public float mulLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public float minAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minAll(); + public float minLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public float maxAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxAll(); + public float maxLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Float512Vector rotateEL(int j) { + public Float512Vector rotateLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Float512Vector rotateER(int j) { + public Float512Vector rotateLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Float512Vector shiftEL(int j) { + public Float512Vector shiftLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Float512Vector shiftER(int j) { + public Float512Vector shiftLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java 2019-04-26 14:50:14.481639800 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java 2019-04-26 14:50:13.899919400 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Float64Vector.class, float.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public FloatVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Float64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Float64Vector.class)) { return VectorIntrinsics.reinterpret( Float64Vector.class, float.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Float128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Float128Vector.class)) { return VectorIntrinsics.reinterpret( Float64Vector.class, float.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Float256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Float256Vector.class)) { return VectorIntrinsics.reinterpret( Float64Vector.class, float.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Float512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Float512Vector.class)) { return VectorIntrinsics.reinterpret( Float64Vector.class, float.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == FloatMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == FloatMaxVector.class)) { return VectorIntrinsics.reinterpret( Float64Vector.class, float.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public float addAll() { + public float addLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Float64Vector.class, float.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public float mulAll() { + public float mulLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Float64Vector.class, float.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public float minAll() { + public float minLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Float64Vector.class, float.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public float maxAll() { + public float maxLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Float64Vector.class, float.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public float addAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addAll(); + public float addLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addLanes(); } @Override @ForceInline - public float mulAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulAll(); + public float mulLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public float minAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minAll(); + public float minLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public float maxAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxAll(); + public float maxLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public Float64Vector rotateEL(int j) { + public Float64Vector rotateLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public Float64Vector rotateER(int j) { + public Float64Vector rotateLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public Float64Vector shiftEL(int j) { + public Float64Vector shiftLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public Float64Vector shiftER(int j) { + public Float64Vector shiftLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java 2019-04-26 14:50:18.961804000 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java 2019-04-26 14:50:18.357990900 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( FloatMaxVector.class, float.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public FloatVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Float64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Float64Vector.class)) { return VectorIntrinsics.reinterpret( FloatMaxVector.class, float.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Float128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Float128Vector.class)) { return VectorIntrinsics.reinterpret( FloatMaxVector.class, float.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Float256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Float256Vector.class)) { return VectorIntrinsics.reinterpret( FloatMaxVector.class, float.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Float512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Float512Vector.class)) { return VectorIntrinsics.reinterpret( FloatMaxVector.class, float.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (FloatVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == FloatMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == FloatMaxVector.class)) { return VectorIntrinsics.reinterpret( FloatMaxVector.class, float.class, LENGTH, @@ -839,7 +839,7 @@ @Override @ForceInline - public float addAll() { + public float addLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, FloatMaxVector.class, float.class, LENGTH, this, @@ -852,7 +852,7 @@ @Override @ForceInline - public float mulAll() { + public float mulLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, FloatMaxVector.class, float.class, LENGTH, this, @@ -865,7 +865,7 @@ @Override @ForceInline - public float minAll() { + public float minLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, FloatMaxVector.class, float.class, LENGTH, this, @@ -878,7 +878,7 @@ @Override @ForceInline - public float maxAll() { + public float maxLanes() { int bits = (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, FloatMaxVector.class, float.class, LENGTH, this, @@ -892,27 +892,27 @@ @Override @ForceInline - public float addAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addAll(); + public float addLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 0).blend(this, m).addLanes(); } @Override @ForceInline - public float mulAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulAll(); + public float mulLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, (float) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public float minAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minAll(); + public float minLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public float maxAll(VectorMask m) { - return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxAll(); + public float maxLanes(VectorMask m) { + return FloatVector.broadcast(SPECIES, Float.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1167,7 +1167,7 @@ @Override - public FloatMaxVector rotateEL(int j) { + public FloatMaxVector rotateLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1177,7 +1177,7 @@ } @Override - public FloatMaxVector rotateER(int j) { + public FloatMaxVector rotateLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length(); i++){ @@ -1192,7 +1192,7 @@ } @Override - public FloatMaxVector shiftEL(int j) { + public FloatMaxVector shiftLanesLeft(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++) { @@ -1202,7 +1202,7 @@ } @Override - public FloatMaxVector shiftER(int j) { + public FloatMaxVector shiftLanesRight(int j) { float[] vec = getElements(); float[] res = new float[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java 2019-04-26 14:50:23.474806000 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java 2019-04-26 14:50:22.851956600 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static FloatVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), float.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), float.class, species.length(), Float.floatToIntBits(0.0f), species, ((bits, s) -> ((FloatSpecies)s).op(i -> Float.intBitsToFloat((int)bits)))); } @@ -142,7 +142,7 @@ public static FloatVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), float.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), float.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static FloatVector fromArray(VectorSpecies species, float[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), float.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), float.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_FLOAT_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((FloatSpecies)s).op(n -> c[idx + n])); @@ -263,8 +263,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class) species.boxType(), float.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_FLOAT_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class) species.vectorType(), float.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_FLOAT_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (float[] c, int idx, int[] iMap, int idy, VectorSpecies s) -> ((FloatSpecies)s).op(n -> c[idx + iMap[idy+n]])); @@ -333,7 +333,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), float.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), float.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -389,7 +389,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -397,7 +397,7 @@ @SuppressWarnings("unchecked") public static FloatVector broadcast(VectorSpecies species, float e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), float.class, species.length(), + (Class) species.vectorType(), float.class, species.length(), Float.floatToIntBits(e), species, ((bits, sp) -> ((FloatSpecies)sp).op(i -> Float.intBitsToFloat((int)bits)))); } @@ -421,7 +421,7 @@ public static FloatVector scalars(VectorSpecies species, float... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), float.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), float.class, species.length(), es, Unsafe.ARRAY_FLOAT_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((FloatSpecies)sp).op(n -> c[idx + n])); @@ -799,25 +799,25 @@ * {@inheritDoc} */ @Override - public abstract FloatVector rotateEL(int i); + public abstract FloatVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract FloatVector rotateER(int i); + public abstract FloatVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract FloatVector shiftEL(int i); + public abstract FloatVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract FloatVector shiftER(int i); + public abstract FloatVector shiftLanesRight(int i); /** * Divides this vector by an input vector. @@ -1719,7 +1719,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract float addAll(); + public abstract float addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1741,7 +1741,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract float addAll(VectorMask m); + public abstract float addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1760,7 +1760,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract float mulAll(); + public abstract float mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1781,7 +1781,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract float mulAll(VectorMask m); + public abstract float mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1793,7 +1793,7 @@ * * @return the minimum lane element of this vector */ - public abstract float minAll(); + public abstract float minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1807,7 +1807,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract float minAll(VectorMask m); + public abstract float minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1819,7 +1819,7 @@ * * @return the maximum lane element of this vector */ - public abstract float maxAll(); + public abstract float maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1833,7 +1833,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract float maxAll(VectorMask m); + public abstract float maxLanes(VectorMask m); // Type specific accessors @@ -1977,13 +1977,13 @@ final Function vectorFactory; private FloatSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, float.class, Float.SIZE, boxType, maskType, maskFactory, + super(shape, float.class, Float.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2019-04-26 14:50:27.928456900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2019-04-26 14:50:27.341034500 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Int128Vector.class, int.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( Int128Vector.class, int.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) { return VectorIntrinsics.reinterpret( Int128Vector.class, int.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) { return VectorIntrinsics.reinterpret( Int128Vector.class, int.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) { return VectorIntrinsics.reinterpret( Int128Vector.class, int.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) { return VectorIntrinsics.reinterpret( Int128Vector.class, int.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Int128Vector shiftL(int s) { + public Int128Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Int128Vector.class, int.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Int128Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Int128Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Int128Vector shiftR(int s) { + public Int128Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Int128Vector.class, int.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Int128Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Int128Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Int128Vector aShiftR(int s) { + public Int128Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Int128Vector.class, int.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Int128Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Int128Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Int128Vector shiftL(Vector s) { + public Int128Vector shiftLeft(Vector s) { Int128Vector shiftv = (Int128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Int128Vector shiftR(Vector s) { + public Int128Vector shiftRight(Vector s) { Int128Vector shiftv = (Int128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Int128Vector aShiftR(Vector s) { + public Int128Vector shiftArithmeticRight(Vector s) { Int128Vector shiftv = (Int128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public int addAll() { + public int addLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Int128Vector.class, int.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public int andAll() { + public int andLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Int128Vector.class, int.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public int andAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll(); + public int andLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes(); } @Override @ForceInline - public int minAll() { + public int minLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Int128Vector.class, int.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public int maxAll() { + public int maxLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Int128Vector.class, int.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public int mulAll() { + public int mulLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int128Vector.class, int.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public int orAll() { + public int orLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Int128Vector.class, int.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public int orAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll(); + public int orLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes(); } @Override @ForceInline - public int xorAll() { + public int xorLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Int128Vector.class, int.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public int xorAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll(); + public int xorLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public int addAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll(); + public int addLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes(); } @Override @ForceInline - public int mulAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll(); + public int mulLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public int minAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll(); + public int minLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public int maxAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll(); + public int maxLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Int128Vector rotateEL(int j) { + public Int128Vector rotateLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Int128Vector rotateER(int j) { + public Int128Vector rotateLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Int128Vector shiftEL(int j) { + public Int128Vector shiftLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Int128Vector shiftER(int j) { + public Int128Vector shiftLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java 2019-04-26 14:50:32.439241100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java 2019-04-26 14:50:31.811229600 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Int256Vector.class, int.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( Int256Vector.class, int.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) { return VectorIntrinsics.reinterpret( Int256Vector.class, int.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) { return VectorIntrinsics.reinterpret( Int256Vector.class, int.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) { return VectorIntrinsics.reinterpret( Int256Vector.class, int.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) { return VectorIntrinsics.reinterpret( Int256Vector.class, int.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Int256Vector shiftL(int s) { + public Int256Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Int256Vector.class, int.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Int256Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Int256Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Int256Vector shiftR(int s) { + public Int256Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Int256Vector.class, int.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Int256Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Int256Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Int256Vector aShiftR(int s) { + public Int256Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Int256Vector.class, int.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Int256Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Int256Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Int256Vector shiftL(Vector s) { + public Int256Vector shiftLeft(Vector s) { Int256Vector shiftv = (Int256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Int256Vector shiftR(Vector s) { + public Int256Vector shiftRight(Vector s) { Int256Vector shiftv = (Int256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Int256Vector aShiftR(Vector s) { + public Int256Vector shiftArithmeticRight(Vector s) { Int256Vector shiftv = (Int256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public int addAll() { + public int addLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Int256Vector.class, int.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public int andAll() { + public int andLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Int256Vector.class, int.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public int andAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll(); + public int andLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes(); } @Override @ForceInline - public int minAll() { + public int minLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Int256Vector.class, int.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public int maxAll() { + public int maxLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Int256Vector.class, int.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public int mulAll() { + public int mulLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int256Vector.class, int.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public int orAll() { + public int orLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Int256Vector.class, int.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public int orAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll(); + public int orLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes(); } @Override @ForceInline - public int xorAll() { + public int xorLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Int256Vector.class, int.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public int xorAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll(); + public int xorLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public int addAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll(); + public int addLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes(); } @Override @ForceInline - public int mulAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll(); + public int mulLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public int minAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll(); + public int minLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public int maxAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll(); + public int maxLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Int256Vector rotateEL(int j) { + public Int256Vector rotateLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Int256Vector rotateER(int j) { + public Int256Vector rotateLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Int256Vector shiftEL(int j) { + public Int256Vector shiftLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Int256Vector shiftER(int j) { + public Int256Vector shiftLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java 2019-04-26 14:50:36.935493300 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java 2019-04-26 14:50:36.346272300 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Int512Vector.class, int.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( Int512Vector.class, int.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) { return VectorIntrinsics.reinterpret( Int512Vector.class, int.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) { return VectorIntrinsics.reinterpret( Int512Vector.class, int.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) { return VectorIntrinsics.reinterpret( Int512Vector.class, int.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) { return VectorIntrinsics.reinterpret( Int512Vector.class, int.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Int512Vector shiftL(int s) { + public Int512Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Int512Vector.class, int.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Int512Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Int512Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Int512Vector shiftR(int s) { + public Int512Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Int512Vector.class, int.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Int512Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Int512Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Int512Vector aShiftR(int s) { + public Int512Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Int512Vector.class, int.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Int512Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Int512Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Int512Vector shiftL(Vector s) { + public Int512Vector shiftLeft(Vector s) { Int512Vector shiftv = (Int512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Int512Vector shiftR(Vector s) { + public Int512Vector shiftRight(Vector s) { Int512Vector shiftv = (Int512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Int512Vector aShiftR(Vector s) { + public Int512Vector shiftArithmeticRight(Vector s) { Int512Vector shiftv = (Int512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public int addAll() { + public int addLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Int512Vector.class, int.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public int andAll() { + public int andLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Int512Vector.class, int.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public int andAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll(); + public int andLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes(); } @Override @ForceInline - public int minAll() { + public int minLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Int512Vector.class, int.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public int maxAll() { + public int maxLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Int512Vector.class, int.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public int mulAll() { + public int mulLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int512Vector.class, int.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public int orAll() { + public int orLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Int512Vector.class, int.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public int orAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll(); + public int orLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes(); } @Override @ForceInline - public int xorAll() { + public int xorLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Int512Vector.class, int.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public int xorAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll(); + public int xorLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public int addAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll(); + public int addLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes(); } @Override @ForceInline - public int mulAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll(); + public int mulLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public int minAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll(); + public int minLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public int maxAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll(); + public int maxLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Int512Vector rotateEL(int j) { + public Int512Vector rotateLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Int512Vector rotateER(int j) { + public Int512Vector rotateLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Int512Vector shiftEL(int j) { + public Int512Vector shiftLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Int512Vector shiftER(int j) { + public Int512Vector shiftLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java 2019-04-26 14:50:41.400986100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java 2019-04-26 14:50:40.806752900 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Int64Vector.class, int.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( Int64Vector.class, int.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) { return VectorIntrinsics.reinterpret( Int64Vector.class, int.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) { return VectorIntrinsics.reinterpret( Int64Vector.class, int.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) { return VectorIntrinsics.reinterpret( Int64Vector.class, int.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) { return VectorIntrinsics.reinterpret( Int64Vector.class, int.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Int64Vector shiftL(int s) { + public Int64Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Int64Vector.class, int.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Int64Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Int64Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Int64Vector shiftR(int s) { + public Int64Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Int64Vector.class, int.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Int64Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Int64Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Int64Vector aShiftR(int s) { + public Int64Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Int64Vector.class, int.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Int64Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Int64Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Int64Vector shiftL(Vector s) { + public Int64Vector shiftLeft(Vector s) { Int64Vector shiftv = (Int64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Int64Vector shiftR(Vector s) { + public Int64Vector shiftRight(Vector s) { Int64Vector shiftv = (Int64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Int64Vector aShiftR(Vector s) { + public Int64Vector shiftArithmeticRight(Vector s) { Int64Vector shiftv = (Int64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public int addAll() { + public int addLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Int64Vector.class, int.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public int andAll() { + public int andLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Int64Vector.class, int.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public int andAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll(); + public int andLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes(); } @Override @ForceInline - public int minAll() { + public int minLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Int64Vector.class, int.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public int maxAll() { + public int maxLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Int64Vector.class, int.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public int mulAll() { + public int mulLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Int64Vector.class, int.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public int orAll() { + public int orLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Int64Vector.class, int.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public int orAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll(); + public int orLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes(); } @Override @ForceInline - public int xorAll() { + public int xorLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Int64Vector.class, int.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public int xorAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll(); + public int xorLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public int addAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll(); + public int addLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes(); } @Override @ForceInline - public int mulAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll(); + public int mulLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public int minAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll(); + public int minLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public int maxAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll(); + public int maxLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Int64Vector rotateEL(int j) { + public Int64Vector rotateLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Int64Vector rotateER(int j) { + public Int64Vector rotateLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Int64Vector shiftEL(int j) { + public Int64Vector shiftLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Int64Vector shiftER(int j) { + public Int64Vector shiftLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java 2019-04-26 14:50:45.860233600 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java 2019-04-26 14:50:45.277605500 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( IntMaxVector.class, int.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( IntMaxVector.class, int.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Int128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Int128Vector.class)) { return VectorIntrinsics.reinterpret( IntMaxVector.class, int.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Int256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Int256Vector.class)) { return VectorIntrinsics.reinterpret( IntMaxVector.class, int.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Int512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Int512Vector.class)) { return VectorIntrinsics.reinterpret( IntMaxVector.class, int.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (IntVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == IntMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == IntMaxVector.class)) { return VectorIntrinsics.reinterpret( IntMaxVector.class, int.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public IntMaxVector shiftL(int s) { + public IntMaxVector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, IntMaxVector.class, int.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public IntMaxVector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public IntMaxVector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public IntMaxVector shiftR(int s) { + public IntMaxVector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, IntMaxVector.class, int.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public IntMaxVector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public IntMaxVector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public IntMaxVector aShiftR(int s) { + public IntMaxVector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, IntMaxVector.class, int.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public IntMaxVector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public IntMaxVector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public IntMaxVector shiftL(Vector s) { + public IntMaxVector shiftLeft(Vector s) { IntMaxVector shiftv = (IntMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public IntMaxVector shiftR(Vector s) { + public IntMaxVector shiftRight(Vector s) { IntMaxVector shiftv = (IntMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public IntMaxVector aShiftR(Vector s) { + public IntMaxVector shiftArithmeticRight(Vector s) { IntMaxVector shiftv = (IntMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(IntVector.broadcast(SPECIES, 0x1f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public int addAll() { + public int addLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, IntMaxVector.class, int.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public int andAll() { + public int andLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, IntMaxVector.class, int.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public int andAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andAll(); + public int andLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) -1).blend(this, m).andLanes(); } @Override @ForceInline - public int minAll() { + public int minLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, IntMaxVector.class, int.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public int maxAll() { + public int maxLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, IntMaxVector.class, int.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public int mulAll() { + public int mulLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, IntMaxVector.class, int.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public int orAll() { + public int orLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, IntMaxVector.class, int.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public int orAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orAll(); + public int orLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).orLanes(); } @Override @ForceInline - public int xorAll() { + public int xorLanes() { return (int) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, IntMaxVector.class, int.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public int xorAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorAll(); + public int xorLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public int addAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addAll(); + public int addLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 0).blend(this, m).addLanes(); } @Override @ForceInline - public int mulAll(VectorMask m) { - return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulAll(); + public int mulLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, (int) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public int minAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minAll(); + public int minLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public int maxAll(VectorMask m) { - return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxAll(); + public int maxLanes(VectorMask m) { + return IntVector.broadcast(SPECIES, Integer.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public IntMaxVector rotateEL(int j) { + public IntMaxVector rotateLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public IntMaxVector rotateER(int j) { + public IntMaxVector rotateLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public IntMaxVector shiftEL(int j) { + public IntMaxVector shiftLanesLeft(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public IntMaxVector shiftER(int j) { + public IntMaxVector shiftLanesRight(int j) { int[] vec = getElements(); int[] res = new int[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java 2019-04-26 14:50:50.283081900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java 2019-04-26 14:50:49.714405500 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static IntVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), int.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), int.class, species.length(), 0, species, ((bits, s) -> ((IntSpecies)s).op(i -> (int)bits))); } @@ -142,7 +142,7 @@ public static IntVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), int.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), int.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static IntVector fromArray(VectorSpecies species, int[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), int.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), int.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_INT_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((IntSpecies)s).op(n -> c[idx + n])); @@ -263,8 +263,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class) species.boxType(), int.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_INT_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class) species.vectorType(), int.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_INT_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (int[] c, int idx, int[] iMap, int idy, VectorSpecies s) -> ((IntSpecies)s).op(n -> c[idx + iMap[idy+n]])); @@ -333,7 +333,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), int.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), int.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -389,7 +389,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -397,7 +397,7 @@ @SuppressWarnings("unchecked") public static IntVector broadcast(VectorSpecies species, int e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), int.class, species.length(), + (Class) species.vectorType(), int.class, species.length(), e, species, ((bits, sp) -> ((IntSpecies)sp).op(i -> (int)bits))); } @@ -421,7 +421,7 @@ public static IntVector scalars(VectorSpecies species, int... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), int.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), int.class, species.length(), es, Unsafe.ARRAY_INT_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((IntSpecies)sp).op(n -> c[idx + n])); @@ -799,25 +799,25 @@ * {@inheritDoc} */ @Override - public abstract IntVector rotateEL(int i); + public abstract IntVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract IntVector rotateER(int i); + public abstract IntVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract IntVector shiftEL(int i); + public abstract IntVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract IntVector shiftER(int i); + public abstract IntVector shiftLanesRight(int i); @@ -996,113 +996,121 @@ * Logically left shifts this vector by the broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector shiftL(int s); + public abstract IntVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, * selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector shiftL(int s, VectorMask m); + public abstract IntVector shiftLeft(int s, VectorMask m); /** * Logically left shifts this vector by an input vector. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically left shifting this vector by the input * vector */ - public abstract IntVector shiftL(Vector v); + public abstract IntVector shiftLeft(Vector v); /** * Logically left shifts this vector by an input vector, selecting lane * elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the input * vector */ - public IntVector shiftL(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (int) (a << b)); + public IntVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); } // logical, or unsigned, shift right - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector shiftR(int s); + public abstract IntVector shiftRight(int s); - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a * mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector shiftR(int s, VectorMask m); + public abstract IntVector shiftRight(int s, VectorMask m); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically right shifting this vector by the * input vector */ - public abstract IntVector shiftR(Vector v); + public abstract IntVector shiftRight(Vector v); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * input vector */ - public IntVector shiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (int) (a >>> b)); + public IntVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); } /** @@ -1110,13 +1118,14 @@ * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector aShiftR(int s); + public abstract IntVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1124,42 +1133,45 @@ * mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract IntVector aShiftR(int s, VectorMask m); + public abstract IntVector shiftArithmeticRight(int s, VectorMask m); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of arithmetically right shifting this vector by the * input vector */ - public abstract IntVector aShiftR(Vector v); + public abstract IntVector shiftArithmeticRight(Vector v); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * input vector */ - public IntVector aShiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (int) (a >> b)); + public IntVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); } /** @@ -1176,8 +1188,8 @@ * input scalar */ @ForceInline - public final IntVector rotateL(int s) { - return shiftL(s).or(shiftR(-s)); + public final IntVector rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); } /** @@ -1196,8 +1208,8 @@ * input scalar */ @ForceInline - public final IntVector rotateL(int s, VectorMask m) { - return shiftL(s, m).or(shiftR(-s, m), m); + public final IntVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); } /** @@ -1214,8 +1226,8 @@ * input scalar */ @ForceInline - public final IntVector rotateR(int s) { - return shiftR(s).or(shiftL(-s)); + public final IntVector rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); } /** @@ -1234,8 +1246,8 @@ * input scalar */ @ForceInline - public final IntVector rotateR(int s, VectorMask m) { - return shiftR(s, m).or(shiftL(-s, m), m); + public final IntVector rotateRight(int s, VectorMask m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); } /** @@ -1273,7 +1285,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract int addAll(); + public abstract int addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1286,7 +1298,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract int addAll(VectorMask m); + public abstract int addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1297,7 +1309,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract int mulAll(); + public abstract int mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1310,7 +1322,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract int mulAll(VectorMask m); + public abstract int mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1322,7 +1334,7 @@ * * @return the minimum lane element of this vector */ - public abstract int minAll(); + public abstract int minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1336,7 +1348,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract int minAll(VectorMask m); + public abstract int minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1348,7 +1360,7 @@ * * @return the maximum lane element of this vector */ - public abstract int maxAll(); + public abstract int maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1362,7 +1374,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract int maxAll(VectorMask m); + public abstract int maxLanes(VectorMask m); /** * Logically ORs all lane elements of this vector. @@ -1373,7 +1385,7 @@ * * @return the logical OR all the lane elements of this vector */ - public abstract int orAll(); + public abstract int orLanes(); /** * Logically ORs all lane elements of this vector, selecting lane elements @@ -1386,7 +1398,7 @@ * @param m the mask controlling lane selection * @return the logical OR all the lane elements of this vector */ - public abstract int orAll(VectorMask m); + public abstract int orLanes(VectorMask m); /** * Logically ANDs all lane elements of this vector. @@ -1397,7 +1409,7 @@ * * @return the logical AND all the lane elements of this vector */ - public abstract int andAll(); + public abstract int andLanes(); /** * Logically ANDs all lane elements of this vector, selecting lane elements @@ -1410,7 +1422,7 @@ * @param m the mask controlling lane selection * @return the logical AND all the lane elements of this vector */ - public abstract int andAll(VectorMask m); + public abstract int andLanes(VectorMask m); /** * Logically XORs all lane elements of this vector. @@ -1421,7 +1433,7 @@ * * @return the logical XOR all the lane elements of this vector */ - public abstract int xorAll(); + public abstract int xorLanes(); /** * Logically XORs all lane elements of this vector, selecting lane elements @@ -1434,7 +1446,7 @@ * @param m the mask controlling lane selection * @return the logical XOR all the lane elements of this vector */ - public abstract int xorAll(VectorMask m); + public abstract int xorLanes(VectorMask m); // Type specific accessors @@ -1577,13 +1589,13 @@ final Function vectorFactory; private IntSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, int.class, Integer.SIZE, boxType, maskType, maskFactory, + super(shape, int.class, Integer.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java 2019-04-26 14:50:54.857231900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java 2019-04-26 14:50:54.275973900 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Long128Vector.class, long.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public LongVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Long64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Long64Vector.class)) { return VectorIntrinsics.reinterpret( Long128Vector.class, long.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Long128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Long128Vector.class)) { return VectorIntrinsics.reinterpret( Long128Vector.class, long.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Long256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Long256Vector.class)) { return VectorIntrinsics.reinterpret( Long128Vector.class, long.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Long512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Long512Vector.class)) { return VectorIntrinsics.reinterpret( Long128Vector.class, long.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == LongMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == LongMaxVector.class)) { return VectorIntrinsics.reinterpret( Long128Vector.class, long.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Long128Vector shiftL(int s) { + public Long128Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Long128Vector.class, long.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Long128Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Long128Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Long128Vector shiftR(int s) { + public Long128Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Long128Vector.class, long.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Long128Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Long128Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Long128Vector aShiftR(int s) { + public Long128Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Long128Vector.class, long.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Long128Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Long128Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Long128Vector shiftL(Vector s) { + public Long128Vector shiftLeft(Vector s) { Long128Vector shiftv = (Long128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Long128Vector shiftR(Vector s) { + public Long128Vector shiftRight(Vector s) { Long128Vector shiftv = (Long128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Long128Vector aShiftR(Vector s) { + public Long128Vector shiftArithmeticRight(Vector s) { Long128Vector shiftv = (Long128Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public long addAll() { + public long addLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Long128Vector.class, long.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public long andAll() { + public long andLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Long128Vector.class, long.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public long andAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andAll(); + public long andLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andLanes(); } @Override @ForceInline - public long minAll() { + public long minLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Long128Vector.class, long.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public long maxAll() { + public long maxLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Long128Vector.class, long.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public long mulAll() { + public long mulLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long128Vector.class, long.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public long orAll() { + public long orLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Long128Vector.class, long.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public long orAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orAll(); + public long orLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orLanes(); } @Override @ForceInline - public long xorAll() { + public long xorLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Long128Vector.class, long.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public long xorAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorAll(); + public long xorLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public long addAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addAll(); + public long addLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addLanes(); } @Override @ForceInline - public long mulAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulAll(); + public long mulLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public long minAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minAll(); + public long minLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public long maxAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxAll(); + public long maxLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Long128Vector rotateEL(int j) { + public Long128Vector rotateLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Long128Vector rotateER(int j) { + public Long128Vector rotateLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Long128Vector shiftEL(int j) { + public Long128Vector shiftLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Long128Vector shiftER(int j) { + public Long128Vector shiftLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java 2019-04-26 14:50:59.319890700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java 2019-04-26 14:50:58.739921400 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Long256Vector.class, long.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public LongVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Long64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Long64Vector.class)) { return VectorIntrinsics.reinterpret( Long256Vector.class, long.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Long128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Long128Vector.class)) { return VectorIntrinsics.reinterpret( Long256Vector.class, long.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Long256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Long256Vector.class)) { return VectorIntrinsics.reinterpret( Long256Vector.class, long.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Long512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Long512Vector.class)) { return VectorIntrinsics.reinterpret( Long256Vector.class, long.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == LongMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == LongMaxVector.class)) { return VectorIntrinsics.reinterpret( Long256Vector.class, long.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Long256Vector shiftL(int s) { + public Long256Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Long256Vector.class, long.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Long256Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Long256Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Long256Vector shiftR(int s) { + public Long256Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Long256Vector.class, long.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Long256Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Long256Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Long256Vector aShiftR(int s) { + public Long256Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Long256Vector.class, long.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Long256Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Long256Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Long256Vector shiftL(Vector s) { + public Long256Vector shiftLeft(Vector s) { Long256Vector shiftv = (Long256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Long256Vector shiftR(Vector s) { + public Long256Vector shiftRight(Vector s) { Long256Vector shiftv = (Long256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Long256Vector aShiftR(Vector s) { + public Long256Vector shiftArithmeticRight(Vector s) { Long256Vector shiftv = (Long256Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public long addAll() { + public long addLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Long256Vector.class, long.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public long andAll() { + public long andLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Long256Vector.class, long.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public long andAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andAll(); + public long andLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andLanes(); } @Override @ForceInline - public long minAll() { + public long minLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Long256Vector.class, long.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public long maxAll() { + public long maxLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Long256Vector.class, long.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public long mulAll() { + public long mulLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long256Vector.class, long.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public long orAll() { + public long orLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Long256Vector.class, long.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public long orAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orAll(); + public long orLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orLanes(); } @Override @ForceInline - public long xorAll() { + public long xorLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Long256Vector.class, long.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public long xorAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorAll(); + public long xorLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public long addAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addAll(); + public long addLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addLanes(); } @Override @ForceInline - public long mulAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulAll(); + public long mulLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public long minAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minAll(); + public long minLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public long maxAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxAll(); + public long maxLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Long256Vector rotateEL(int j) { + public Long256Vector rotateLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Long256Vector rotateER(int j) { + public Long256Vector rotateLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Long256Vector shiftEL(int j) { + public Long256Vector shiftLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Long256Vector shiftER(int j) { + public Long256Vector shiftLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java 2019-04-26 14:51:04.056163400 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java 2019-04-26 14:51:03.466147600 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( Long512Vector.class, long.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public LongVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Long64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Long64Vector.class)) { return VectorIntrinsics.reinterpret( Long512Vector.class, long.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Long128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Long128Vector.class)) { return VectorIntrinsics.reinterpret( Long512Vector.class, long.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Long256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Long256Vector.class)) { return VectorIntrinsics.reinterpret( Long512Vector.class, long.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Long512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Long512Vector.class)) { return VectorIntrinsics.reinterpret( Long512Vector.class, long.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == LongMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == LongMaxVector.class)) { return VectorIntrinsics.reinterpret( Long512Vector.class, long.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public Long512Vector shiftL(int s) { + public Long512Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Long512Vector.class, long.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public Long512Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Long512Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Long512Vector shiftR(int s) { + public Long512Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Long512Vector.class, long.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public Long512Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Long512Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Long512Vector aShiftR(int s) { + public Long512Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Long512Vector.class, long.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public Long512Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Long512Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Long512Vector shiftL(Vector s) { + public Long512Vector shiftLeft(Vector s) { Long512Vector shiftv = (Long512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public Long512Vector shiftR(Vector s) { + public Long512Vector shiftRight(Vector s) { Long512Vector shiftv = (Long512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public Long512Vector aShiftR(Vector s) { + public Long512Vector shiftArithmeticRight(Vector s) { Long512Vector shiftv = (Long512Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public long addAll() { + public long addLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Long512Vector.class, long.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public long andAll() { + public long andLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Long512Vector.class, long.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public long andAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andAll(); + public long andLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andLanes(); } @Override @ForceInline - public long minAll() { + public long minLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Long512Vector.class, long.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public long maxAll() { + public long maxLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Long512Vector.class, long.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public long mulAll() { + public long mulLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long512Vector.class, long.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public long orAll() { + public long orLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Long512Vector.class, long.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public long orAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orAll(); + public long orLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orLanes(); } @Override @ForceInline - public long xorAll() { + public long xorLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Long512Vector.class, long.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public long xorAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorAll(); + public long xorLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public long addAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addAll(); + public long addLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addLanes(); } @Override @ForceInline - public long mulAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulAll(); + public long mulLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public long minAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minAll(); + public long minLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public long maxAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxAll(); + public long maxLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public Long512Vector rotateEL(int j) { + public Long512Vector rotateLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public Long512Vector rotateER(int j) { + public Long512Vector rotateLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public Long512Vector shiftEL(int j) { + public Long512Vector shiftLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public Long512Vector shiftER(int j) { + public Long512Vector shiftLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java 2019-04-26 14:51:08.731428000 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java 2019-04-26 14:51:08.151745400 -0700 @@ -162,7 +162,7 @@ return VectorIntrinsics.cast( Long64Vector.class, long.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -300,7 +300,7 @@ @ForceInline public LongVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Long64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Long64Vector.class)) { return VectorIntrinsics.reinterpret( Long64Vector.class, long.class, LENGTH, @@ -309,7 +309,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Long128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Long128Vector.class)) { return VectorIntrinsics.reinterpret( Long64Vector.class, long.class, LENGTH, @@ -318,7 +318,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Long256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Long256Vector.class)) { return VectorIntrinsics.reinterpret( Long64Vector.class, long.class, LENGTH, @@ -327,7 +327,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Long512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Long512Vector.class)) { return VectorIntrinsics.reinterpret( Long64Vector.class, long.class, LENGTH, @@ -337,7 +337,7 @@ (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == LongMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == LongMaxVector.class)) { return VectorIntrinsics.reinterpret( Long64Vector.class, long.class, LENGTH, @@ -664,7 +664,7 @@ @Override @ForceInline - public Long64Vector shiftL(int s) { + public Long64Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Long64Vector.class, long.class, LENGTH, this, s, @@ -673,13 +673,13 @@ @Override @ForceInline - public Long64Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Long64Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Long64Vector shiftR(int s) { + public Long64Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Long64Vector.class, long.class, LENGTH, this, s, @@ -688,13 +688,13 @@ @Override @ForceInline - public Long64Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Long64Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Long64Vector aShiftR(int s) { + public Long64Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Long64Vector.class, long.class, LENGTH, this, s, @@ -703,13 +703,13 @@ @Override @ForceInline - public Long64Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Long64Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Long64Vector shiftL(Vector s) { + public Long64Vector shiftLeft(Vector s) { Long64Vector shiftv = (Long64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -721,7 +721,7 @@ @Override @ForceInline - public Long64Vector shiftR(Vector s) { + public Long64Vector shiftRight(Vector s) { Long64Vector shiftv = (Long64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -733,7 +733,7 @@ @Override @ForceInline - public Long64Vector aShiftR(Vector s) { + public Long64Vector shiftArithmeticRight(Vector s) { Long64Vector shiftv = (Long64Vector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -749,7 +749,7 @@ @Override @ForceInline - public long addAll() { + public long addLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Long64Vector.class, long.class, LENGTH, this, @@ -758,7 +758,7 @@ @Override @ForceInline - public long andAll() { + public long andLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Long64Vector.class, long.class, LENGTH, this, @@ -767,13 +767,13 @@ @Override @ForceInline - public long andAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andAll(); + public long andLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andLanes(); } @Override @ForceInline - public long minAll() { + public long minLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Long64Vector.class, long.class, LENGTH, this, @@ -782,7 +782,7 @@ @Override @ForceInline - public long maxAll() { + public long maxLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Long64Vector.class, long.class, LENGTH, this, @@ -791,7 +791,7 @@ @Override @ForceInline - public long mulAll() { + public long mulLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Long64Vector.class, long.class, LENGTH, this, @@ -800,7 +800,7 @@ @Override @ForceInline - public long orAll() { + public long orLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Long64Vector.class, long.class, LENGTH, this, @@ -809,13 +809,13 @@ @Override @ForceInline - public long orAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orAll(); + public long orLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orLanes(); } @Override @ForceInline - public long xorAll() { + public long xorLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Long64Vector.class, long.class, LENGTH, this, @@ -824,34 +824,34 @@ @Override @ForceInline - public long xorAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorAll(); + public long xorLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public long addAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addAll(); + public long addLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addLanes(); } @Override @ForceInline - public long mulAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulAll(); + public long mulLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public long minAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minAll(); + public long minLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public long maxAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxAll(); + public long maxLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1094,7 +1094,7 @@ } @Override - public Long64Vector rotateEL(int j) { + public Long64Vector rotateLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1104,7 +1104,7 @@ } @Override - public Long64Vector rotateER(int j) { + public Long64Vector rotateLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1119,7 +1119,7 @@ } @Override - public Long64Vector shiftEL(int j) { + public Long64Vector shiftLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++) { @@ -1129,7 +1129,7 @@ } @Override - public Long64Vector shiftER(int j) { + public Long64Vector shiftLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java 2019-04-26 14:51:13.153533200 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java 2019-04-26 14:51:12.566285000 -0700 @@ -163,7 +163,7 @@ return VectorIntrinsics.cast( LongMaxVector.class, long.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -301,7 +301,7 @@ @ForceInline public LongVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Long64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Long64Vector.class)) { return VectorIntrinsics.reinterpret( LongMaxVector.class, long.class, LENGTH, @@ -310,7 +310,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Long128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Long128Vector.class)) { return VectorIntrinsics.reinterpret( LongMaxVector.class, long.class, LENGTH, @@ -319,7 +319,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Long256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Long256Vector.class)) { return VectorIntrinsics.reinterpret( LongMaxVector.class, long.class, LENGTH, @@ -328,7 +328,7 @@ this, s, (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Long512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Long512Vector.class)) { return VectorIntrinsics.reinterpret( LongMaxVector.class, long.class, LENGTH, @@ -338,7 +338,7 @@ (species, vector) -> (LongVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == LongMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == LongMaxVector.class)) { return VectorIntrinsics.reinterpret( LongMaxVector.class, long.class, LENGTH, @@ -665,7 +665,7 @@ @Override @ForceInline - public LongMaxVector shiftL(int s) { + public LongMaxVector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, LongMaxVector.class, long.class, LENGTH, this, s, @@ -674,13 +674,13 @@ @Override @ForceInline - public LongMaxVector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public LongMaxVector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public LongMaxVector shiftR(int s) { + public LongMaxVector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, LongMaxVector.class, long.class, LENGTH, this, s, @@ -689,13 +689,13 @@ @Override @ForceInline - public LongMaxVector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public LongMaxVector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public LongMaxVector aShiftR(int s) { + public LongMaxVector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, LongMaxVector.class, long.class, LENGTH, this, s, @@ -704,13 +704,13 @@ @Override @ForceInline - public LongMaxVector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public LongMaxVector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public LongMaxVector shiftL(Vector s) { + public LongMaxVector shiftLeft(Vector s) { LongMaxVector shiftv = (LongMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -722,7 +722,7 @@ @Override @ForceInline - public LongMaxVector shiftR(Vector s) { + public LongMaxVector shiftRight(Vector s) { LongMaxVector shiftv = (LongMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -734,7 +734,7 @@ @Override @ForceInline - public LongMaxVector aShiftR(Vector s) { + public LongMaxVector shiftArithmeticRight(Vector s) { LongMaxVector shiftv = (LongMaxVector)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and(LongVector.broadcast(SPECIES, 0x3f)); @@ -750,7 +750,7 @@ @Override @ForceInline - public long addAll() { + public long addLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, LongMaxVector.class, long.class, LENGTH, this, @@ -759,7 +759,7 @@ @Override @ForceInline - public long andAll() { + public long andLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, LongMaxVector.class, long.class, LENGTH, this, @@ -768,13 +768,13 @@ @Override @ForceInline - public long andAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andAll(); + public long andLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) -1).blend(this, m).andLanes(); } @Override @ForceInline - public long minAll() { + public long minLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, LongMaxVector.class, long.class, LENGTH, this, @@ -783,7 +783,7 @@ @Override @ForceInline - public long maxAll() { + public long maxLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, LongMaxVector.class, long.class, LENGTH, this, @@ -792,7 +792,7 @@ @Override @ForceInline - public long mulAll() { + public long mulLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, LongMaxVector.class, long.class, LENGTH, this, @@ -801,7 +801,7 @@ @Override @ForceInline - public long orAll() { + public long orLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, LongMaxVector.class, long.class, LENGTH, this, @@ -810,13 +810,13 @@ @Override @ForceInline - public long orAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orAll(); + public long orLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).orLanes(); } @Override @ForceInline - public long xorAll() { + public long xorLanes() { return (long) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, LongMaxVector.class, long.class, LENGTH, this, @@ -825,34 +825,34 @@ @Override @ForceInline - public long xorAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorAll(); + public long xorLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public long addAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addAll(); + public long addLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 0).blend(this, m).addLanes(); } @Override @ForceInline - public long mulAll(VectorMask m) { - return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulAll(); + public long mulLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, (long) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public long minAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minAll(); + public long minLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public long maxAll(VectorMask m) { - return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxAll(); + public long maxLanes(VectorMask m) { + return LongVector.broadcast(SPECIES, Long.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1107,7 +1107,7 @@ } @Override - public LongMaxVector rotateEL(int j) { + public LongMaxVector rotateLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1117,7 +1117,7 @@ } @Override - public LongMaxVector rotateER(int j) { + public LongMaxVector rotateLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length(); i++){ @@ -1132,7 +1132,7 @@ } @Override - public LongMaxVector shiftEL(int j) { + public LongMaxVector shiftLanesLeft(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++) { @@ -1142,7 +1142,7 @@ } @Override - public LongMaxVector shiftER(int j) { + public LongMaxVector shiftLanesRight(int j) { long[] vec = getElements(); long[] res = new long[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java 2019-04-26 14:51:17.720435000 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java 2019-04-26 14:51:17.096665000 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static LongVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), long.class, species.length(), 0, species, ((bits, s) -> ((LongSpecies)s).op(i -> (long)bits))); } @@ -142,7 +142,7 @@ public static LongVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static LongVector fromArray(VectorSpecies species, long[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_LONG_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((LongSpecies)s).op(n -> c[idx + n])); @@ -266,8 +266,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class) species.boxType(), long.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_LONG_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class) species.vectorType(), long.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_LONG_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, (long[] c, int idx, int[] iMap, int idy, VectorSpecies s) -> ((LongSpecies)s).op(n -> c[idx + iMap[idy+n]])); @@ -336,7 +336,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -392,7 +392,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -400,7 +400,7 @@ @SuppressWarnings("unchecked") public static LongVector broadcast(VectorSpecies species, long e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), long.class, species.length(), + (Class) species.vectorType(), long.class, species.length(), e, species, ((bits, sp) -> ((LongSpecies)sp).op(i -> (long)bits))); } @@ -424,7 +424,7 @@ public static LongVector scalars(VectorSpecies species, long... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), long.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), long.class, species.length(), es, Unsafe.ARRAY_LONG_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((LongSpecies)sp).op(n -> c[idx + n])); @@ -802,25 +802,25 @@ * {@inheritDoc} */ @Override - public abstract LongVector rotateEL(int i); + public abstract LongVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector rotateER(int i); + public abstract LongVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector shiftEL(int i); + public abstract LongVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract LongVector shiftER(int i); + public abstract LongVector shiftLanesRight(int i); @@ -999,113 +999,121 @@ * Logically left shifts this vector by the broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftL(int s); + public abstract LongVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, * selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane to left shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftL(int s, VectorMask m); + public abstract LongVector shiftLeft(int s, VectorMask m); /** * Logically left shifts this vector by an input vector. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically left shifting this vector by the input * vector */ - public abstract LongVector shiftL(Vector v); + public abstract LongVector shiftLeft(Vector v); /** * Logically left shifts this vector by an input vector, selecting lane * elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the input * vector */ - public LongVector shiftL(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a << b)); + public LongVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); } // logical, or unsigned, shift right - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftR(int s); + public abstract LongVector shiftRight(int s); - /** + /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a * mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector shiftR(int s, VectorMask m); + public abstract LongVector shiftRight(int s, VectorMask m); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of logically right shifting this vector by the * input vector */ - public abstract LongVector shiftR(Vector v); + public abstract LongVector shiftRight(Vector v); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * input vector */ - public LongVector shiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a >>> b)); + public LongVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); } /** @@ -1113,13 +1121,14 @@ * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector aShiftR(int s); + public abstract LongVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1127,42 +1136,45 @@ * mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane to arithmetically + * right shift the element by shift value as specified by the input scalar. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract LongVector aShiftR(int s, VectorMask m); + public abstract LongVector shiftArithmeticRight(int s, VectorMask m); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @return the result of arithmetically right shifting this vector by the * input vector */ - public abstract LongVector aShiftR(Vector v); + public abstract LongVector shiftArithmeticRight(Vector v); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. * * @param v the input vector * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * input vector */ - public LongVector aShiftR(Vector v, VectorMask m) { - return bOp(v, m, (i, a, b) -> (long) (a >> b)); + public LongVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); } /** @@ -1179,8 +1191,8 @@ * input scalar */ @ForceInline - public final LongVector rotateL(int s) { - return shiftL(s).or(shiftR(-s)); + public final LongVector rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); } /** @@ -1199,8 +1211,8 @@ * input scalar */ @ForceInline - public final LongVector rotateL(int s, VectorMask m) { - return shiftL(s, m).or(shiftR(-s, m), m); + public final LongVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); } /** @@ -1217,8 +1229,8 @@ * input scalar */ @ForceInline - public final LongVector rotateR(int s) { - return shiftR(s).or(shiftL(-s)); + public final LongVector rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); } /** @@ -1237,8 +1249,8 @@ * input scalar */ @ForceInline - public final LongVector rotateR(int s, VectorMask m) { - return shiftR(s, m).or(shiftL(-s, m), m); + public final LongVector rotateRight(int s, VectorMask m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); } /** @@ -1276,7 +1288,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract long addAll(); + public abstract long addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1289,7 +1301,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract long addAll(VectorMask m); + public abstract long addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1300,7 +1312,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract long mulAll(); + public abstract long mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1313,7 +1325,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract long mulAll(VectorMask m); + public abstract long mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1325,7 +1337,7 @@ * * @return the minimum lane element of this vector */ - public abstract long minAll(); + public abstract long minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1339,7 +1351,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract long minAll(VectorMask m); + public abstract long minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1351,7 +1363,7 @@ * * @return the maximum lane element of this vector */ - public abstract long maxAll(); + public abstract long maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1365,7 +1377,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract long maxAll(VectorMask m); + public abstract long maxLanes(VectorMask m); /** * Logically ORs all lane elements of this vector. @@ -1376,7 +1388,7 @@ * * @return the logical OR all the lane elements of this vector */ - public abstract long orAll(); + public abstract long orLanes(); /** * Logically ORs all lane elements of this vector, selecting lane elements @@ -1389,7 +1401,7 @@ * @param m the mask controlling lane selection * @return the logical OR all the lane elements of this vector */ - public abstract long orAll(VectorMask m); + public abstract long orLanes(VectorMask m); /** * Logically ANDs all lane elements of this vector. @@ -1400,7 +1412,7 @@ * * @return the logical AND all the lane elements of this vector */ - public abstract long andAll(); + public abstract long andLanes(); /** * Logically ANDs all lane elements of this vector, selecting lane elements @@ -1413,7 +1425,7 @@ * @param m the mask controlling lane selection * @return the logical AND all the lane elements of this vector */ - public abstract long andAll(VectorMask m); + public abstract long andLanes(VectorMask m); /** * Logically XORs all lane elements of this vector. @@ -1424,7 +1436,7 @@ * * @return the logical XOR all the lane elements of this vector */ - public abstract long xorAll(); + public abstract long xorLanes(); /** * Logically XORs all lane elements of this vector, selecting lane elements @@ -1437,7 +1449,7 @@ * @param m the mask controlling lane selection * @return the logical XOR all the lane elements of this vector */ - public abstract long xorAll(VectorMask m); + public abstract long xorLanes(VectorMask m); // Type specific accessors @@ -1580,13 +1592,13 @@ final Function vectorFactory; private LongSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, long.class, Long.SIZE, boxType, maskType, maskFactory, + super(shape, long.class, Long.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java 2019-04-26 14:51:22.592511900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java 2019-04-26 14:51:21.982574900 -0700 @@ -155,7 +155,7 @@ return VectorIntrinsics.cast( Short128Vector.class, short.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -293,7 +293,7 @@ @ForceInline public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( Short128Vector.class, short.class, LENGTH, @@ -302,7 +302,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) { return VectorIntrinsics.reinterpret( Short128Vector.class, short.class, LENGTH, @@ -311,7 +311,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) { return VectorIntrinsics.reinterpret( Short128Vector.class, short.class, LENGTH, @@ -320,7 +320,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) { return VectorIntrinsics.reinterpret( Short128Vector.class, short.class, LENGTH, @@ -330,7 +330,7 @@ (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) { return VectorIntrinsics.reinterpret( Short128Vector.class, short.class, LENGTH, @@ -657,47 +657,74 @@ @Override @ForceInline - public Short128Vector shiftL(int s) { + public Short128Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Short128Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF)))); } @Override @ForceInline - public Short128Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Short128Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Short128Vector shiftR(int s) { + public Short128Vector shiftLeft(Vector s) { + Short128Vector shiftv = (Short128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF))); + } + + @Override + @ForceInline + public Short128Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Short128Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public Short128Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Short128Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Short128Vector shiftRight(Vector s) { + Short128Vector shiftv = (Short128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF))); } @Override @ForceInline - public Short128Vector aShiftR(int s) { + public Short128Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Short128Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF)))); + } + + @Override + @ForceInline + public Short128Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Short128Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Short128Vector shiftArithmeticRight(Vector s) { + Short128Vector shiftv = (Short128Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF))); } // Ternary operations @@ -706,7 +733,7 @@ @Override @ForceInline - public short addAll() { + public short addLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Short128Vector.class, short.class, LENGTH, this, @@ -715,7 +742,7 @@ @Override @ForceInline - public short andAll() { + public short andLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Short128Vector.class, short.class, LENGTH, this, @@ -724,13 +751,13 @@ @Override @ForceInline - public short andAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andAll(); + public short andLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andLanes(); } @Override @ForceInline - public short minAll() { + public short minLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Short128Vector.class, short.class, LENGTH, this, @@ -739,7 +766,7 @@ @Override @ForceInline - public short maxAll() { + public short maxLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Short128Vector.class, short.class, LENGTH, this, @@ -748,7 +775,7 @@ @Override @ForceInline - public short mulAll() { + public short mulLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Short128Vector.class, short.class, LENGTH, this, @@ -757,7 +784,7 @@ @Override @ForceInline - public short orAll() { + public short orLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Short128Vector.class, short.class, LENGTH, this, @@ -766,13 +793,13 @@ @Override @ForceInline - public short orAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orAll(); + public short orLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orLanes(); } @Override @ForceInline - public short xorAll() { + public short xorLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Short128Vector.class, short.class, LENGTH, this, @@ -781,34 +808,34 @@ @Override @ForceInline - public short xorAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorAll(); + public short xorLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public short addAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addAll(); + public short addLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addLanes(); } @Override @ForceInline - public short mulAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulAll(); + public short mulLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public short minAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minAll(); + public short minLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public short maxAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxAll(); + public short maxLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1029,7 +1056,7 @@ @Override - public Short128Vector rotateEL(int j) { + public Short128Vector rotateLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1039,7 +1066,7 @@ } @Override - public Short128Vector rotateER(int j) { + public Short128Vector rotateLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1054,7 +1081,7 @@ } @Override - public Short128Vector shiftEL(int j) { + public Short128Vector shiftLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++) { @@ -1064,7 +1091,7 @@ } @Override - public Short128Vector shiftER(int j) { + public Short128Vector shiftLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java 2019-04-26 14:51:27.217332700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java 2019-04-26 14:51:26.602046100 -0700 @@ -155,7 +155,7 @@ return VectorIntrinsics.cast( Short256Vector.class, short.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -293,7 +293,7 @@ @ForceInline public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( Short256Vector.class, short.class, LENGTH, @@ -302,7 +302,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) { return VectorIntrinsics.reinterpret( Short256Vector.class, short.class, LENGTH, @@ -311,7 +311,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) { return VectorIntrinsics.reinterpret( Short256Vector.class, short.class, LENGTH, @@ -320,7 +320,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) { return VectorIntrinsics.reinterpret( Short256Vector.class, short.class, LENGTH, @@ -330,7 +330,7 @@ (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) { return VectorIntrinsics.reinterpret( Short256Vector.class, short.class, LENGTH, @@ -657,47 +657,74 @@ @Override @ForceInline - public Short256Vector shiftL(int s) { + public Short256Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Short256Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF)))); } @Override @ForceInline - public Short256Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Short256Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Short256Vector shiftR(int s) { + public Short256Vector shiftLeft(Vector s) { + Short256Vector shiftv = (Short256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF))); + } + + @Override + @ForceInline + public Short256Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Short256Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public Short256Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Short256Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Short256Vector shiftRight(Vector s) { + Short256Vector shiftv = (Short256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF))); } @Override @ForceInline - public Short256Vector aShiftR(int s) { + public Short256Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Short256Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF)))); + } + + @Override + @ForceInline + public Short256Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Short256Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Short256Vector shiftArithmeticRight(Vector s) { + Short256Vector shiftv = (Short256Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF))); } // Ternary operations @@ -706,7 +733,7 @@ @Override @ForceInline - public short addAll() { + public short addLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Short256Vector.class, short.class, LENGTH, this, @@ -715,7 +742,7 @@ @Override @ForceInline - public short andAll() { + public short andLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Short256Vector.class, short.class, LENGTH, this, @@ -724,13 +751,13 @@ @Override @ForceInline - public short andAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andAll(); + public short andLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andLanes(); } @Override @ForceInline - public short minAll() { + public short minLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Short256Vector.class, short.class, LENGTH, this, @@ -739,7 +766,7 @@ @Override @ForceInline - public short maxAll() { + public short maxLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Short256Vector.class, short.class, LENGTH, this, @@ -748,7 +775,7 @@ @Override @ForceInline - public short mulAll() { + public short mulLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Short256Vector.class, short.class, LENGTH, this, @@ -757,7 +784,7 @@ @Override @ForceInline - public short orAll() { + public short orLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Short256Vector.class, short.class, LENGTH, this, @@ -766,13 +793,13 @@ @Override @ForceInline - public short orAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orAll(); + public short orLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orLanes(); } @Override @ForceInline - public short xorAll() { + public short xorLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Short256Vector.class, short.class, LENGTH, this, @@ -781,34 +808,34 @@ @Override @ForceInline - public short xorAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorAll(); + public short xorLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public short addAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addAll(); + public short addLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addLanes(); } @Override @ForceInline - public short mulAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulAll(); + public short mulLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public short minAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minAll(); + public short minLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public short maxAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxAll(); + public short maxLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1029,7 +1056,7 @@ @Override - public Short256Vector rotateEL(int j) { + public Short256Vector rotateLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1039,7 +1066,7 @@ } @Override - public Short256Vector rotateER(int j) { + public Short256Vector rotateLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1054,7 +1081,7 @@ } @Override - public Short256Vector shiftEL(int j) { + public Short256Vector shiftLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++) { @@ -1064,7 +1091,7 @@ } @Override - public Short256Vector shiftER(int j) { + public Short256Vector shiftLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java 2019-04-26 14:51:31.848936500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java 2019-04-26 14:51:31.266504300 -0700 @@ -155,7 +155,7 @@ return VectorIntrinsics.cast( Short512Vector.class, short.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -293,7 +293,7 @@ @ForceInline public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( Short512Vector.class, short.class, LENGTH, @@ -302,7 +302,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) { return VectorIntrinsics.reinterpret( Short512Vector.class, short.class, LENGTH, @@ -311,7 +311,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) { return VectorIntrinsics.reinterpret( Short512Vector.class, short.class, LENGTH, @@ -320,7 +320,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) { return VectorIntrinsics.reinterpret( Short512Vector.class, short.class, LENGTH, @@ -330,7 +330,7 @@ (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) { return VectorIntrinsics.reinterpret( Short512Vector.class, short.class, LENGTH, @@ -657,47 +657,74 @@ @Override @ForceInline - public Short512Vector shiftL(int s) { + public Short512Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Short512Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF)))); } @Override @ForceInline - public Short512Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Short512Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Short512Vector shiftR(int s) { + public Short512Vector shiftLeft(Vector s) { + Short512Vector shiftv = (Short512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF))); + } + + @Override + @ForceInline + public Short512Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Short512Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public Short512Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Short512Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Short512Vector shiftRight(Vector s) { + Short512Vector shiftv = (Short512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF))); } @Override @ForceInline - public Short512Vector aShiftR(int s) { + public Short512Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Short512Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF)))); + } + + @Override + @ForceInline + public Short512Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Short512Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Short512Vector shiftArithmeticRight(Vector s) { + Short512Vector shiftv = (Short512Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF))); } // Ternary operations @@ -706,7 +733,7 @@ @Override @ForceInline - public short addAll() { + public short addLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Short512Vector.class, short.class, LENGTH, this, @@ -715,7 +742,7 @@ @Override @ForceInline - public short andAll() { + public short andLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Short512Vector.class, short.class, LENGTH, this, @@ -724,13 +751,13 @@ @Override @ForceInline - public short andAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andAll(); + public short andLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andLanes(); } @Override @ForceInline - public short minAll() { + public short minLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Short512Vector.class, short.class, LENGTH, this, @@ -739,7 +766,7 @@ @Override @ForceInline - public short maxAll() { + public short maxLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Short512Vector.class, short.class, LENGTH, this, @@ -748,7 +775,7 @@ @Override @ForceInline - public short mulAll() { + public short mulLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Short512Vector.class, short.class, LENGTH, this, @@ -757,7 +784,7 @@ @Override @ForceInline - public short orAll() { + public short orLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Short512Vector.class, short.class, LENGTH, this, @@ -766,13 +793,13 @@ @Override @ForceInline - public short orAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orAll(); + public short orLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orLanes(); } @Override @ForceInline - public short xorAll() { + public short xorLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Short512Vector.class, short.class, LENGTH, this, @@ -781,34 +808,34 @@ @Override @ForceInline - public short xorAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorAll(); + public short xorLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public short addAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addAll(); + public short addLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addLanes(); } @Override @ForceInline - public short mulAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulAll(); + public short mulLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public short minAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minAll(); + public short minLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public short maxAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxAll(); + public short maxLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1029,7 +1056,7 @@ @Override - public Short512Vector rotateEL(int j) { + public Short512Vector rotateLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1039,7 +1066,7 @@ } @Override - public Short512Vector rotateER(int j) { + public Short512Vector rotateLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1054,7 +1081,7 @@ } @Override - public Short512Vector shiftEL(int j) { + public Short512Vector shiftLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++) { @@ -1064,7 +1091,7 @@ } @Override - public Short512Vector shiftER(int j) { + public Short512Vector shiftLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java 2019-04-26 14:51:36.374039300 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java 2019-04-26 14:51:35.780374900 -0700 @@ -155,7 +155,7 @@ return VectorIntrinsics.cast( Short64Vector.class, short.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -293,7 +293,7 @@ @ForceInline public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( Short64Vector.class, short.class, LENGTH, @@ -302,7 +302,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) { return VectorIntrinsics.reinterpret( Short64Vector.class, short.class, LENGTH, @@ -311,7 +311,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) { return VectorIntrinsics.reinterpret( Short64Vector.class, short.class, LENGTH, @@ -320,7 +320,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) { return VectorIntrinsics.reinterpret( Short64Vector.class, short.class, LENGTH, @@ -330,7 +330,7 @@ (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) { return VectorIntrinsics.reinterpret( Short64Vector.class, short.class, LENGTH, @@ -657,47 +657,74 @@ @Override @ForceInline - public Short64Vector shiftL(int s) { + public Short64Vector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, Short64Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF)))); } @Override @ForceInline - public Short64Vector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public Short64Vector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public Short64Vector shiftR(int s) { + public Short64Vector shiftLeft(Vector s) { + Short64Vector shiftv = (Short64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF))); + } + + @Override + @ForceInline + public Short64Vector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, Short64Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public Short64Vector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public Short64Vector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public Short64Vector shiftRight(Vector s) { + Short64Vector shiftv = (Short64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF))); } @Override @ForceInline - public Short64Vector aShiftR(int s) { + public Short64Vector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, Short64Vector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF)))); + } + + @Override + @ForceInline + public Short64Vector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public Short64Vector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public Short64Vector shiftArithmeticRight(Vector s) { + Short64Vector shiftv = (Short64Vector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF))); } // Ternary operations @@ -706,7 +733,7 @@ @Override @ForceInline - public short addAll() { + public short addLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, Short64Vector.class, short.class, LENGTH, this, @@ -715,7 +742,7 @@ @Override @ForceInline - public short andAll() { + public short andLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, Short64Vector.class, short.class, LENGTH, this, @@ -724,13 +751,13 @@ @Override @ForceInline - public short andAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andAll(); + public short andLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andLanes(); } @Override @ForceInline - public short minAll() { + public short minLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, Short64Vector.class, short.class, LENGTH, this, @@ -739,7 +766,7 @@ @Override @ForceInline - public short maxAll() { + public short maxLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, Short64Vector.class, short.class, LENGTH, this, @@ -748,7 +775,7 @@ @Override @ForceInline - public short mulAll() { + public short mulLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, Short64Vector.class, short.class, LENGTH, this, @@ -757,7 +784,7 @@ @Override @ForceInline - public short orAll() { + public short orLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, Short64Vector.class, short.class, LENGTH, this, @@ -766,13 +793,13 @@ @Override @ForceInline - public short orAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orAll(); + public short orLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orLanes(); } @Override @ForceInline - public short xorAll() { + public short xorLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, Short64Vector.class, short.class, LENGTH, this, @@ -781,34 +808,34 @@ @Override @ForceInline - public short xorAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorAll(); + public short xorLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public short addAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addAll(); + public short addLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addLanes(); } @Override @ForceInline - public short mulAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulAll(); + public short mulLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public short minAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minAll(); + public short minLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public short maxAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxAll(); + public short maxLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1029,7 +1056,7 @@ @Override - public Short64Vector rotateEL(int j) { + public Short64Vector rotateLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1039,7 +1066,7 @@ } @Override - public Short64Vector rotateER(int j) { + public Short64Vector rotateLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1054,7 +1081,7 @@ } @Override - public Short64Vector shiftEL(int j) { + public Short64Vector shiftLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++) { @@ -1064,7 +1091,7 @@ } @Override - public Short64Vector shiftER(int j) { + public Short64Vector shiftLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java 2019-04-26 14:51:41.086840200 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java 2019-04-26 14:51:40.495682900 -0700 @@ -155,7 +155,7 @@ return VectorIntrinsics.cast( ShortMaxVector.class, short.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -293,7 +293,7 @@ @ForceInline public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( ShortMaxVector.class, short.class, LENGTH, @@ -302,7 +302,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == Short128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == Short128Vector.class)) { return VectorIntrinsics.reinterpret( ShortMaxVector.class, short.class, LENGTH, @@ -311,7 +311,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == Short256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == Short256Vector.class)) { return VectorIntrinsics.reinterpret( ShortMaxVector.class, short.class, LENGTH, @@ -320,7 +320,7 @@ this, s, (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == Short512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == Short512Vector.class)) { return VectorIntrinsics.reinterpret( ShortMaxVector.class, short.class, LENGTH, @@ -330,7 +330,7 @@ (species, vector) -> (ShortVector) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == ShortMaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == ShortMaxVector.class)) { return VectorIntrinsics.reinterpret( ShortMaxVector.class, short.class, LENGTH, @@ -657,47 +657,74 @@ @Override @ForceInline - public ShortMaxVector shiftL(int s) { + public ShortMaxVector shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, ShortMaxVector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a << (i & 0xF)))); } @Override @ForceInline - public ShortMaxVector shiftL(int s, VectorMask m) { - return blend(shiftL(s), m); + public ShortMaxVector shiftLeft(int s, VectorMask m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public ShortMaxVector shiftR(int s) { + public ShortMaxVector shiftLeft(Vector s) { + ShortMaxVector shiftv = (ShortMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a << (b & 0xF))); + } + + @Override + @ForceInline + public ShortMaxVector shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, ShortMaxVector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public ShortMaxVector shiftRight(int s, VectorMask m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public ShortMaxVector shiftR(int s, VectorMask m) { - return blend(shiftR(s), m); + public ShortMaxVector shiftRight(Vector s) { + ShortMaxVector shiftv = (ShortMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >>> (b & 0xF))); } @Override @ForceInline - public ShortMaxVector aShiftR(int s) { + public ShortMaxVector shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, ShortMaxVector.class, short.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> (short) (a >> (i & 0xF)))); + } + + @Override + @ForceInline + public ShortMaxVector shiftArithmeticRight(int s, VectorMask m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public ShortMaxVector aShiftR(int s, VectorMask m) { - return blend(aShiftR(s), m); + public ShortMaxVector shiftArithmeticRight(Vector s) { + ShortMaxVector shiftv = (ShortMaxVector)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and(ShortVector.broadcast(SPECIES, (short) 0xF)); + return this.bOp(shiftv, (i, a, b) -> (short) (a >> (b & 0xF))); } // Ternary operations @@ -706,7 +733,7 @@ @Override @ForceInline - public short addAll() { + public short addLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, ShortMaxVector.class, short.class, LENGTH, this, @@ -715,7 +742,7 @@ @Override @ForceInline - public short andAll() { + public short andLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, ShortMaxVector.class, short.class, LENGTH, this, @@ -724,13 +751,13 @@ @Override @ForceInline - public short andAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andAll(); + public short andLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) -1).blend(this, m).andLanes(); } @Override @ForceInline - public short minAll() { + public short minLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, ShortMaxVector.class, short.class, LENGTH, this, @@ -739,7 +766,7 @@ @Override @ForceInline - public short maxAll() { + public short maxLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, ShortMaxVector.class, short.class, LENGTH, this, @@ -748,7 +775,7 @@ @Override @ForceInline - public short mulAll() { + public short mulLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, ShortMaxVector.class, short.class, LENGTH, this, @@ -757,7 +784,7 @@ @Override @ForceInline - public short orAll() { + public short orLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, ShortMaxVector.class, short.class, LENGTH, this, @@ -766,13 +793,13 @@ @Override @ForceInline - public short orAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orAll(); + public short orLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).orLanes(); } @Override @ForceInline - public short xorAll() { + public short xorLanes() { return (short) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, ShortMaxVector.class, short.class, LENGTH, this, @@ -781,34 +808,34 @@ @Override @ForceInline - public short xorAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorAll(); + public short xorLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).xorLanes(); } @Override @ForceInline - public short addAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addAll(); + public short addLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 0).blend(this, m).addLanes(); } @Override @ForceInline - public short mulAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulAll(); + public short mulLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, (short) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public short minAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minAll(); + public short minLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public short maxAll(VectorMask m) { - return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxAll(); + public short maxLanes(VectorMask m) { + return ShortVector.broadcast(SPECIES, Short.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1029,7 +1056,7 @@ @Override - public ShortMaxVector rotateEL(int j) { + public ShortMaxVector rotateLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1039,7 +1066,7 @@ } @Override - public ShortMaxVector rotateER(int j) { + public ShortMaxVector rotateLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length(); i++){ @@ -1054,7 +1081,7 @@ } @Override - public ShortMaxVector shiftEL(int j) { + public ShortMaxVector shiftLanesLeft(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++) { @@ -1064,7 +1091,7 @@ } @Override - public ShortMaxVector shiftER(int j) { + public ShortMaxVector shiftLanesRight(int j) { short[] vec = getElements(); short[] res = new short[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java 2019-04-26 14:51:45.865548900 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java 2019-04-26 14:51:45.280387800 -0700 @@ -112,7 +112,7 @@ @ForceInline @SuppressWarnings("unchecked") public static ShortVector zero(VectorSpecies species) { - return VectorIntrinsics.broadcastCoerced((Class) species.boxType(), short.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class) species.vectorType(), short.class, species.length(), 0, species, ((bits, s) -> ((ShortSpecies)s).op(i -> (short)bits))); } @@ -142,7 +142,7 @@ public static ShortVector fromByteArray(VectorSpecies species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), short.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), short.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -200,7 +200,7 @@ public static ShortVector fromArray(VectorSpecies species, short[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), short.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), short.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_SHORT_BASE_OFFSET, a, offset, species, (c, idx, s) -> ((ShortSpecies)s).op(n -> c[idx + n])); @@ -313,7 +313,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class) species.boxType(), short.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), short.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -369,7 +369,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -377,7 +377,7 @@ @SuppressWarnings("unchecked") public static ShortVector broadcast(VectorSpecies species, short e) { return VectorIntrinsics.broadcastCoerced( - (Class) species.boxType(), short.class, species.length(), + (Class) species.vectorType(), short.class, species.length(), e, species, ((bits, sp) -> ((ShortSpecies)sp).op(i -> (short)bits))); } @@ -401,7 +401,7 @@ public static ShortVector scalars(VectorSpecies species, short... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class) species.boxType(), short.class, species.length(), + return VectorIntrinsics.load((Class) species.vectorType(), short.class, species.length(), es, Unsafe.ARRAY_SHORT_BASE_OFFSET, es, ix, species, (c, idx, sp) -> ((ShortSpecies)sp).op(n -> c[idx + n])); @@ -779,25 +779,25 @@ * {@inheritDoc} */ @Override - public abstract ShortVector rotateEL(int i); + public abstract ShortVector rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract ShortVector rotateER(int i); + public abstract ShortVector rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract ShortVector shiftEL(int i); + public abstract ShortVector shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract ShortVector shiftER(int i); + public abstract ShortVector shiftLanesRight(int i); @@ -977,16 +977,16 @@ *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. * * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftL(int s); + public abstract ShortVector shiftLeft(int s); /** * Logically left shifts this vector by the broadcast of an input scalar, @@ -994,18 +994,53 @@ *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftL(int s, VectorMask m); + public abstract ShortVector shiftLeft(int s, VectorMask m); + /** + * Logically left shifts this vector by an input vector. + *

+ * This is a lane-wise binary operation which applies the primitive logical left shift + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @return the result of logically left shifting this vector by the input + * vector + */ + public abstract ShortVector shiftLeft(Vector v); + + /** + * Logically left shifts this vector by an input vector, selecting lane + * elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive logical left shift + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of logically left shifting this vector by the input + * vector + */ + public ShortVector shiftLeft(Vector v, VectorMask m) { + return blend(shiftLeft(v), m); + } // logical, or unsigned, shift right @@ -1015,8 +1050,8 @@ *

* This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. * @@ -1024,7 +1059,7 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftR(int s); + public abstract ShortVector shiftRight(int s); /** * Logically right shifts (or unsigned right shifts) this vector by the @@ -1032,9 +1067,9 @@ * mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * operation ({@code >>}) to each lane to logically right shift the + * element by shift value as specified by the input scalar. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. * @@ -1043,8 +1078,44 @@ * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector shiftR(int s, VectorMask m); + public abstract ShortVector shiftRight(int s, VectorMask m); + /** + * Logically right shifts (or unsigned right shifts) this vector by an + * input vector. + *

+ * This is a lane-wise binary operation which applies the primitive logical right shift + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @return the result of logically right shifting this vector by the + * input vector + */ + public abstract ShortVector shiftRight(Vector v); + + /** + * Logically right shifts (or unsigned right shifts) this vector by an + * input vector, selecting lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive logical right shift + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of logically right shifting this vector by the + * input vector + */ + public ShortVector shiftRight(Vector v, VectorMask m) { + return blend(shiftRight(v), m); + } /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1061,7 +1132,7 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector aShiftR(int s); + public abstract ShortVector shiftArithmeticRight(int s); /** * Arithmetically right shifts (or signed right shifts) this vector by the @@ -1080,8 +1151,120 @@ * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ - public abstract ShortVector aShiftR(int s, VectorMask m); + public abstract ShortVector shiftArithmeticRight(int s, VectorMask m); + /** + * Arithmetically right shifts (or signed right shifts) this vector by an + * input vector. + *

+ * This is a lane-wise binary operation which applies the primitive arithmetic right + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public abstract ShortVector shiftArithmeticRight(Vector v); + + /** + * Arithmetically right shifts (or signed right shifts) this vector by an + * input vector, selecting lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which applies the primitive arithmetic right + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. + * + * @param v the input vector + * @param m the mask controlling lane selection + * @return the result of arithmetically right shifting this vector by the + * input vector + */ + public ShortVector shiftArithmeticRight(Vector v, VectorMask m) { + return blend(shiftArithmeticRight(v), m); + } + + /** + * Rotates left this vector by the broadcast of an input scalar. + *

+ * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. + * + * @param s the input scalar; the number of the bits to rotate left + * @return the result of rotating left this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ShortVector rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); + } + + /** + * Rotates left this vector by the broadcast of an input scalar, selecting + * lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. + * + * @param s the input scalar; the number of the bits to rotate left + * @param m the mask controlling lane selection + * @return the result of rotating left this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ShortVector rotateLeft(int s, VectorMask m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); + } + + /** + * Rotates right this vector by the broadcast of an input scalar. + *

+ * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. + * + * @param s the input scalar; the number of the bits to rotate right + * @return the result of rotating right this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ShortVector rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); + } + + /** + * Rotates right this vector by the broadcast of an input scalar, selecting + * lane elements controlled by a mask. + *

+ * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. + * + * @param s the input scalar; the number of the bits to rotate right + * @param m the mask controlling lane selection + * @return the result of rotating right this vector by the broadcast of an + * input scalar + */ + @ForceInline + public final ShortVector rotateRight(int s, VectorMask m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); + } /** * {@inheritDoc} @@ -1118,7 +1301,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract short addAll(); + public abstract short addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -1131,7 +1314,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract short addAll(VectorMask m); + public abstract short addLanes(VectorMask m); /** * Multiplies all lane elements of this vector. @@ -1142,7 +1325,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract short mulAll(); + public abstract short mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -1155,7 +1338,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract short mulAll(VectorMask m); + public abstract short mulLanes(VectorMask m); /** * Returns the minimum lane element of this vector. @@ -1167,7 +1350,7 @@ * * @return the minimum lane element of this vector */ - public abstract short minAll(); + public abstract short minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -1181,7 +1364,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract short minAll(VectorMask m); + public abstract short minLanes(VectorMask m); /** * Returns the maximum lane element of this vector. @@ -1193,7 +1376,7 @@ * * @return the maximum lane element of this vector */ - public abstract short maxAll(); + public abstract short maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -1207,7 +1390,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract short maxAll(VectorMask m); + public abstract short maxLanes(VectorMask m); /** * Logically ORs all lane elements of this vector. @@ -1218,7 +1401,7 @@ * * @return the logical OR all the lane elements of this vector */ - public abstract short orAll(); + public abstract short orLanes(); /** * Logically ORs all lane elements of this vector, selecting lane elements @@ -1231,7 +1414,7 @@ * @param m the mask controlling lane selection * @return the logical OR all the lane elements of this vector */ - public abstract short orAll(VectorMask m); + public abstract short orLanes(VectorMask m); /** * Logically ANDs all lane elements of this vector. @@ -1242,7 +1425,7 @@ * * @return the logical AND all the lane elements of this vector */ - public abstract short andAll(); + public abstract short andLanes(); /** * Logically ANDs all lane elements of this vector, selecting lane elements @@ -1255,7 +1438,7 @@ * @param m the mask controlling lane selection * @return the logical AND all the lane elements of this vector */ - public abstract short andAll(VectorMask m); + public abstract short andLanes(VectorMask m); /** * Logically XORs all lane elements of this vector. @@ -1266,7 +1449,7 @@ * * @return the logical XOR all the lane elements of this vector */ - public abstract short xorAll(); + public abstract short xorLanes(); /** * Logically XORs all lane elements of this vector, selecting lane elements @@ -1279,7 +1462,7 @@ * @param m the mask controlling lane selection * @return the logical XOR all the lane elements of this vector */ - public abstract short xorAll(VectorMask m); + public abstract short xorLanes(VectorMask m); // Type specific accessors @@ -1426,13 +1609,13 @@ final Function vectorFactory; private ShortSpecies(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray shuffleFromOpFactory) { - super(shape, short.class, Short.SIZE, boxType, maskType, maskFactory, + super(shape, short.class, Short.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java 2019-04-26 14:51:50.608689500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java 2019-04-26 14:51:49.985777300 -0700 @@ -105,7 +105,7 @@ * EVector a = ...; * e[] ar = new e[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_unary_op(a.get(i)); + * ar[i] = scalar_unary_op(a.lane(i)); * } * EVector r = EVector.fromArray(a.species(), ar, 0); * } @@ -127,7 +127,7 @@ * EVector b = ...; * e[] ar = new e[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_binary_op(a.get(i), b.get(i)); + * ar[i] = scalar_binary_op(a.lane(i), b.lane(i)); * } * EVector r = EVector.fromArray(a.species(), ar, 0); * } @@ -159,7 +159,7 @@ * EVector a = ...; * e r = ; * for (int i = 0; i < a.length(); i++) { - * r = assoc_scalar_binary_op(r, a.get(i)); + * r = assoc_scalar_binary_op(r, a.lane(i)); * } * } * @@ -178,7 +178,7 @@ * EVector b = ...; * boolean[] ar = new boolean[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_binary_test_op(a.get(i), b.get(i)); + * ar[i] = scalar_binary_test_op(a.lane(i), b.lane(i)); * } * VectorMask r = VectorMask.fromArray(a.species(), ar, 0); * } @@ -278,7 +278,7 @@ /** * Returns the element size, in bits, of this vector. * - * @return the element size, in bits + * @return the element size, in bits, of this vector */ public int elementSize() { return species().elementSize(); } @@ -297,9 +297,9 @@ public int length() { return species().length(); } /** - * Returns the total vector size, in bits. + * Returns the total size, in bits, of this vector. * - * @return the total vector size, in bits + * @return the total size, in bits, of this vector */ public int bitSize() { return species().bitSize(); } @@ -391,7 +391,7 @@ * Negates this vector, selecting lane elements controlled by a mask. *

* This is a lane-wise unary operation which applies the primitive negation operation - * ({@code -})to each lane. + * ({@code -}) to each lane. * * @param m the mask controlling lane selection * @return the negation this vector @@ -475,7 +475,7 @@ /** * Tests if this vector is equal to an input vector. *

- * This is a lane-wise binary test operation where the primitive equals + * This is a lane-wise binary test operation which applies the primitive equals * operation ({@code ==}) to each lane. * * @param v the input vector @@ -487,7 +487,7 @@ /** * Tests if this vector is not equal to an input vector. *

- * This is a lane-wise binary test operation where the primitive not equals + * This is a lane-wise binary test operation which applies the primitive not equals * operation ({@code !=}) to each lane. * * @param v the input vector @@ -499,7 +499,7 @@ /** * Tests if this vector is less than an input vector. *

- * This is a lane-wise binary test operation where the primitive less than + * This is a lane-wise binary test operation which applies the primitive less than * operation ({@code <}) to each lane. * * @param v the input vector @@ -511,7 +511,7 @@ /** * Tests if this vector is less or equal to an input vector. *

- * This is a lane-wise binary test operation where the primitive less than + * This is a lane-wise binary test operation which applies the primitive less than * or equal to operation ({@code <=}) to each lane. * * @param v the input vector @@ -523,7 +523,7 @@ /** * Tests if this vector is greater than an input vector. *

- * This is a lane-wise binary test operation where the primitive greater than + * This is a lane-wise binary test operation which applies the primitive greater than * operation ({@code >}) to each lane. * * @param v the input vector @@ -535,7 +535,7 @@ /** * Tests if this vector is greater than or equal to an input vector. *

- * This is a lane-wise binary test operation where the primitive greater than + * This is a lane-wise binary test operation which applies the primitive greater than * or equal to operation ({@code >=}) to each lane. * * @param v the input vector @@ -560,7 +560,7 @@ * @return the result of rotating left lane elements of this vector by the * given number of lanes */ - public abstract Vector rotateEL(int i); + public abstract Vector rotateLanesLeft(int i); /** * Rotates right the lane elements of this vector by the given number of @@ -572,11 +572,11 @@ * element is placed into the result vector at lane index * {@code (N + length() - (i % length())) % length()} * - * @param i the number of lanes to rotate left + * @param i the number of lanes to rotate right * @return the result of rotating right lane elements of this vector by the * given number of lanes */ - public abstract Vector rotateER(int i); + public abstract Vector rotateLanesRight(int i); /** * Shift left the lane elements of this vector by the given number of @@ -592,7 +592,7 @@ * given number of lanes * @throws IllegalArgumentException if {@code i} is {@code < 0}. */ - public abstract Vector shiftEL(int i); + public abstract Vector shiftLanesLeft(int i); /** * Shift right the lane elements of this vector by the given number of @@ -608,7 +608,7 @@ * given number of lanes * @throws IllegalArgumentException if {@code i} is {@code < 0}. */ - public abstract Vector shiftER(int i); + public abstract Vector shiftLanesRight(int i); /** * Blends the lane elements of this vector with those of an input vector, @@ -628,6 +628,21 @@ public abstract Vector blend(Vector v, VectorMask m); /** + * Rearranges the lane elements of this vector selecting lane indexes + * controlled by a shuffle. + *

+ * This is a cross-lane operation that rearranges the lane elements of this + * vector. + * For each lane of the shuffle, at lane index {@code N} with lane + * element {@code I}, the lane element at {@code I} from this vector is + * selected and placed into the resulting vector at {@code N}. + * + * @param s the shuffle controlling lane index selection + * @return the rearrangement of the lane elements of this vector + */ + public abstract Vector rearrange(VectorShuffle s); + + /** * Rearranges the lane elements of this vector and those of an input vector, * selecting lane indexes controlled by shuffles and a mask. *

@@ -647,26 +662,9 @@ * @return the rearrangement of lane elements of this vector and * those of an input vector */ - @ForceInline - // rearrange public abstract Vector rearrange(Vector v, VectorShuffle s, VectorMask m); - /** - * Rearranges the lane elements of this vector selecting lane indexes - * controlled by a shuffle. - *

- * This is a cross-lane operation that rearranges the lane elements of this - * vector. - * For each lane of the shuffle, at lane index {@code N} with lane - * element {@code I}, the lane element at {@code I} from this vector is - * selected and placed into the resulting vector at {@code N}. - * - * @param s the shuffle controlling lane index selection - * @return the rearrangement of the lane elements of this vector - */ - // rearrange - public abstract Vector rearrange(VectorShuffle s); // Conversions @@ -716,8 +714,8 @@ *

* The following pseudocode expresses the behavior: *

{@code
-     * int blen = Math.max(this.bitSize(), s.bitSize()) / Byte.SIZE;
-     * ByteBuffer bb = ByteBuffer.allocate(blen).order(ByteOrder.nativeOrder());
+     * int bufferLen = Math.max(this.bitSize(), s.bitSize()) / Byte.SIZE;
+     * ByteBuffer bb = ByteBuffer.allocate(bufferLen).order(ByteOrder.nativeOrder());
      * this.intoByteBuffer(bb, 0);
      * return $type$Vector.fromByteBuffer(s, bb, 0);
      * }
@@ -725,8 +723,9 @@ * @param s species of desired vector * @param the boxed element type of the species * @return a vector transformed, by shape and element type, from this vector + * @see Vector#reshape(VectorSpecies) + * @see Vector#cast(VectorSpecies) */ - @ForceInline public abstract Vector reinterpret(VectorSpecies s); @ForceInline @@ -775,6 +774,8 @@ * * @param s species of the desired vector * @return a vector transformed, by shape, from this vector + * @see Vector#reinterpret(VectorSpecies) + * @see Vector#cast(VectorSpecies) */ public abstract Vector reshape(VectorSpecies s); @@ -796,6 +797,8 @@ * @param s species of the desired vector * @param the boxed element type of the species * @return a vector converted by shape and element type from this vector + * @see Vector#reshape(VectorSpecies) + * @see Vector#reinterpret(VectorSpecies) */ public abstract Vector cast(VectorSpecies s); @@ -936,4 +939,186 @@ throw new IllegalArgumentException("Bad vector type: " + c.getName()); } } + + /** + * Returns a mask of same species as {@code this} vector and where each lane is set or unset according to given + * {@code boolean} values. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorMask#fromValues(VectorSpecies, boolean...) fromValues()} + * method in VectorMask as follows: + *

 {@code
+     *     return VectorMask.fromValues(this.species(), bits);
+     * } 
+ * + * @param bits the given {@code boolean} values + * @return a mask where each lane is set or unset according to the given {@code boolean} value + * @throws IndexOutOfBoundsException if {@code bits.length < this.species().length()} + * @see VectorMask#fromValues(VectorSpecies, boolean...) + */ + @ForceInline + public final VectorMask maskFromValues(boolean... bits) { + return VectorMask.fromValues(this.species(), bits); + } + + /** + * Loads a mask of same species as {@code this} vector from a {@code boolean} array starting at an offset. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorMask#fromArray(VectorSpecies, boolean[], int) fromArray()} + * method in VectorMask as follows: + *

 {@code
+     *     return VectorMask.fromArray(this.species(), bits, offset);
+     * } 
+ * + * @param bits the {@code boolean} array + * @param offset the offset into the array + * @return the mask loaded from a {@code boolean} array + * @throws IndexOutOfBoundsException if {@code offset < 0}, or + * {@code offset > bits.length - species.length()} + * @see VectorMask#fromArray(VectorSpecies, boolean[], int) + */ + @ForceInline + public final VectorMask maskFromArray(boolean[] bits, int offset) { + return VectorMask.fromArray(this.species(), bits, offset); + } + + /** + * Returns a mask of same species as {@code this} vector and where all lanes are set. + * + * @return a mask where all lanes are set + * @see VectorMask#maskAllTrue(VectorSpecies) + */ + @ForceInline + public final VectorMask maskAllTrue() { + return VectorMask.maskAllTrue(this.species()); + } + + /** + * Returns a mask of same species as {@code this} vector and where all lanes are unset. + * + * @return a mask where all lanes are unset + * @see VectorMask#maskAllFalse(VectorSpecies) + */ + @ForceInline + public final VectorMask maskAllFalse() { + return VectorMask.maskAllFalse(this.species()); + } + + /** + * Returns a shuffle of same species as {@code this} vector and where each lane element is set to a given + * {@code int} value logically AND'ed by the species length minus one. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#fromValues(VectorSpecies, int...) fromValues()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return VectorShuffle.fromValues(this.species(), ixs);
+     * } 
+ * + * @param ixs the given {@code int} values + * @return a shuffle where each lane element is set to a given + * {@code int} value + * @throws IndexOutOfBoundsException if the number of int values is + * {@code < this.species().length()} + * @see AbstractShuffle#fromValues(VectorSpecies, int...) + */ + @ForceInline + public final VectorShuffle shuffleFromValues(int... ixs) { + return VectorShuffle.fromValues(this.species(), ixs); + } + + /** + * Loads a shuffle of same species as {@code this} vector from an {@code int} array starting at an offset. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#fromArray(VectorSpecies, int[], int) fromArray()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return VectorShuffle.fromArray(this.species(), ixs, offset);
+     * } 
+ * + * @param ixs the {@code int} array + * @param offset the offset into the array + * @return a shuffle loaded from the {@code int} array + * @throws IndexOutOfBoundsException if {@code offset < 0}, or + * {@code offset > ixs.length - this.species().length()} + * @see AbstractShuffle#fromArray(VectorSpecies, int[], int) + */ + @ForceInline + public final VectorShuffle shuffleFromArray(int[] ixs, int offset) { + return VectorShuffle.fromArray(this.species(), ixs, offset); + } + + /** + * Returns a shuffle of same species as {@code this} vector of mapped indexes where each lane element is + * the result of applying a mapping function to the corresponding lane + * index. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffle(VectorSpecies, IntUnaryOperator) shuffle()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return AbstractShuffle.shuffle(this.species(), f);
+     * } 
+ * + * @param f the lane index mapping function + * @return a shuffle of mapped indexes + * @see AbstractShuffle#shuffle(VectorSpecies, IntUnaryOperator) + */ + @ForceInline + public final VectorShuffle shuffle(IntUnaryOperator f) { + return AbstractShuffle.shuffle(this.species(), f); + } + + /** + * Returns a shuffle of same species as {@code this} vector and where each lane element is the value of its + * corresponding lane index. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleIota(VectorSpecies) shuffleIota()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return VectorShuffle.shuffleIota(this.species());
+     * } 
+ * + * @return a shuffle of lane indexes + * @see AbstractShuffle#shuffleIota(VectorSpecies) + */ + @ForceInline + public final VectorShuffle shuffleIota() { + return VectorShuffle.shuffleIota(this.species()); + } + + /** + * Returns a shuffle of same species as {@code this} vector and with lane elements set to sequential {@code int} + * values starting from {@code start}. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleIota(VectorSpecies, int) shuffleIota()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return VectorShuffle.shuffleIota(this.species(), start);
+     * } 
+ * + * @param start starting value of sequence + * @return a shuffle of lane indexes + * @see AbstractShuffle#shuffleIota(VectorSpecies, int) + */ + @ForceInline + public final VectorShuffle shuffleIota(int start) { + return VectorShuffle.shuffleIota(this.species(), start); + } + + /** + * Returns a shuffle of same species as {@code this} vector and with lane elements set to sequential {@code int} + * values starting from {@code start} and looping around species length. + *

+ * This method behaves as if it returns the result of calling the static {@link VectorShuffle#shuffleOffset(VectorSpecies, int) shuffleOffset()} + * method in VectorShuffle as follows: + *

 {@code
+     *     return VectorShuffle.shuffleOffset(this.species(), start);
+     * } 
+ * + * @param start starting value of sequence + * @return a shuffle of lane indexes + * @see AbstractShuffle#shuffleOffset(VectorSpecies, int) + */ + @ForceInline + public final VectorShuffle shuffleOffset(int start) { + return VectorShuffle.shuffleOffset(this.species(), start); + } } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java 2019-04-26 14:51:55.385973400 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java 2019-04-26 14:51:54.767190900 -0700 @@ -121,7 +121,7 @@ /** * Returns a mask where each lane is set or unset according to given - * {@code boolean} values + * {@code boolean} values. *

* For each mask lane, where {@code N} is the mask lane index, * if the given {@code boolean} value at index {@code N} is {@code true} @@ -131,6 +131,7 @@ * @param bits the given {@code boolean} values * @return a mask where each lane is set or unset according to the given {@code boolean} value * @throws IndexOutOfBoundsException if {@code bits.length < species.length()} + * @see Vector#maskFromValues(boolean...) */ @ForceInline public static VectorMask fromValues(VectorSpecies species, boolean... bits) { @@ -150,6 +151,7 @@ * @return the mask loaded from a {@code boolean} array * @throws IndexOutOfBoundsException if {@code offset < 0}, or * {@code offset > bits.length - species.length()} + * @see Vector#maskFromArray(boolean[], int) */ @ForceInline @SuppressWarnings("unchecked") @@ -167,6 +169,7 @@ * * @param species mask species * @return a mask where all lanes are set + * @see Vector#maskAllTrue() */ @ForceInline @SuppressWarnings("unchecked") @@ -181,6 +184,7 @@ * * @param species mask species * @return a mask where all lanes are unset + * @see Vector#maskAllFalse() */ @ForceInline @SuppressWarnings("unchecked") --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java 2019-04-26 14:52:00.027087500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShuffle.java 2019-04-26 14:51:59.431729900 -0700 @@ -105,6 +105,7 @@ * @param species shuffle species * @param f the lane index mapping function * @return a shuffle of mapped indexes + * @see Vector#shuffle(IntUnaryOperator) */ @ForceInline public static VectorShuffle shuffle(VectorSpecies species, IntUnaryOperator f) { @@ -123,6 +124,7 @@ * * @param species shuffle species * @return a shuffle of lane indexes + * @see Vector#shuffleIota() */ @ForceInline public static VectorShuffle shuffleIota(VectorSpecies species) { @@ -141,6 +143,7 @@ * @param species shuffle species * @param start starting value of sequence * @return a shuffle of lane indexes + * @see Vector#shuffleIota(int) */ @ForceInline public static VectorShuffle shuffleIota(VectorSpecies species, int start) { @@ -160,6 +163,7 @@ * @param species shuffle species * @param start starting value of sequence * @return a shuffle of lane indexes + * @see Vector#shuffleOffset(int) */ @ForceInline public static VectorShuffle shuffleOffset(VectorSpecies species, int start) { @@ -181,6 +185,7 @@ * {@code int} value * @throws IndexOutOfBoundsException if the number of int values is * {@code < species.length()} + * @see Vector#shuffleFromValues(int...) */ @ForceInline public static VectorShuffle fromValues(VectorSpecies species, int... ixs) { @@ -200,7 +205,8 @@ * @param offset the offset into the array * @return a shuffle loaded from the {@code int} array * @throws IndexOutOfBoundsException if {@code offset < 0}, or - * {@code offset > a.length - species.length()} + * {@code offset > ixs.length - species.length()} + * @see Vector#shuffleFromArray(int[], int) */ @ForceInline public static VectorShuffle fromArray(VectorSpecies species, int[] ixs, int offset) { --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java 2019-04-26 14:52:04.719459700 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorSpecies.java 2019-04-26 14:52:04.108155900 -0700 @@ -44,16 +44,16 @@ public abstract Class elementType(); /** - * Returns the vector box type for this species + * Returns the vector type corresponding to this species * - * @return the box type + * @return the vector type corresponding to this species */ - abstract Class boxType(); + abstract Class vectorType(); /** * Returns the vector mask type for this species * - * @return the box type + * @return the mask type */ abstract Class maskType(); @@ -69,19 +69,18 @@ * Returns the shape of masks, shuffles, and vectors produced by this * species. * - * @return the primitive element type + * @return the shape */ public abstract VectorShape shape(); /** * Returns the shape of the corresponding index species - * @return the shape + * @return the shape of index species */ - @ForceInline public abstract VectorShape indexShape(); /** - * Returns the mask, shuffe, or vector lanes produced by this species. + * Returns the mask, shuffle, or vector lanes produced by this species. * * @return the the number of lanes */ @@ -95,6 +94,16 @@ */ default public int bitSize() { return shape().bitSize(); } + /** + * Helper function to calculate the loop terminating condition when iterating over an array of given length. + * Returns the result of {@code (length & ~(this.length() - 1))} + * + * @return the result of {@code (length & ~(this.length() - 1))} + */ + default public int loopBound(int length) { + return length & ~(this.length() - 1); + } + // Factory /** --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template 2019-04-26 14:52:09.260437500 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template 2019-04-26 14:52:08.667840100 -0700 @@ -115,11 +115,11 @@ @SuppressWarnings("unchecked") public static $abstractvectortype$ zero(VectorSpecies<$Boxtype$> species) { #if[FP] - return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.vectorType(), $type$.class, species.length(), $Type$.$type$To$Bitstype$Bits(0.0f), species, ((bits, s) -> (($Type$Species)s).op(i -> $Type$.$bitstype$BitsTo$Type$(($bitstype$)bits)))); #else[FP] - return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.broadcastCoerced((Class<$Type$Vector>) species.vectorType(), $type$.class, species.length(), 0, species, ((bits, s) -> (($Type$Species)s).op(i -> ($type$)bits))); #end[FP] @@ -150,7 +150,7 @@ public static $abstractvectortype$ fromByteArray(VectorSpecies<$Boxtype$> species, byte[] a, int offset) { Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), a, ((long) offset) + Unsafe.ARRAY_BYTE_BASE_OFFSET, a, offset, species, (c, idx, s) -> { @@ -208,7 +208,7 @@ public static $abstractvectortype$ fromArray(VectorSpecies<$Boxtype$> species, $type$[] a, int offset){ Objects.requireNonNull(a); offset = VectorIntrinsics.checkIndex(offset, a.length, species.length()); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), a, (((long) offset) << ARRAY_SHIFT) + Unsafe.ARRAY_$TYPE$_BASE_OFFSET, a, offset, species, (c, idx, s) -> (($Type$Species)s).op(n -> c[idx + n])); @@ -281,8 +281,8 @@ vix = VectorIntrinsics.checkIndex(vix, a.length); - return VectorIntrinsics.loadWithMap((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), - IntVector.species(species.indexShape()).boxType(), a, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, vix, + return VectorIntrinsics.loadWithMap((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), + IntVector.species(species.indexShape()).vectorType(), a, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, vix, a, a_offset, indexMap, i_offset, species, ($type$[] c, int idx, int[] iMap, int idy, VectorSpecies<$Boxtype$> s) -> (($Type$Species)s).op(n -> c[idx + iMap[idy+n]])); @@ -358,7 +358,7 @@ throw new IllegalArgumentException(); } offset = VectorIntrinsics.checkIndex(offset, bb.limit(), species.bitSize() / Byte.SIZE); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), U.getReference(bb, BYTE_BUFFER_HB), U.getLong(bb, BUFFER_ADDRESS) + offset, bb, offset, species, (c, idx, s) -> { @@ -414,7 +414,7 @@ * value {@code e}. * * @param species species of the desired vector - * @param e the value + * @param e the value to be broadcasted * @return a vector of vector where all lane elements are set to * the primitive value {@code e} */ @@ -423,7 +423,7 @@ @SuppressWarnings("unchecked") public static $abstractvectortype$ broadcast(VectorSpecies<$Boxtype$> species, $type$ e) { return VectorIntrinsics.broadcastCoerced( - (Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + (Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), $Type$.$type$To$Bitstype$Bits(e), species, ((bits, sp) -> (($Type$Species)sp).op(i -> $Type$.$bitstype$BitsTo$Type$(($bitstype$)bits)))); } @@ -432,7 +432,7 @@ @SuppressWarnings("unchecked") public static $abstractvectortype$ broadcast(VectorSpecies<$Boxtype$> species, $type$ e) { return VectorIntrinsics.broadcastCoerced( - (Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + (Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), e, species, ((bits, sp) -> (($Type$Species)sp).op(i -> ($type$)bits))); } @@ -457,7 +457,7 @@ public static $abstractvectortype$ scalars(VectorSpecies<$Boxtype$> species, $type$... es) { Objects.requireNonNull(es); int ix = VectorIntrinsics.checkIndex(0, es.length, species.length()); - return VectorIntrinsics.load((Class<$abstractvectortype$>) species.boxType(), $type$.class, species.length(), + return VectorIntrinsics.load((Class<$abstractvectortype$>) species.vectorType(), $type$.class, species.length(), es, Unsafe.ARRAY_$TYPE$_BASE_OFFSET, es, ix, species, (c, idx, sp) -> (($Type$Species)sp).op(n -> c[idx + n])); @@ -853,25 +853,25 @@ * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ rotateEL(int i); + public abstract $abstractvectortype$ rotateLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ rotateER(int i); + public abstract $abstractvectortype$ rotateLanesRight(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ shiftEL(int i); + public abstract $abstractvectortype$ shiftLanesLeft(int i); /** * {@inheritDoc} */ @Override - public abstract $abstractvectortype$ shiftER(int i); + public abstract $abstractvectortype$ shiftLanesRight(int i); #if[FP] /** @@ -1903,186 +1903,130 @@ */ public abstract $abstractvectortype$ not(VectorMask<$Boxtype$> m); -#if[byte] /** * Logically left shifts this vector by the broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Logically left shifts this vector by the broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Logically left shifts this vector by the broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. * * @param s the input scalar; the number of the bits to left shift - * @return the result of logically left shifting left this vector by the + * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftL(int s); + public abstract $abstractvectortype$ shiftLeft(int s); -#if[byte] /** * Logically left shifts this vector by the broadcast of an input scalar, * selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to left shift - * @param m the mask controlling lane selection - * @return the result of logically left shifting left this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Logically left shifts this vector by the broadcast of an input scalar, - * selecting lane elements controlled by a mask. - *

- * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane to left shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to left shift - * @param m the mask controlling lane selection - * @return the result of logically left shifting left this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Logically left shifts this vector by the broadcast of an input scalar, - * selecting lane elements controlled by a mask. - *

- * This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. * * @param s the input scalar; the number of the bits to left shift * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftL(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Logically left shifts this vector by an input vector. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of logically left shifting this vector by the input * vector */ - public abstract $abstractvectortype$ shiftL(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftLeft(Vector<$Boxtype$> v); /** * Logically left shifts this vector by an input vector, selecting lane * elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical left shift - * operation ({@code <<}) to each lane. + * operation ({@code <<}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically left shifting this vector by the input * vector */ - public $abstractvectortype$ shiftL(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a << b)); + public $abstractvectortype$ shiftLeft(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftLeft(v), m); } -#end[intOrLong] // logical, or unsigned, shift right -#if[byte] /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar. *

* This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @return the result of logically right shifting this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @return the result of logically right shifting this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. * * @param s the input scalar; the number of the bits to right shift * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftR(int s); + public abstract $abstractvectortype$ shiftRight(int s); -#if[byte] /** * Logically right shifts (or unsigned right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a @@ -2090,85 +2034,76 @@ *

* This is a lane-wise binary operation which applies the primitive logical right shift * operation ({@code >>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 3 - * lowest-order bits of shift value are used. It is as if the shift value + * element by shift value as specified by the input scalar. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @param m the mask controlling lane selection - * @return the result of logically right shifting this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - *

- * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane to logically right shift the - * element by shift value as specified by the input scalar. Only the 4 - * lowest-order bits of shift value are used. It is as if the shift value + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @param m the mask controlling lane selection - * @return the result of logically right shifting this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Logically right shifts (or unsigned right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - *

- * This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ shiftR(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftRight(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of logically right shifting this vector by the * input vector */ - public abstract $abstractvectortype$ shiftR(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftRight(Vector<$Boxtype$> v); /** * Logically right shifts (or unsigned right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive logical right shift - * operation ({@code >>>}) to each lane. + * operation ({@code >>>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift value + * were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @param m the mask controlling lane selection * @return the result of logically right shifting this vector by the * input vector */ - public $abstractvectortype$ shiftR(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a >>> b)); + public $abstractvectortype$ shiftRight(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftRight(v), m); } -#end[intOrLong] -#if[byte] /** * Arithmetically right shifts (or signed right shifts) this vector by the * broadcast of an input scalar. @@ -2176,48 +2111,23 @@ * This is a lane-wise binary operation which applies the primitive arithmetic right * shift operation ({@code >>}) to each lane to arithmetically * right shift the element by shift value as specified by the input scalar. +#if[byte] * Only the 3 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @return the result of arithmetically right shifting this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane to arithmetically - * right shift the element by shift value as specified by the input scalar. * Only the 4 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @return the result of arithmetically right shifting this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar. - *

- * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. * * @param s the input scalar; the number of the bits to right shift * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ aShiftR(int s); + public abstract $abstractvectortype$ shiftArithmeticRight(int s); -#if[byte] /** * Arithmetically right shifts (or signed right shifts) this vector by the * broadcast of an input scalar, selecting lane elements controlled by a @@ -2226,109 +2136,134 @@ * This is a lane-wise binary operation which applies the primitive arithmetic right * shift operation ({@code >>}) to each lane to arithmetically * right shift the element by shift value as specified by the input scalar. +#if[byte] * Only the 3 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. * The shift distance actually used is therefore always in the range 0 to 7, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @param m the mask controlling lane selection - * @return the result of arithmetically right shifting this vector by the - * broadcast of an input scalar - */ #end[byte] #if[short] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - *

- * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane to arithmetically - * right shift the element by shift value as specified by the input scalar. * Only the 4 lowest-order bits of shift value are used. It is as if the shift * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. * The shift distance actually used is therefore always in the range 0 to 15, inclusive. - * - * @param s the input scalar; the number of the bits to right shift - * @param m the mask controlling lane selection - * @return the result of arithmetically right shifting this vector by the - * broadcast of an input scalar - */ #end[short] -#if[intOrLong] - /** - * Arithmetically right shifts (or signed right shifts) this vector by the - * broadcast of an input scalar, selecting lane elements controlled by a - * mask. - *

- * This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. * * @param s the input scalar; the number of the bits to right shift * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * broadcast of an input scalar */ -#end[intOrLong] - public abstract $abstractvectortype$ aShiftR(int s, VectorMask<$Boxtype$> m); + public abstract $abstractvectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m); -#if[intOrLong] /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @return the result of arithmetically right shifting this vector by the * input vector */ - public abstract $abstractvectortype$ aShiftR(Vector<$Boxtype$> v); + public abstract $abstractvectortype$ shiftArithmeticRight(Vector<$Boxtype$> v); /** * Arithmetically right shifts (or signed right shifts) this vector by an * input vector, selecting lane elements controlled by a mask. *

* This is a lane-wise binary operation which applies the primitive arithmetic right - * shift operation ({@code >>}) to each lane. + * shift operation ({@code >>}) to each lane. For each lane of this vector, the + * shift value is the corresponding lane of input vector. +#if[byte] + * Only the 3 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0x7. + * The shift distance actually used is therefore always in the range 0 to 7, inclusive. +#end[byte] +#if[short] + * Only the 4 lowest-order bits of shift value are used. It is as if the shift + * value were subjected to a bitwise logical AND operator ({@code &}) with the mask value 0xF. + * The shift distance actually used is therefore always in the range 0 to 15, inclusive. +#end[short] * * @param v the input vector * @param m the mask controlling lane selection * @return the result of arithmetically right shifting this vector by the * input vector */ - public $abstractvectortype$ aShiftR(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { - return bOp(v, m, (i, a, b) -> ($type$) (a >> b)); + public $abstractvectortype$ shiftArithmeticRight(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return blend(shiftArithmeticRight(v), m); } /** * Rotates left this vector by the broadcast of an input scalar. *

+#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateLeft} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. +#end[short] * * @param s the input scalar; the number of the bits to rotate left * @return the result of rotating left this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateL(int s) { - return shiftL(s).or(shiftR(-s)); + public final $abstractvectortype$ rotateLeft(int s) { + return shiftLeft(s).or(shiftRight(-s)); } /** * Rotates left this vector by the broadcast of an input scalar, selecting * lane elements controlled by a mask. *

+#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateLeft} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating left the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. +#end[short] * * @param s the input scalar; the number of the bits to rotate left * @param m the mask controlling lane selection @@ -2336,37 +2271,69 @@ * input scalar */ @ForceInline - public final $abstractvectortype$ rotateL(int s, VectorMask<$Boxtype$> m) { - return shiftL(s, m).or(shiftR(-s, m), m); + public final $abstractvectortype$ rotateLeft(int s, VectorMask<$Boxtype$> m) { + return shiftLeft(s, m).or(shiftRight(-s, m), m); } /** * Rotates right this vector by the broadcast of an input scalar. *

+#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateRight} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. +#end[short] * * @param s the input scalar; the number of the bits to rotate right * @return the result of rotating right this vector by the broadcast of an * input scalar */ @ForceInline - public final $abstractvectortype$ rotateR(int s) { - return shiftR(s).or(shiftL(-s)); + public final $abstractvectortype$ rotateRight(int s) { + return shiftRight(s).or(shiftLeft(-s)); } /** * Rotates right this vector by the broadcast of an input scalar, selecting * lane elements controlled by a mask. *

+#if[intOrLong] * This is a lane-wise binary operation which applies the operation * {@link $Wideboxtype$#rotateRight} to each lane and where * lane elements of this vector apply to the first argument, and lane * elements of the broadcast vector apply to the second argument (the * rotation distance). +#end[intOrLong] +#if[byte] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 8 is a no-op, so only the 3 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0x7. +#end[byte] +#if[short] + * This is a lane-wise binary operation which produces the result of rotating right the two's + * complement binary representation of each lane of first operand (this vector) by input scalar. + * Rotation by any multiple of 16 is a no-op, so only the 4 lowest-order bits of input value are used. + * It is as if the input value were subjected to a bitwise logical + * AND operator ({@code &}) with the mask value 0xF. +#end[short] * * @param s the input scalar; the number of the bits to rotate right * @param m the mask controlling lane selection @@ -2374,10 +2341,9 @@ * input scalar */ @ForceInline - public final $abstractvectortype$ rotateR(int s, VectorMask<$Boxtype$> m) { - return shiftR(s, m).or(shiftL(-s, m), m); + public final $abstractvectortype$ rotateRight(int s, VectorMask<$Boxtype$> m) { + return shiftRight(s, m).or(shiftLeft(-s, m), m); } -#end[intOrLong] #end[BITWISE] /** @@ -2430,7 +2396,7 @@ * * @return the addition of all the lane elements of this vector */ - public abstract $type$ addAll(); + public abstract $type$ addLanes(); /** * Adds all lane elements of this vector, selecting lane elements @@ -2458,7 +2424,7 @@ * @param m the mask controlling lane selection * @return the addition of the selected lane elements of this vector */ - public abstract $type$ addAll(VectorMask<$Boxtype$> m); + public abstract $type$ addLanes(VectorMask<$Boxtype$> m); /** * Multiplies all lane elements of this vector. @@ -2483,7 +2449,7 @@ * * @return the multiplication of all the lane elements of this vector */ - public abstract $type$ mulAll(); + public abstract $type$ mulLanes(); /** * Multiplies all lane elements of this vector, selecting lane elements @@ -2510,7 +2476,7 @@ * @param m the mask controlling lane selection * @return the multiplication of all the lane elements of this vector */ - public abstract $type$ mulAll(VectorMask<$Boxtype$> m); + public abstract $type$ mulLanes(VectorMask<$Boxtype$> m); /** * Returns the minimum lane element of this vector. @@ -2526,7 +2492,7 @@ * * @return the minimum lane element of this vector */ - public abstract $type$ minAll(); + public abstract $type$ minLanes(); /** * Returns the minimum lane element of this vector, selecting lane elements @@ -2544,7 +2510,7 @@ * @param m the mask controlling lane selection * @return the minimum lane element of this vector */ - public abstract $type$ minAll(VectorMask<$Boxtype$> m); + public abstract $type$ minLanes(VectorMask<$Boxtype$> m); /** * Returns the maximum lane element of this vector. @@ -2560,7 +2526,7 @@ * * @return the maximum lane element of this vector */ - public abstract $type$ maxAll(); + public abstract $type$ maxLanes(); /** * Returns the maximum lane element of this vector, selecting lane elements @@ -2578,7 +2544,7 @@ * @param m the mask controlling lane selection * @return the maximum lane element of this vector */ - public abstract $type$ maxAll(VectorMask<$Boxtype$> m); + public abstract $type$ maxLanes(VectorMask<$Boxtype$> m); #if[BITWISE] /** @@ -2590,7 +2556,7 @@ * * @return the logical OR all the lane elements of this vector */ - public abstract $type$ orAll(); + public abstract $type$ orLanes(); /** * Logically ORs all lane elements of this vector, selecting lane elements @@ -2603,7 +2569,7 @@ * @param m the mask controlling lane selection * @return the logical OR all the lane elements of this vector */ - public abstract $type$ orAll(VectorMask<$Boxtype$> m); + public abstract $type$ orLanes(VectorMask<$Boxtype$> m); /** * Logically ANDs all lane elements of this vector. @@ -2614,7 +2580,7 @@ * * @return the logical AND all the lane elements of this vector */ - public abstract $type$ andAll(); + public abstract $type$ andLanes(); /** * Logically ANDs all lane elements of this vector, selecting lane elements @@ -2627,7 +2593,7 @@ * @param m the mask controlling lane selection * @return the logical AND all the lane elements of this vector */ - public abstract $type$ andAll(VectorMask<$Boxtype$> m); + public abstract $type$ andLanes(VectorMask<$Boxtype$> m); /** * Logically XORs all lane elements of this vector. @@ -2638,7 +2604,7 @@ * * @return the logical XOR all the lane elements of this vector */ - public abstract $type$ xorAll(); + public abstract $type$ xorLanes(); /** * Logically XORs all lane elements of this vector, selecting lane elements @@ -2651,7 +2617,7 @@ * @param m the mask controlling lane selection * @return the logical XOR all the lane elements of this vector */ - public abstract $type$ xorAll(VectorMask<$Boxtype$> m); + public abstract $type$ xorLanes(VectorMask<$Boxtype$> m); #end[BITWISE] // Type specific accessors @@ -2807,13 +2773,13 @@ final Function<$type$[], $Type$Vector> vectorFactory; private $Type$Species(VectorShape shape, - Class boxType, + Class vectorType, Class maskType, Function<$type$[], $Type$Vector> vectorFactory, Function> maskFactory, Function> shuffleFromArrayFactory, fShuffleFromArray<$Boxtype$> shuffleFromOpFactory) { - super(shape, $type$.class, $Boxtype$.SIZE, boxType, maskType, maskFactory, + super(shape, $type$.class, $Boxtype$.SIZE, vectorType, maskType, maskFactory, shuffleFromArrayFactory, shuffleFromOpFactory); this.vectorFactory = vectorFactory; } --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template 2019-04-26 14:52:13.928180200 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template 2019-04-26 14:52:13.280572600 -0700 @@ -171,7 +171,7 @@ return VectorIntrinsics.cast( $vectortype$.class, $type$.class, LENGTH, - s.boxType(), + s.vectorType(), s.elementType(), LENGTH, this, s, (species, vector) -> vector.castDefault(species) @@ -309,7 +309,7 @@ @ForceInline public $abstractvectortype$ reshape(VectorSpecies<$Boxtype$> s) { Objects.requireNonNull(s); - if (s.bitSize() == 64 && (s.boxType() == $Type$64Vector.class)) { + if (s.bitSize() == 64 && (s.vectorType() == $Type$64Vector.class)) { return VectorIntrinsics.reinterpret( $vectortype$.class, $type$.class, LENGTH, @@ -318,7 +318,7 @@ this, s, (species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 128 && (s.boxType() == $Type$128Vector.class)) { + } else if (s.bitSize() == 128 && (s.vectorType() == $Type$128Vector.class)) { return VectorIntrinsics.reinterpret( $vectortype$.class, $type$.class, LENGTH, @@ -327,7 +327,7 @@ this, s, (species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 256 && (s.boxType() == $Type$256Vector.class)) { + } else if (s.bitSize() == 256 && (s.vectorType() == $Type$256Vector.class)) { return VectorIntrinsics.reinterpret( $vectortype$.class, $type$.class, LENGTH, @@ -336,7 +336,7 @@ this, s, (species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species) ); - } else if (s.bitSize() == 512 && (s.boxType() == $Type$512Vector.class)) { + } else if (s.bitSize() == 512 && (s.vectorType() == $Type$512Vector.class)) { return VectorIntrinsics.reinterpret( $vectortype$.class, $type$.class, LENGTH, @@ -346,7 +346,7 @@ (species, vector) -> ($abstractvectortype$) vector.defaultReinterpret(species) ); } else if ((s.bitSize() > 0) && (s.bitSize() <= 2048) - && (s.bitSize() % 128 == 0) && (s.boxType() == $Type$MaxVector.class)) { + && (s.bitSize() % 128 == 0) && (s.vectorType() == $Type$MaxVector.class)) { return VectorIntrinsics.reinterpret( $vectortype$.class, $type$.class, LENGTH, @@ -946,99 +946,154 @@ #if[byte] @Override @ForceInline - public $vectortype$ shiftL(int s) { + public $vectortype$ shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 7)))); + (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 0x7)))); } @Override @ForceInline - public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) { - return blend(shiftL(s), m); + public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public $vectortype$ shiftR(int s) { + public $vectortype$ shiftLeft(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a << (b & 0x7))); + } + + @Override + @ForceInline + public $vectortype$ shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFF) >>> (i & 7)))); + (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFF) >>> (i & 0x7)))); } @Override @ForceInline - public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) { - return blend(shiftR(s), m); + public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public $vectortype$ aShiftR(int s) { + public $vectortype$ shiftRight(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a >>> (b & 0x7))); + } + + @Override + @ForceInline + public $vectortype$ shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 7)))); + (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 0x7)))); } @Override @ForceInline - public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) { - return blend(aShiftR(s), m); + public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftArithmeticRight(s), m); } + + @Override + @ForceInline + public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0x7)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a >> (b & 0x7))); + } + #end[byte] #if[short] @Override @ForceInline - public $vectortype$ shiftL(int s) { + public $vectortype$ shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 15)))); + (v, i) -> v.uOp((__, a) -> ($type$) (a << (i & 0xF)))); } @Override @ForceInline - public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) { - return blend(shiftL(s), m); + public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public $vectortype$ shiftR(int s) { + public $vectortype$ shiftLeft(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a << (b & 0xF))); + } + + @Override + @ForceInline + public $vectortype$ shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFFFF) >>> (i & 15)))); + (v, i) -> v.uOp((__, a) -> ($type$) ((a & 0xFFFF) >>> (i & 0xF)))); + } + + @Override + @ForceInline + public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) { - return blend(shiftR(s), m); + public $vectortype$ shiftRight(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a >>> (b & 0xF))); } @Override @ForceInline - public $vectortype$ aShiftR(int s) { + public $vectortype$ shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, - (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 15)))); + (v, i) -> v.uOp((__, a) -> ($type$) (a >> (i & 0xF)))); } @Override @ForceInline - public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) { - return blend(aShiftR(s), m); + public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftArithmeticRight(s), m); + } + + @Override + @ForceInline + public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) { + $vectortype$ shiftv = ($vectortype$)s; + // As per shift specification for Java, mask the shift count. + shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, ($type$) 0xF)); + return this.bOp(shiftv, (i, a, b) -> ($type$) (a >> (b & 0xF))); } #end[short] #if[intOrLong] @Override @ForceInline - public $vectortype$ shiftL(int s) { + public $vectortype$ shiftLeft(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_LSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, @@ -1047,13 +1102,13 @@ @Override @ForceInline - public $vectortype$ shiftL(int s, VectorMask<$Boxtype$> m) { - return blend(shiftL(s), m); + public $vectortype$ shiftLeft(int s, VectorMask<$Boxtype$> m) { + return blend(shiftLeft(s), m); } @Override @ForceInline - public $vectortype$ shiftR(int s) { + public $vectortype$ shiftRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_URSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, @@ -1062,13 +1117,13 @@ @Override @ForceInline - public $vectortype$ shiftR(int s, VectorMask<$Boxtype$> m) { - return blend(shiftR(s), m); + public $vectortype$ shiftRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftRight(s), m); } @Override @ForceInline - public $vectortype$ aShiftR(int s) { + public $vectortype$ shiftArithmeticRight(int s) { return VectorIntrinsics.broadcastInt( VECTOR_OP_RSHIFT, $vectortype$.class, $type$.class, LENGTH, this, s, @@ -1077,13 +1132,13 @@ @Override @ForceInline - public $vectortype$ aShiftR(int s, VectorMask<$Boxtype$> m) { - return blend(aShiftR(s), m); + public $vectortype$ shiftArithmeticRight(int s, VectorMask<$Boxtype$> m) { + return blend(shiftArithmeticRight(s), m); } @Override @ForceInline - public $vectortype$ shiftL(Vector<$Boxtype$> s) { + public $vectortype$ shiftLeft(Vector<$Boxtype$> s) { $vectortype$ shiftv = ($vectortype$)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f})); @@ -1095,7 +1150,7 @@ @Override @ForceInline - public $vectortype$ shiftR(Vector<$Boxtype$> s) { + public $vectortype$ shiftRight(Vector<$Boxtype$> s) { $vectortype$ shiftv = ($vectortype$)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f})); @@ -1107,7 +1162,7 @@ @Override @ForceInline - public $vectortype$ aShiftR(Vector<$Boxtype$> s) { + public $vectortype$ shiftArithmeticRight(Vector<$Boxtype$> s) { $vectortype$ shiftv = ($vectortype$)s; // As per shift specification for Java, mask the shift count. shiftv = shiftv.and($abstractvectortype$.broadcast(SPECIES, {#if[int]?0x1f:0x3f})); @@ -1139,7 +1194,7 @@ @Override @ForceInline - public $type$ addAll() { + public $type$ addLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH, this, @@ -1148,7 +1203,7 @@ @Override @ForceInline - public $type$ andAll() { + public $type$ andLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_AND, $vectortype$.class, $type$.class, LENGTH, this, @@ -1157,13 +1212,13 @@ @Override @ForceInline - public $type$ andAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, ($type$) -1).blend(this, m).andAll(); + public $type$ andLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, ($type$) -1).blend(this, m).andLanes(); } @Override @ForceInline - public $type$ minAll() { + public $type$ minLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, $vectortype$.class, $type$.class, LENGTH, this, @@ -1172,7 +1227,7 @@ @Override @ForceInline - public $type$ maxAll() { + public $type$ maxLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, $vectortype$.class, $type$.class, LENGTH, this, @@ -1181,7 +1236,7 @@ @Override @ForceInline - public $type$ mulAll() { + public $type$ mulLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, $vectortype$.class, $type$.class, LENGTH, this, @@ -1190,7 +1245,7 @@ @Override @ForceInline - public $type$ orAll() { + public $type$ orLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_OR, $vectortype$.class, $type$.class, LENGTH, this, @@ -1199,13 +1254,13 @@ @Override @ForceInline - public $type$ orAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).orAll(); + public $type$ orLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).orLanes(); } @Override @ForceInline - public $type$ xorAll() { + public $type$ xorLanes() { return ($type$) VectorIntrinsics.reductionCoerced( VECTOR_OP_XOR, $vectortype$.class, $type$.class, LENGTH, this, @@ -1214,15 +1269,15 @@ @Override @ForceInline - public $type$ xorAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).xorAll(); + public $type$ xorLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).xorLanes(); } #end[BITWISE] #if[FP] @Override @ForceInline - public $type$ addAll() { + public $type$ addLanes() { $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced( VECTOR_OP_ADD, $vectortype$.class, $type$.class, LENGTH, this, @@ -1235,7 +1290,7 @@ @Override @ForceInline - public $type$ mulAll() { + public $type$ mulLanes() { $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MUL, $vectortype$.class, $type$.class, LENGTH, this, @@ -1248,7 +1303,7 @@ @Override @ForceInline - public $type$ minAll() { + public $type$ minLanes() { $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MIN, $vectortype$.class, $type$.class, LENGTH, this, @@ -1261,7 +1316,7 @@ @Override @ForceInline - public $type$ maxAll() { + public $type$ maxLanes() { $bitstype$ bits = ($bitstype$) VectorIntrinsics.reductionCoerced( VECTOR_OP_MAX, $vectortype$.class, $type$.class, LENGTH, this, @@ -1276,27 +1331,27 @@ @Override @ForceInline - public $type$ addAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).addAll(); + public $type$ addLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, ($type$) 0).blend(this, m).addLanes(); } @Override @ForceInline - public $type$ mulAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, ($type$) 1).blend(this, m).mulAll(); + public $type$ mulLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, ($type$) 1).blend(this, m).mulLanes(); } @Override @ForceInline - public $type$ minAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, $Boxtype$.MAX_VALUE).blend(this, m).minAll(); + public $type$ minLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, $Boxtype$.MAX_VALUE).blend(this, m).minLanes(); } @Override @ForceInline - public $type$ maxAll(VectorMask<$Boxtype$> m) { - return $abstractvectortype$.broadcast(SPECIES, $Boxtype$.MIN_VALUE).blend(this, m).maxAll(); + public $type$ maxLanes(VectorMask<$Boxtype$> m) { + return $abstractvectortype$.broadcast(SPECIES, $Boxtype$.MIN_VALUE).blend(this, m).maxLanes(); } @Override @@ -1569,7 +1624,7 @@ #end[intOrLong] @Override - public $vectortype$ rotateEL(int j) { + public $vectortype$ rotateLanesLeft(int j) { $type$[] vec = getElements(); $type$[] res = new $type$[length()]; for (int i = 0; i < length(); i++){ @@ -1579,7 +1634,7 @@ } @Override - public $vectortype$ rotateER(int j) { + public $vectortype$ rotateLanesRight(int j) { $type$[] vec = getElements(); $type$[] res = new $type$[length()]; for (int i = 0; i < length(); i++){ @@ -1594,7 +1649,7 @@ } @Override - public $vectortype$ shiftEL(int j) { + public $vectortype$ shiftLanesLeft(int j) { $type$[] vec = getElements(); $type$[] res = new $type$[length()]; for (int i = 0; i < length() - j; i++) { @@ -1604,7 +1659,7 @@ } @Override - public $vectortype$ shiftER(int j) { + public $vectortype$ shiftLanesRight(int j) { $type$[] vec = getElements(); $type$[] res = new $type$[length()]; for (int i = 0; i < length() - j; i++){ --- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/package-info.java 2019-04-26 14:52:18.641601200 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/package-info.java 2019-04-26 14:52:18.027109400 -0700 @@ -104,7 +104,9 @@ * } * * The scalar computation after the vector computation is required to process the tail of - * elements, the length of which is smaller than the species length. + * elements, the length of which is smaller than the species length. {@code VectorSpecies} also defines a + * {@link jdk.incubator.vector.VectorSpecies#loopBound(int) loopBound()} helper method which can be used in place of + * {@code (a.length & ~(SPECIES.length() - 1))} in the above code to determine the terminating condition. * * The example above uses vectors hardcoded to a concrete shape (512-bit). Instead, we could use preferred * species as shown below, to make the code dynamically adapt to optimal shape for the platform on which it runs. @@ -134,7 +136,7 @@ * EVector a = ...; * e[] ar = new e[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_unary_op(a.get(i)); + * ar[i] = scalar_unary_op(a.lane(i)); * } * EVector r = EVector.fromArray(a.species(), ar, 0); * } @@ -156,7 +158,7 @@ * EVector b = ...; * e[] ar = new e[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_binary_op(a.get(i), b.get(i)); + * ar[i] = scalar_binary_op(a.lane(i), b.lane(i)); * } * EVector r = EVector.fromArray(a.species(), ar, 0); * } @@ -189,7 +191,7 @@ * EVector a = ...; * e r = ; * for (int i = 0; i < a.length(); i++) { - * r = assoc_scalar_binary_op(r, a.get(i)); + * r = assoc_scalar_binary_op(r, a.lane(i)); * } * } * @@ -208,7 +210,7 @@ * EVector b = ...; * boolean[] ar = new boolean[a.length()]; * for (int i = 0; i < a.length(); i++) { - * ar[i] = scalar_binary_test_op(a.get(i), b.get(i)); + * ar[i] = scalar_binary_test_op(a.lane(i), b.lane(i)); * } * VectorMask r = VectorMask.fromArray(a.species(), ar, 0); * } --- old/test/jdk/jdk/incubator/vector/Byte128VectorTests.java 2019-04-26 14:52:23.287077200 -0700 +++ new/test/jdk/jdk/incubator/vector/Byte128VectorTests.java 2019-04-26 14:52:22.689606500 -0700 @@ -660,22 +660,108 @@ + static byte shiftLeft(byte a, byte b) { + return (byte)((a << (b & 0x7))); + } + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftLeftByte128VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Byte128VectorTests::shiftLeft); + } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftLeftByte128VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Byte128VectorTests::shiftLeft); + } - static byte aShiftR_unary(byte a, byte b) { - return (byte)((a >> (b & 7))); + + + + static byte shiftRight(byte a, byte b) { + return (byte)((a >>> (b & 0x7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftRightByte128VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Byte128VectorTests::shiftRight); + } + + + + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftRightByte128VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Byte128VectorTests::shiftRight); + } + + + + + + + static byte shiftArithmeticRight(byte a, byte b) { + return (byte)((a >> (b & 0x7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void aShiftRByte128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightByte128VectorTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -683,17 +769,18 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte128VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Byte128VectorTests::shiftArithmeticRight); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void aShiftRByte128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightByte128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -704,20 +791,25 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Byte128VectorTests::shiftArithmeticRight); } - static byte shiftL_unary(byte a, byte b) { + + + + + static byte shiftLeft_unary(byte a, byte b) { return (byte)((a << (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftLByte128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftByte128VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -725,17 +817,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Byte128VectorTests::shiftLeft_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftLByte128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftByte128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -746,20 +838,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::shiftLeft_unary); } - static byte shiftR_unary(byte a, byte b) { + + + + + static byte shiftRight_unary(byte a, byte b) { return (byte)(((a & 0xFF) >>> (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftRByte128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightByte128VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -767,17 +863,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte128VectorTests::shiftRight_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftRByte128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightByte128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -788,16 +884,58 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::shiftRight_unary); + } + + + + + + + static byte shiftArithmeticRight_unary(byte a, byte b) { + return (byte)((a >> (b & 7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftArithmeticRightByte128VectorTestsShift(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte128VectorTests::shiftArithmeticRight_unary); } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftArithmeticRightByte128VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte128VectorTests::shiftArithmeticRight_unary); + } @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Byte128VectorTests::min); } - static byte andAll(byte[] a, int idx) { + static byte andLanes(byte[] a, int idx) { byte res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static byte andAll(byte[] a) { + static byte andLanes(byte[] a) { byte res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void andAllByte128VectorTests(IntFunction fa) { + static void andLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = -1; @@ -874,7 +1012,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::andAll, Byte128VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::andLanes, Byte128VectorTests::andLanes); } - static byte orAll(byte[] a, int idx) { + static byte orLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static byte orAll(byte[] a) { + static byte orLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void orAllByte128VectorTests(IntFunction fa) { + static void orLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -922,7 +1060,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::orAll, Byte128VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::orLanes, Byte128VectorTests::orLanes); } - static byte xorAll(byte[] a, int idx) { + static byte xorLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static byte xorAll(byte[] a) { + static byte xorLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void xorAllByte128VectorTests(IntFunction fa) { + static void xorLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -970,7 +1108,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::xorAll, Byte128VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::xorLanes, Byte128VectorTests::xorLanes); } - static byte addAll(byte[] a, int idx) { + static byte addLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static byte addAll(byte[] a) { + static byte addLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void addAllByte128VectorTests(IntFunction fa) { + static void addLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -1015,7 +1153,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::addAll, Byte128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::addLanes, Byte128VectorTests::addLanes); } - static byte mulAll(byte[] a, int idx) { + static byte mulLanes(byte[] a, int idx) { byte res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static byte mulAll(byte[] a) { + static byte mulLanes(byte[] a) { byte res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void mulAllByte128VectorTests(IntFunction fa) { + static void mulLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 1; @@ -1059,7 +1197,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::mulAll, Byte128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::mulLanes, Byte128VectorTests::mulLanes); } - static byte minAll(byte[] a, int idx) { + static byte minLanes(byte[] a, int idx) { byte res = Byte.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.min(res, a[i]); @@ -1082,7 +1220,7 @@ return res; } - static byte minAll(byte[] a) { + static byte minLanes(byte[] a) { byte res = Byte.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void minAllByte128VectorTests(IntFunction fa) { + static void minLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -1099,7 +1237,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::minAll, Byte128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::minLanes, Byte128VectorTests::minLanes); } - static byte maxAll(byte[] a, int idx) { + static byte maxLanes(byte[] a, int idx) { byte res = Byte.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.max(res, a[i]); @@ -1122,7 +1260,7 @@ return res; } - static byte maxAll(byte[] a) { + static byte maxLanes(byte[] a) { byte res = Byte.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void maxAllByte128VectorTests(IntFunction fa) { + static void maxLanesByte128VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -1139,7 +1277,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte128VectorTests::maxAll, Byte128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Byte128VectorTests::maxLanes, Byte128VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Byte256VectorTests.java 2019-04-26 14:52:27.883734000 -0700 +++ new/test/jdk/jdk/incubator/vector/Byte256VectorTests.java 2019-04-26 14:52:27.302599200 -0700 @@ -660,22 +660,108 @@ + static byte shiftLeft(byte a, byte b) { + return (byte)((a << (b & 0x7))); + } + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftLeftByte256VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Byte256VectorTests::shiftLeft); + } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftLeftByte256VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Byte256VectorTests::shiftLeft); + } - static byte aShiftR_unary(byte a, byte b) { - return (byte)((a >> (b & 7))); + + + + static byte shiftRight(byte a, byte b) { + return (byte)((a >>> (b & 0x7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftRightByte256VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Byte256VectorTests::shiftRight); + } + + + + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftRightByte256VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Byte256VectorTests::shiftRight); + } + + + + + + + static byte shiftArithmeticRight(byte a, byte b) { + return (byte)((a >> (b & 0x7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void aShiftRByte256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightByte256VectorTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -683,17 +769,18 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte256VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Byte256VectorTests::shiftArithmeticRight); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void aShiftRByte256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightByte256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -704,20 +791,25 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Byte256VectorTests::shiftArithmeticRight); } - static byte shiftL_unary(byte a, byte b) { + + + + + static byte shiftLeft_unary(byte a, byte b) { return (byte)((a << (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftLByte256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftByte256VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -725,17 +817,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Byte256VectorTests::shiftLeft_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftLByte256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftByte256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -746,20 +838,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::shiftLeft_unary); } - static byte shiftR_unary(byte a, byte b) { + + + + + static byte shiftRight_unary(byte a, byte b) { return (byte)(((a & 0xFF) >>> (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftRByte256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightByte256VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -767,17 +863,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte256VectorTests::shiftRight_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftRByte256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightByte256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -788,16 +884,58 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::shiftRight_unary); + } + + + + + + + static byte shiftArithmeticRight_unary(byte a, byte b) { + return (byte)((a >> (b & 7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftArithmeticRightByte256VectorTestsShift(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte256VectorTests::shiftArithmeticRight_unary); } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftArithmeticRightByte256VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte256VectorTests::shiftArithmeticRight_unary); + } @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Byte256VectorTests::min); } - static byte andAll(byte[] a, int idx) { + static byte andLanes(byte[] a, int idx) { byte res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static byte andAll(byte[] a) { + static byte andLanes(byte[] a) { byte res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void andAllByte256VectorTests(IntFunction fa) { + static void andLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = -1; @@ -874,7 +1012,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::andAll, Byte256VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::andLanes, Byte256VectorTests::andLanes); } - static byte orAll(byte[] a, int idx) { + static byte orLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static byte orAll(byte[] a) { + static byte orLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void orAllByte256VectorTests(IntFunction fa) { + static void orLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -922,7 +1060,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::orAll, Byte256VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::orLanes, Byte256VectorTests::orLanes); } - static byte xorAll(byte[] a, int idx) { + static byte xorLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static byte xorAll(byte[] a) { + static byte xorLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void xorAllByte256VectorTests(IntFunction fa) { + static void xorLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -970,7 +1108,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::xorAll, Byte256VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::xorLanes, Byte256VectorTests::xorLanes); } - static byte addAll(byte[] a, int idx) { + static byte addLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static byte addAll(byte[] a) { + static byte addLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void addAllByte256VectorTests(IntFunction fa) { + static void addLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -1015,7 +1153,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::addAll, Byte256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::addLanes, Byte256VectorTests::addLanes); } - static byte mulAll(byte[] a, int idx) { + static byte mulLanes(byte[] a, int idx) { byte res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static byte mulAll(byte[] a) { + static byte mulLanes(byte[] a) { byte res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void mulAllByte256VectorTests(IntFunction fa) { + static void mulLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 1; @@ -1059,7 +1197,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::mulAll, Byte256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::mulLanes, Byte256VectorTests::mulLanes); } - static byte minAll(byte[] a, int idx) { + static byte minLanes(byte[] a, int idx) { byte res = Byte.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.min(res, a[i]); @@ -1082,7 +1220,7 @@ return res; } - static byte minAll(byte[] a) { + static byte minLanes(byte[] a) { byte res = Byte.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void minAllByte256VectorTests(IntFunction fa) { + static void minLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -1099,7 +1237,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::minAll, Byte256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::minLanes, Byte256VectorTests::minLanes); } - static byte maxAll(byte[] a, int idx) { + static byte maxLanes(byte[] a, int idx) { byte res = Byte.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.max(res, a[i]); @@ -1122,7 +1260,7 @@ return res; } - static byte maxAll(byte[] a) { + static byte maxLanes(byte[] a) { byte res = Byte.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void maxAllByte256VectorTests(IntFunction fa) { + static void maxLanesByte256VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -1139,7 +1277,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte256VectorTests::maxAll, Byte256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Byte256VectorTests::maxLanes, Byte256VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Byte512VectorTests.java 2019-04-26 14:52:32.517212800 -0700 +++ new/test/jdk/jdk/incubator/vector/Byte512VectorTests.java 2019-04-26 14:52:31.931646700 -0700 @@ -660,22 +660,108 @@ + static byte shiftLeft(byte a, byte b) { + return (byte)((a << (b & 0x7))); + } + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftLeftByte512VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Byte512VectorTests::shiftLeft); + } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftLeftByte512VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Byte512VectorTests::shiftLeft); + } - static byte aShiftR_unary(byte a, byte b) { - return (byte)((a >> (b & 7))); + + + + static byte shiftRight(byte a, byte b) { + return (byte)((a >>> (b & 0x7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftRightByte512VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Byte512VectorTests::shiftRight); + } + + + + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftRightByte512VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Byte512VectorTests::shiftRight); + } + + + + + + + static byte shiftArithmeticRight(byte a, byte b) { + return (byte)((a >> (b & 0x7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void aShiftRByte512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightByte512VectorTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -683,17 +769,18 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte512VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Byte512VectorTests::shiftArithmeticRight); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void aShiftRByte512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightByte512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -704,20 +791,25 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Byte512VectorTests::shiftArithmeticRight); } - static byte shiftL_unary(byte a, byte b) { + + + + + static byte shiftLeft_unary(byte a, byte b) { return (byte)((a << (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftLByte512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftByte512VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -725,17 +817,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Byte512VectorTests::shiftLeft_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftLByte512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftByte512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -746,20 +838,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::shiftLeft_unary); } - static byte shiftR_unary(byte a, byte b) { + + + + + static byte shiftRight_unary(byte a, byte b) { return (byte)(((a & 0xFF) >>> (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftRByte512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightByte512VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -767,17 +863,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte512VectorTests::shiftRight_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftRByte512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightByte512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -788,16 +884,58 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::shiftRight_unary); + } + + + + + + + static byte shiftArithmeticRight_unary(byte a, byte b) { + return (byte)((a >> (b & 7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftArithmeticRightByte512VectorTestsShift(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte512VectorTests::shiftArithmeticRight_unary); } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftArithmeticRightByte512VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte512VectorTests::shiftArithmeticRight_unary); + } @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Byte512VectorTests::min); } - static byte andAll(byte[] a, int idx) { + static byte andLanes(byte[] a, int idx) { byte res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static byte andAll(byte[] a) { + static byte andLanes(byte[] a) { byte res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void andAllByte512VectorTests(IntFunction fa) { + static void andLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = -1; @@ -874,7 +1012,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::andAll, Byte512VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::andLanes, Byte512VectorTests::andLanes); } - static byte orAll(byte[] a, int idx) { + static byte orLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static byte orAll(byte[] a) { + static byte orLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void orAllByte512VectorTests(IntFunction fa) { + static void orLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -922,7 +1060,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::orAll, Byte512VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::orLanes, Byte512VectorTests::orLanes); } - static byte xorAll(byte[] a, int idx) { + static byte xorLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static byte xorAll(byte[] a) { + static byte xorLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void xorAllByte512VectorTests(IntFunction fa) { + static void xorLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -970,7 +1108,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::xorAll, Byte512VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::xorLanes, Byte512VectorTests::xorLanes); } - static byte addAll(byte[] a, int idx) { + static byte addLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static byte addAll(byte[] a) { + static byte addLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void addAllByte512VectorTests(IntFunction fa) { + static void addLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -1015,7 +1153,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::addAll, Byte512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::addLanes, Byte512VectorTests::addLanes); } - static byte mulAll(byte[] a, int idx) { + static byte mulLanes(byte[] a, int idx) { byte res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static byte mulAll(byte[] a) { + static byte mulLanes(byte[] a) { byte res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void mulAllByte512VectorTests(IntFunction fa) { + static void mulLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 1; @@ -1059,7 +1197,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::mulAll, Byte512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::mulLanes, Byte512VectorTests::mulLanes); } - static byte minAll(byte[] a, int idx) { + static byte minLanes(byte[] a, int idx) { byte res = Byte.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.min(res, a[i]); @@ -1082,7 +1220,7 @@ return res; } - static byte minAll(byte[] a) { + static byte minLanes(byte[] a) { byte res = Byte.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void minAllByte512VectorTests(IntFunction fa) { + static void minLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -1099,7 +1237,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::minAll, Byte512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::minLanes, Byte512VectorTests::minLanes); } - static byte maxAll(byte[] a, int idx) { + static byte maxLanes(byte[] a, int idx) { byte res = Byte.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.max(res, a[i]); @@ -1122,7 +1260,7 @@ return res; } - static byte maxAll(byte[] a) { + static byte maxLanes(byte[] a) { byte res = Byte.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void maxAllByte512VectorTests(IntFunction fa) { + static void maxLanesByte512VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -1139,7 +1277,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte512VectorTests::maxAll, Byte512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Byte512VectorTests::maxLanes, Byte512VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Byte64VectorTests.java 2019-04-26 14:52:37.235659200 -0700 +++ new/test/jdk/jdk/incubator/vector/Byte64VectorTests.java 2019-04-26 14:52:36.642828000 -0700 @@ -660,22 +660,108 @@ + static byte shiftLeft(byte a, byte b) { + return (byte)((a << (b & 0x7))); + } + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftLeftByte64VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Byte64VectorTests::shiftLeft); + } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftLeftByte64VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Byte64VectorTests::shiftLeft); + } - static byte aShiftR_unary(byte a, byte b) { - return (byte)((a >> (b & 7))); + + + + static byte shiftRight(byte a, byte b) { + return (byte)((a >>> (b & 0x7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftRightByte64VectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Byte64VectorTests::shiftRight); + } + + + + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftRightByte64VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Byte64VectorTests::shiftRight); + } + + + + + + + static byte shiftArithmeticRight(byte a, byte b) { + return (byte)((a >> (b & 0x7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void aShiftRByte64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightByte64VectorTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -683,17 +769,18 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte64VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Byte64VectorTests::shiftArithmeticRight); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void aShiftRByte64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightByte64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -704,20 +791,25 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Byte64VectorTests::shiftArithmeticRight); } - static byte shiftL_unary(byte a, byte b) { + + + + + static byte shiftLeft_unary(byte a, byte b) { return (byte)((a << (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftLByte64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftByte64VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -725,17 +817,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Byte64VectorTests::shiftLeft_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftLByte64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftByte64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -746,20 +838,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::shiftLeft_unary); } - static byte shiftR_unary(byte a, byte b) { + + + + + static byte shiftRight_unary(byte a, byte b) { return (byte)(((a & 0xFF) >>> (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftRByte64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightByte64VectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -767,17 +863,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Byte64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte64VectorTests::shiftRight_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftRByte64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightByte64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -788,16 +884,58 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::shiftRight_unary); + } + + + + + + + static byte shiftArithmeticRight_unary(byte a, byte b) { + return (byte)((a >> (b & 7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftArithmeticRightByte64VectorTestsShift(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Byte64VectorTests::shiftArithmeticRight_unary); } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftArithmeticRightByte64VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Byte64VectorTests::shiftArithmeticRight_unary); + } @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Byte64VectorTests::min); } - static byte andAll(byte[] a, int idx) { + static byte andLanes(byte[] a, int idx) { byte res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static byte andAll(byte[] a) { + static byte andLanes(byte[] a) { byte res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void andAllByte64VectorTests(IntFunction fa) { + static void andLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = -1; @@ -874,7 +1012,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::andAll, Byte64VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::andLanes, Byte64VectorTests::andLanes); } - static byte orAll(byte[] a, int idx) { + static byte orLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static byte orAll(byte[] a) { + static byte orLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void orAllByte64VectorTests(IntFunction fa) { + static void orLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -922,7 +1060,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::orAll, Byte64VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::orLanes, Byte64VectorTests::orLanes); } - static byte xorAll(byte[] a, int idx) { + static byte xorLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static byte xorAll(byte[] a) { + static byte xorLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void xorAllByte64VectorTests(IntFunction fa) { + static void xorLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -970,7 +1108,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::xorAll, Byte64VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::xorLanes, Byte64VectorTests::xorLanes); } - static byte addAll(byte[] a, int idx) { + static byte addLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static byte addAll(byte[] a) { + static byte addLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void addAllByte64VectorTests(IntFunction fa) { + static void addLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -1015,7 +1153,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::addAll, Byte64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::addLanes, Byte64VectorTests::addLanes); } - static byte mulAll(byte[] a, int idx) { + static byte mulLanes(byte[] a, int idx) { byte res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static byte mulAll(byte[] a) { + static byte mulLanes(byte[] a) { byte res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void mulAllByte64VectorTests(IntFunction fa) { + static void mulLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 1; @@ -1059,7 +1197,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::mulAll, Byte64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::mulLanes, Byte64VectorTests::mulLanes); } - static byte minAll(byte[] a, int idx) { + static byte minLanes(byte[] a, int idx) { byte res = Byte.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.min(res, a[i]); @@ -1082,7 +1220,7 @@ return res; } - static byte minAll(byte[] a) { + static byte minLanes(byte[] a) { byte res = Byte.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void minAllByte64VectorTests(IntFunction fa) { + static void minLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -1099,7 +1237,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::minAll, Byte64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::minLanes, Byte64VectorTests::minLanes); } - static byte maxAll(byte[] a, int idx) { + static byte maxLanes(byte[] a, int idx) { byte res = Byte.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.max(res, a[i]); @@ -1122,7 +1260,7 @@ return res; } - static byte maxAll(byte[] a) { + static byte maxLanes(byte[] a) { byte res = Byte.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void maxAllByte64VectorTests(IntFunction fa) { + static void maxLanesByte64VectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -1139,7 +1277,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Byte64VectorTests::maxAll, Byte64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Byte64VectorTests::maxLanes, Byte64VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java 2019-04-26 14:52:41.831529100 -0700 +++ new/test/jdk/jdk/incubator/vector/ByteMaxVectorTests.java 2019-04-26 14:52:41.246670600 -0700 @@ -664,22 +664,108 @@ + static byte shiftLeft(byte a, byte b) { + return (byte)((a << (b & 0x7))); + } + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftLeftByteMaxVectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, ByteMaxVectorTests::shiftLeft); + } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftLeftByteMaxVectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftLeft); + } - static byte aShiftR_unary(byte a, byte b) { - return (byte)((a >> (b & 7))); + + + + static byte shiftRight(byte a, byte b) { + return (byte)((a >>> (b & 0x7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftRightByteMaxVectorTests(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, ByteMaxVectorTests::shiftRight); + } + + + + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftRightByteMaxVectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftRight); + } + + + + + + + static byte shiftArithmeticRight(byte a, byte b) { + return (byte)((a >> (b & 0x7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void aShiftRByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightByteMaxVectorTests(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -687,17 +773,18 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, ByteMaxVectorTests::shiftArithmeticRight); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void aShiftRByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightByteMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -708,20 +795,25 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftArithmeticRight); } - static byte shiftL_unary(byte a, byte b) { + + + + + static byte shiftLeft_unary(byte a, byte b) { return (byte)((a << (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftLByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -729,17 +821,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::shiftLeft_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftLByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -750,20 +842,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftLeft_unary); } - static byte shiftR_unary(byte a, byte b) { + + + + + static byte shiftRight_unary(byte a, byte b) { return (byte)(((a & 0xFF) >>> (b & 7))); } @Test(dataProvider = "byteBinaryOpProvider") - static void shiftRByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -771,17 +867,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::shiftRight_unary); } @Test(dataProvider = "byteBinaryOpMaskProvider") - static void shiftRByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); @@ -792,16 +888,58 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftRight_unary); + } + + + + + + + static byte shiftArithmeticRight_unary(byte a, byte b) { + return (byte)((a >> (b & 7))); + } + + @Test(dataProvider = "byteBinaryOpProvider") + static void shiftArithmeticRightByteMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, ByteMaxVectorTests::shiftArithmeticRight_unary); } + @Test(dataProvider = "byteBinaryOpMaskProvider") + static void shiftArithmeticRightByteMaxVectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, ByteMaxVectorTests::shiftArithmeticRight_unary); + } @@ -846,7 +984,7 @@ assertArraysEquals(a, b, r, ByteMaxVectorTests::min); } - static byte andAll(byte[] a, int idx) { + static byte andLanes(byte[] a, int idx) { byte res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -855,7 +993,7 @@ return res; } - static byte andAll(byte[] a) { + static byte andLanes(byte[] a) { byte res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = -1; @@ -870,7 +1008,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void andAllByteMaxVectorTests(IntFunction fa) { + static void andLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = -1; @@ -878,7 +1016,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -886,15 +1024,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::andAll, ByteMaxVectorTests::andAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::andLanes, ByteMaxVectorTests::andLanes); } - static byte orAll(byte[] a, int idx) { + static byte orLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -903,7 +1041,7 @@ return res; } - static byte orAll(byte[] a) { + static byte orLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -918,7 +1056,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void orAllByteMaxVectorTests(IntFunction fa) { + static void orLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -926,7 +1064,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -934,15 +1072,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::orAll, ByteMaxVectorTests::orAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::orLanes, ByteMaxVectorTests::orLanes); } - static byte xorAll(byte[] a, int idx) { + static byte xorLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -951,7 +1089,7 @@ return res; } - static byte xorAll(byte[] a) { + static byte xorLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -966,7 +1104,7 @@ @Test(dataProvider = "byteUnaryOpProvider") - static void xorAllByteMaxVectorTests(IntFunction fa) { + static void xorLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -974,7 +1112,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -982,14 +1120,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::xorAll, ByteMaxVectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::xorLanes, ByteMaxVectorTests::xorLanes); } - static byte addAll(byte[] a, int idx) { + static byte addLanes(byte[] a, int idx) { byte res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -998,7 +1136,7 @@ return res; } - static byte addAll(byte[] a) { + static byte addLanes(byte[] a) { byte res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 0; @@ -1011,7 +1149,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void addAllByteMaxVectorTests(IntFunction fa) { + static void addLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 0; @@ -1019,7 +1157,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1027,13 +1165,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::addAll, ByteMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::addLanes, ByteMaxVectorTests::addLanes); } - static byte mulAll(byte[] a, int idx) { + static byte mulLanes(byte[] a, int idx) { byte res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1042,7 +1180,7 @@ return res; } - static byte mulAll(byte[] a) { + static byte mulLanes(byte[] a) { byte res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { byte tmp = 1; @@ -1055,7 +1193,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void mulAllByteMaxVectorTests(IntFunction fa) { + static void mulLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = 1; @@ -1063,7 +1201,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1071,13 +1209,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::mulAll, ByteMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::mulLanes, ByteMaxVectorTests::mulLanes); } - static byte minAll(byte[] a, int idx) { + static byte minLanes(byte[] a, int idx) { byte res = Byte.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.min(res, a[i]); @@ -1086,7 +1224,7 @@ return res; } - static byte minAll(byte[] a) { + static byte minLanes(byte[] a) { byte res = Byte.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.min(res, a[i]); @@ -1095,7 +1233,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void minAllByteMaxVectorTests(IntFunction fa) { + static void minLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -1103,7 +1241,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1111,13 +1249,13 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::minAll, ByteMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::minLanes, ByteMaxVectorTests::minLanes); } - static byte maxAll(byte[] a, int idx) { + static byte maxLanes(byte[] a, int idx) { byte res = Byte.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (byte)Math.max(res, a[i]); @@ -1126,7 +1264,7 @@ return res; } - static byte maxAll(byte[] a) { + static byte maxLanes(byte[] a) { byte res = Byte.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (byte)Math.max(res, a[i]); @@ -1135,7 +1273,7 @@ return res; } @Test(dataProvider = "byteUnaryOpProvider") - static void maxAllByteMaxVectorTests(IntFunction fa) { + static void maxLanesByteMaxVectorTests(IntFunction fa) { byte[] a = fa.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -1143,7 +1281,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1151,11 +1289,11 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::maxAll, ByteMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, ByteMaxVectorTests::maxLanes, ByteMaxVectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Double128VectorTests.java 2019-04-26 14:52:46.380454100 -0700 +++ new/test/jdk/jdk/incubator/vector/Double128VectorTests.java 2019-04-26 14:52:45.793767200 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static double max(double a, double b) { return (double)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static double addAll(double[] a, int idx) { + static double addLanes(double[] a, int idx) { double res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static double addAll(double[] a) { + static double addLanes(double[] a) { double res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void addAllDouble128VectorTests(IntFunction fa) { + static void addLanesDouble128VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Double128VectorTests::addAll, Double128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Double128VectorTests::addLanes, Double128VectorTests::addLanes); } - static double mulAll(double[] a, int idx) { + static double mulLanes(double[] a, int idx) { double res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static double mulAll(double[] a) { + static double mulLanes(double[] a) { double res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void mulAllDouble128VectorTests(IntFunction fa) { + static void mulLanesDouble128VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Double128VectorTests::mulAll, Double128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Double128VectorTests::mulLanes, Double128VectorTests::mulLanes); } - static double minAll(double[] a, int idx) { + static double minLanes(double[] a, int idx) { double res = Double.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static double minAll(double[] a) { + static double minLanes(double[] a) { double res = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void minAllDouble128VectorTests(IntFunction fa) { + static void minLanesDouble128VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Double128VectorTests::minAll, Double128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Double128VectorTests::minLanes, Double128VectorTests::minLanes); } - static double maxAll(double[] a, int idx) { + static double maxLanes(double[] a, int idx) { double res = Double.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static double maxAll(double[] a) { + static double maxLanes(double[] a) { double res = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void maxAllDouble128VectorTests(IntFunction fa) { + static void maxLanesDouble128VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Double128VectorTests::maxAll, Double128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Double128VectorTests::maxLanes, Double128VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Double256VectorTests.java 2019-04-26 14:52:50.903913000 -0700 +++ new/test/jdk/jdk/incubator/vector/Double256VectorTests.java 2019-04-26 14:52:50.311274700 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static double max(double a, double b) { return (double)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static double addAll(double[] a, int idx) { + static double addLanes(double[] a, int idx) { double res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static double addAll(double[] a) { + static double addLanes(double[] a) { double res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void addAllDouble256VectorTests(IntFunction fa) { + static void addLanesDouble256VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Double256VectorTests::addAll, Double256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Double256VectorTests::addLanes, Double256VectorTests::addLanes); } - static double mulAll(double[] a, int idx) { + static double mulLanes(double[] a, int idx) { double res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static double mulAll(double[] a) { + static double mulLanes(double[] a) { double res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void mulAllDouble256VectorTests(IntFunction fa) { + static void mulLanesDouble256VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Double256VectorTests::mulAll, Double256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Double256VectorTests::mulLanes, Double256VectorTests::mulLanes); } - static double minAll(double[] a, int idx) { + static double minLanes(double[] a, int idx) { double res = Double.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static double minAll(double[] a) { + static double minLanes(double[] a) { double res = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void minAllDouble256VectorTests(IntFunction fa) { + static void minLanesDouble256VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Double256VectorTests::minAll, Double256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Double256VectorTests::minLanes, Double256VectorTests::minLanes); } - static double maxAll(double[] a, int idx) { + static double maxLanes(double[] a, int idx) { double res = Double.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static double maxAll(double[] a) { + static double maxLanes(double[] a) { double res = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void maxAllDouble256VectorTests(IntFunction fa) { + static void maxLanesDouble256VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Double256VectorTests::maxAll, Double256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Double256VectorTests::maxLanes, Double256VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Double512VectorTests.java 2019-04-26 14:52:55.491615500 -0700 +++ new/test/jdk/jdk/incubator/vector/Double512VectorTests.java 2019-04-26 14:52:54.846399400 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static double max(double a, double b) { return (double)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static double addAll(double[] a, int idx) { + static double addLanes(double[] a, int idx) { double res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static double addAll(double[] a) { + static double addLanes(double[] a) { double res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void addAllDouble512VectorTests(IntFunction fa) { + static void addLanesDouble512VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Double512VectorTests::addAll, Double512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Double512VectorTests::addLanes, Double512VectorTests::addLanes); } - static double mulAll(double[] a, int idx) { + static double mulLanes(double[] a, int idx) { double res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static double mulAll(double[] a) { + static double mulLanes(double[] a) { double res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void mulAllDouble512VectorTests(IntFunction fa) { + static void mulLanesDouble512VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Double512VectorTests::mulAll, Double512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Double512VectorTests::mulLanes, Double512VectorTests::mulLanes); } - static double minAll(double[] a, int idx) { + static double minLanes(double[] a, int idx) { double res = Double.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static double minAll(double[] a) { + static double minLanes(double[] a) { double res = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void minAllDouble512VectorTests(IntFunction fa) { + static void minLanesDouble512VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Double512VectorTests::minAll, Double512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Double512VectorTests::minLanes, Double512VectorTests::minLanes); } - static double maxAll(double[] a, int idx) { + static double maxLanes(double[] a, int idx) { double res = Double.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static double maxAll(double[] a) { + static double maxLanes(double[] a) { double res = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void maxAllDouble512VectorTests(IntFunction fa) { + static void maxLanesDouble512VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Double512VectorTests::maxAll, Double512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Double512VectorTests::maxLanes, Double512VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Double64VectorTests.java 2019-04-26 14:53:00.266523500 -0700 +++ new/test/jdk/jdk/incubator/vector/Double64VectorTests.java 2019-04-26 14:52:59.660718600 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static double max(double a, double b) { return (double)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static double addAll(double[] a, int idx) { + static double addLanes(double[] a, int idx) { double res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static double addAll(double[] a) { + static double addLanes(double[] a) { double res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void addAllDouble64VectorTests(IntFunction fa) { + static void addLanesDouble64VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Double64VectorTests::addAll, Double64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Double64VectorTests::addLanes, Double64VectorTests::addLanes); } - static double mulAll(double[] a, int idx) { + static double mulLanes(double[] a, int idx) { double res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static double mulAll(double[] a) { + static double mulLanes(double[] a) { double res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void mulAllDouble64VectorTests(IntFunction fa) { + static void mulLanesDouble64VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Double64VectorTests::mulAll, Double64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Double64VectorTests::mulLanes, Double64VectorTests::mulLanes); } - static double minAll(double[] a, int idx) { + static double minLanes(double[] a, int idx) { double res = Double.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static double minAll(double[] a) { + static double minLanes(double[] a) { double res = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void minAllDouble64VectorTests(IntFunction fa) { + static void minLanesDouble64VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Double64VectorTests::minAll, Double64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Double64VectorTests::minLanes, Double64VectorTests::minLanes); } - static double maxAll(double[] a, int idx) { + static double maxLanes(double[] a, int idx) { double res = Double.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static double maxAll(double[] a) { + static double maxLanes(double[] a) { double res = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void maxAllDouble64VectorTests(IntFunction fa) { + static void maxLanesDouble64VectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Double64VectorTests::maxAll, Double64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Double64VectorTests::maxLanes, Double64VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java 2019-04-26 14:53:04.827857900 -0700 +++ new/test/jdk/jdk/incubator/vector/DoubleMaxVectorTests.java 2019-04-26 14:53:04.234266600 -0700 @@ -734,6 +734,18 @@ + + + + + + + + + + + + static double max(double a, double b) { return (double)(Math.max(a, b)); } @@ -780,7 +792,7 @@ - static double addAll(double[] a, int idx) { + static double addLanes(double[] a, int idx) { double res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -789,7 +801,7 @@ return res; } - static double addAll(double[] a) { + static double addLanes(double[] a) { double res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 0; @@ -802,7 +814,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void addAllDoubleMaxVectorTests(IntFunction fa) { + static void addLanesDoubleMaxVectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 0; @@ -810,7 +822,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -818,13 +830,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::addAll, DoubleMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::addLanes, DoubleMaxVectorTests::addLanes); } - static double mulAll(double[] a, int idx) { + static double mulLanes(double[] a, int idx) { double res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -833,7 +845,7 @@ return res; } - static double mulAll(double[] a) { + static double mulLanes(double[] a) { double res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { double tmp = 1; @@ -846,7 +858,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void mulAllDoubleMaxVectorTests(IntFunction fa) { + static void mulLanesDoubleMaxVectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = 1; @@ -854,7 +866,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -862,13 +874,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::mulAll, DoubleMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::mulLanes, DoubleMaxVectorTests::mulLanes); } - static double minAll(double[] a, int idx) { + static double minLanes(double[] a, int idx) { double res = Double.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.min(res, a[i]); @@ -877,7 +889,7 @@ return res; } - static double minAll(double[] a) { + static double minLanes(double[] a) { double res = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.min(res, a[i]); @@ -886,7 +898,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void minAllDoubleMaxVectorTests(IntFunction fa) { + static void minLanesDoubleMaxVectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -894,7 +906,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -902,13 +914,13 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::minAll, DoubleMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::minLanes, DoubleMaxVectorTests::minLanes); } - static double maxAll(double[] a, int idx) { + static double maxLanes(double[] a, int idx) { double res = Double.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (double)Math.max(res, a[i]); @@ -917,7 +929,7 @@ return res; } - static double maxAll(double[] a) { + static double maxLanes(double[] a) { double res = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (double)Math.max(res, a[i]); @@ -926,7 +938,7 @@ return res; } @Test(dataProvider = "doubleUnaryOpProvider") - static void maxAllDoubleMaxVectorTests(IntFunction fa) { + static void maxLanesDoubleMaxVectorTests(IntFunction fa) { double[] a = fa.apply(SPECIES.length()); double[] r = fr.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -934,7 +946,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -942,11 +954,11 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::maxAll, DoubleMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, DoubleMaxVectorTests::maxLanes, DoubleMaxVectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Float128VectorTests.java 2019-04-26 14:53:09.602356200 -0700 +++ new/test/jdk/jdk/incubator/vector/Float128VectorTests.java 2019-04-26 14:53:09.014012500 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static float max(float a, float b) { return (float)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static float addAll(float[] a, int idx) { + static float addLanes(float[] a, int idx) { float res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static float addAll(float[] a) { + static float addLanes(float[] a) { float res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void addAllFloat128VectorTests(IntFunction fa) { + static void addLanesFloat128VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Float128VectorTests::addAll, Float128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Float128VectorTests::addLanes, Float128VectorTests::addLanes); } - static float mulAll(float[] a, int idx) { + static float mulLanes(float[] a, int idx) { float res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static float mulAll(float[] a) { + static float mulLanes(float[] a) { float res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void mulAllFloat128VectorTests(IntFunction fa) { + static void mulLanesFloat128VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Float128VectorTests::mulAll, Float128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Float128VectorTests::mulLanes, Float128VectorTests::mulLanes); } - static float minAll(float[] a, int idx) { + static float minLanes(float[] a, int idx) { float res = Float.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static float minAll(float[] a) { + static float minLanes(float[] a) { float res = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void minAllFloat128VectorTests(IntFunction fa) { + static void minLanesFloat128VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Float128VectorTests::minAll, Float128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Float128VectorTests::minLanes, Float128VectorTests::minLanes); } - static float maxAll(float[] a, int idx) { + static float maxLanes(float[] a, int idx) { float res = Float.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static float maxAll(float[] a) { + static float maxLanes(float[] a) { float res = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void maxAllFloat128VectorTests(IntFunction fa) { + static void maxLanesFloat128VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Float128VectorTests::maxAll, Float128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Float128VectorTests::maxLanes, Float128VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Float256VectorTests.java 2019-04-26 14:53:14.235150500 -0700 +++ new/test/jdk/jdk/incubator/vector/Float256VectorTests.java 2019-04-26 14:53:13.617763400 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static float max(float a, float b) { return (float)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static float addAll(float[] a, int idx) { + static float addLanes(float[] a, int idx) { float res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static float addAll(float[] a) { + static float addLanes(float[] a) { float res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void addAllFloat256VectorTests(IntFunction fa) { + static void addLanesFloat256VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Float256VectorTests::addAll, Float256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Float256VectorTests::addLanes, Float256VectorTests::addLanes); } - static float mulAll(float[] a, int idx) { + static float mulLanes(float[] a, int idx) { float res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static float mulAll(float[] a) { + static float mulLanes(float[] a) { float res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void mulAllFloat256VectorTests(IntFunction fa) { + static void mulLanesFloat256VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Float256VectorTests::mulAll, Float256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Float256VectorTests::mulLanes, Float256VectorTests::mulLanes); } - static float minAll(float[] a, int idx) { + static float minLanes(float[] a, int idx) { float res = Float.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static float minAll(float[] a) { + static float minLanes(float[] a) { float res = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void minAllFloat256VectorTests(IntFunction fa) { + static void minLanesFloat256VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Float256VectorTests::minAll, Float256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Float256VectorTests::minLanes, Float256VectorTests::minLanes); } - static float maxAll(float[] a, int idx) { + static float maxLanes(float[] a, int idx) { float res = Float.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static float maxAll(float[] a) { + static float maxLanes(float[] a) { float res = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void maxAllFloat256VectorTests(IntFunction fa) { + static void maxLanesFloat256VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Float256VectorTests::maxAll, Float256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Float256VectorTests::maxLanes, Float256VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Float512VectorTests.java 2019-04-26 14:53:18.938480900 -0700 +++ new/test/jdk/jdk/incubator/vector/Float512VectorTests.java 2019-04-26 14:53:18.352135300 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static float max(float a, float b) { return (float)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static float addAll(float[] a, int idx) { + static float addLanes(float[] a, int idx) { float res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static float addAll(float[] a) { + static float addLanes(float[] a) { float res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void addAllFloat512VectorTests(IntFunction fa) { + static void addLanesFloat512VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Float512VectorTests::addAll, Float512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Float512VectorTests::addLanes, Float512VectorTests::addLanes); } - static float mulAll(float[] a, int idx) { + static float mulLanes(float[] a, int idx) { float res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static float mulAll(float[] a) { + static float mulLanes(float[] a) { float res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void mulAllFloat512VectorTests(IntFunction fa) { + static void mulLanesFloat512VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Float512VectorTests::mulAll, Float512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Float512VectorTests::mulLanes, Float512VectorTests::mulLanes); } - static float minAll(float[] a, int idx) { + static float minLanes(float[] a, int idx) { float res = Float.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static float minAll(float[] a) { + static float minLanes(float[] a) { float res = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void minAllFloat512VectorTests(IntFunction fa) { + static void minLanesFloat512VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Float512VectorTests::minAll, Float512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Float512VectorTests::minLanes, Float512VectorTests::minLanes); } - static float maxAll(float[] a, int idx) { + static float maxLanes(float[] a, int idx) { float res = Float.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static float maxAll(float[] a) { + static float maxLanes(float[] a) { float res = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void maxAllFloat512VectorTests(IntFunction fa) { + static void maxLanesFloat512VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Float512VectorTests::maxAll, Float512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Float512VectorTests::maxLanes, Float512VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Float64VectorTests.java 2019-04-26 14:53:23.336910500 -0700 +++ new/test/jdk/jdk/incubator/vector/Float64VectorTests.java 2019-04-26 14:53:22.750420700 -0700 @@ -730,6 +730,18 @@ + + + + + + + + + + + + static float max(float a, float b) { return (float)(Math.max(a, b)); } @@ -776,7 +788,7 @@ - static float addAll(float[] a, int idx) { + static float addLanes(float[] a, int idx) { float res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -785,7 +797,7 @@ return res; } - static float addAll(float[] a) { + static float addLanes(float[] a) { float res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 0; @@ -798,7 +810,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void addAllFloat64VectorTests(IntFunction fa) { + static void addLanesFloat64VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -806,7 +818,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -814,13 +826,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Float64VectorTests::addAll, Float64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Float64VectorTests::addLanes, Float64VectorTests::addLanes); } - static float mulAll(float[] a, int idx) { + static float mulLanes(float[] a, int idx) { float res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -829,7 +841,7 @@ return res; } - static float mulAll(float[] a) { + static float mulLanes(float[] a) { float res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 1; @@ -842,7 +854,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void mulAllFloat64VectorTests(IntFunction fa) { + static void mulLanesFloat64VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 1; @@ -850,7 +862,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -858,13 +870,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Float64VectorTests::mulAll, Float64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Float64VectorTests::mulLanes, Float64VectorTests::mulLanes); } - static float minAll(float[] a, int idx) { + static float minLanes(float[] a, int idx) { float res = Float.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.min(res, a[i]); @@ -873,7 +885,7 @@ return res; } - static float minAll(float[] a) { + static float minLanes(float[] a) { float res = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.min(res, a[i]); @@ -882,7 +894,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void minAllFloat64VectorTests(IntFunction fa) { + static void minLanesFloat64VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -890,7 +902,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -898,13 +910,13 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Float64VectorTests::minAll, Float64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Float64VectorTests::minLanes, Float64VectorTests::minLanes); } - static float maxAll(float[] a, int idx) { + static float maxLanes(float[] a, int idx) { float res = Float.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.max(res, a[i]); @@ -913,7 +925,7 @@ return res; } - static float maxAll(float[] a) { + static float maxLanes(float[] a) { float res = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.max(res, a[i]); @@ -922,7 +934,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void maxAllFloat64VectorTests(IntFunction fa) { + static void maxLanesFloat64VectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -930,7 +942,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -938,11 +950,11 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Float64VectorTests::maxAll, Float64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Float64VectorTests::maxLanes, Float64VectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java 2019-04-26 14:53:27.879339900 -0700 +++ new/test/jdk/jdk/incubator/vector/FloatMaxVectorTests.java 2019-04-26 14:53:27.297052800 -0700 @@ -734,6 +734,18 @@ + + + + + + + + + + + + static float max(float a, float b) { return (float)(Math.max(a, b)); } @@ -780,7 +792,7 @@ - static float addAll(float[] a, int idx) { + static float addLanes(float[] a, int idx) { float res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -789,7 +801,7 @@ return res; } - static float addAll(float[] a) { + static float addLanes(float[] a) { float res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 0; @@ -802,7 +814,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void addAllFloatMaxVectorTests(IntFunction fa) { + static void addLanesFloatMaxVectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 0; @@ -810,7 +822,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -818,13 +830,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::addAll, FloatMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::addLanes, FloatMaxVectorTests::addLanes); } - static float mulAll(float[] a, int idx) { + static float mulLanes(float[] a, int idx) { float res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -833,7 +845,7 @@ return res; } - static float mulAll(float[] a) { + static float mulLanes(float[] a) { float res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { float tmp = 1; @@ -846,7 +858,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void mulAllFloatMaxVectorTests(IntFunction fa) { + static void mulLanesFloatMaxVectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = 1; @@ -854,7 +866,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -862,13 +874,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::mulAll, FloatMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::mulLanes, FloatMaxVectorTests::mulLanes); } - static float minAll(float[] a, int idx) { + static float minLanes(float[] a, int idx) { float res = Float.POSITIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.min(res, a[i]); @@ -877,7 +889,7 @@ return res; } - static float minAll(float[] a) { + static float minLanes(float[] a) { float res = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.min(res, a[i]); @@ -886,7 +898,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void minAllFloatMaxVectorTests(IntFunction fa) { + static void minLanesFloatMaxVectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -894,7 +906,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -902,13 +914,13 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::minAll, FloatMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::minLanes, FloatMaxVectorTests::minLanes); } - static float maxAll(float[] a, int idx) { + static float maxLanes(float[] a, int idx) { float res = Float.NEGATIVE_INFINITY; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (float)Math.max(res, a[i]); @@ -917,7 +929,7 @@ return res; } - static float maxAll(float[] a) { + static float maxLanes(float[] a) { float res = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i++) { res = (float)Math.max(res, a[i]); @@ -926,7 +938,7 @@ return res; } @Test(dataProvider = "floatUnaryOpProvider") - static void maxAllFloatMaxVectorTests(IntFunction fa) { + static void maxLanesFloatMaxVectorTests(IntFunction fa) { float[] a = fa.apply(SPECIES.length()); float[] r = fr.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -934,7 +946,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -942,11 +954,11 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::maxAll, FloatMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, FloatMaxVectorTests::maxLanes, FloatMaxVectorTests::maxLanes); } --- old/test/jdk/jdk/incubator/vector/Int128VectorTests.java 2019-04-26 14:53:32.475199900 -0700 +++ new/test/jdk/jdk/incubator/vector/Int128VectorTests.java 2019-04-26 14:53:31.871321900 -0700 @@ -682,12 +682,12 @@ } - static int shiftR(int a, int b) { - return (int)((a >>> b)); + static int shiftLeft(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int128VectorTests::shiftR); + assertArraysEquals(a, b, r, Int128VectorTests::shiftLeft); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt128VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftLeft); } - static int shiftL(int a, int b) { - return (int)((a << b)); + + + + + static int shiftRight(int a, int b) { + return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int128VectorTests::shiftL); + assertArraysEquals(a, b, r, Int128VectorTests::shiftRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt128VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftRight); } - static int aShiftR(int a, int b) { + + + + + static int shiftArithmeticRight(int a, int b) { return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt128VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int128VectorTests::aShiftR); + assertArraysEquals(a, b, r, Int128VectorTests::shiftArithmeticRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt128VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int128VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Int128VectorTests::shiftArithmeticRight); } - static int aShiftR_unary(int a, int b) { - return (int)((a >> b)); + + + + + static int shiftLeft_unary(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftLeft_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftLeft_unary); } - static int shiftR_unary(int a, int b) { + + + + + static int shiftRight_unary(int a, int b) { return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftRight_unary); } - static int shiftL_unary(int a, int b) { - return (int)((a << b)); + + + + + static int shiftArithmeticRight_unary(int a, int b) { + return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt128VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Int128VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Int128VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static int max(int a, int b) { return (int)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Int128VectorTests::min); } - static int andAll(int[] a, int idx) { + static int andLanes(int[] a, int idx) { int res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static int andAll(int[] a) { + static int andLanes(int[] a) { int res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllInt128VectorTests(IntFunction fa) { + static void andLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::andAll, Int128VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::andLanes, Int128VectorTests::andLanes); } - static int orAll(int[] a, int idx) { + static int orLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static int orAll(int[] a) { + static int orLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllInt128VectorTests(IntFunction fa) { + static void orLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::orAll, Int128VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::orLanes, Int128VectorTests::orLanes); } - static int xorAll(int[] a, int idx) { + static int xorLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static int xorAll(int[] a) { + static int xorLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllInt128VectorTests(IntFunction fa) { + static void xorLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::xorAll, Int128VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::xorLanes, Int128VectorTests::xorLanes); } - static int addAll(int[] a, int idx) { + static int addLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static int addAll(int[] a) { + static int addLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllInt128VectorTests(IntFunction fa) { + static void addLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::addAll, Int128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::addLanes, Int128VectorTests::addLanes); } - static int mulAll(int[] a, int idx) { + static int mulLanes(int[] a, int idx) { int res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static int mulAll(int[] a) { + static int mulLanes(int[] a) { int res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllInt128VectorTests(IntFunction fa) { + static void mulLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::mulAll, Int128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::mulLanes, Int128VectorTests::mulLanes); } - static int minAll(int[] a, int idx) { + static int minLanes(int[] a, int idx) { int res = Integer.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static int minAll(int[] a) { + static int minLanes(int[] a) { int res = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllInt128VectorTests(IntFunction fa) { + static void minLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::minAll, Int128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::minLanes, Int128VectorTests::minLanes); } - static int maxAll(int[] a, int idx) { + static int maxLanes(int[] a, int idx) { int res = Integer.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static int maxAll(int[] a) { + static int maxLanes(int[] a) { int res = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllInt128VectorTests(IntFunction fa) { + static void maxLanesInt128VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Int128VectorTests::maxAll, Int128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Int128VectorTests::maxLanes, Int128VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Int256VectorTests.java 2019-04-26 14:53:36.904837500 -0700 +++ new/test/jdk/jdk/incubator/vector/Int256VectorTests.java 2019-04-26 14:53:36.326424400 -0700 @@ -682,12 +682,12 @@ } - static int shiftR(int a, int b) { - return (int)((a >>> b)); + static int shiftLeft(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftInt256VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int256VectorTests::shiftR); + assertArraysEquals(a, b, r, Int256VectorTests::shiftLeft); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt256VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int256VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Int256VectorTests::shiftLeft); } - static int shiftL(int a, int b) { - return (int)((a << b)); + + + + + static int shiftRight(int a, int b) { + return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightInt256VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int256VectorTests::shiftL); + assertArraysEquals(a, b, r, Int256VectorTests::shiftRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt256VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int256VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Int256VectorTests::shiftRight); } - static int aShiftR(int a, int b) { + + + + + static int shiftArithmeticRight(int a, int b) { return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt256VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int256VectorTests::aShiftR); + assertArraysEquals(a, b, r, Int256VectorTests::shiftArithmeticRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt256VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int256VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Int256VectorTests::shiftArithmeticRight); } - static int aShiftR_unary(int a, int b) { - return (int)((a >> b)); + + + + + static int shiftLeft_unary(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftInt256VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int256VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Int256VectorTests::shiftLeft_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftInt256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::shiftLeft_unary); } - static int shiftR_unary(int a, int b) { + + + + + static int shiftRight_unary(int a, int b) { return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightInt256VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Int256VectorTests::shiftRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightInt256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::shiftRight_unary); } - static int shiftL_unary(int a, int b) { - return (int)((a << b)); + + + + + static int shiftArithmeticRight_unary(int a, int b) { + return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt256VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Int256VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Int256VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static int max(int a, int b) { return (int)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Int256VectorTests::min); } - static int andAll(int[] a, int idx) { + static int andLanes(int[] a, int idx) { int res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static int andAll(int[] a) { + static int andLanes(int[] a) { int res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllInt256VectorTests(IntFunction fa) { + static void andLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::andAll, Int256VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::andLanes, Int256VectorTests::andLanes); } - static int orAll(int[] a, int idx) { + static int orLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static int orAll(int[] a) { + static int orLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllInt256VectorTests(IntFunction fa) { + static void orLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::orAll, Int256VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::orLanes, Int256VectorTests::orLanes); } - static int xorAll(int[] a, int idx) { + static int xorLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static int xorAll(int[] a) { + static int xorLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllInt256VectorTests(IntFunction fa) { + static void xorLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::xorAll, Int256VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::xorLanes, Int256VectorTests::xorLanes); } - static int addAll(int[] a, int idx) { + static int addLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static int addAll(int[] a) { + static int addLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllInt256VectorTests(IntFunction fa) { + static void addLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::addAll, Int256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::addLanes, Int256VectorTests::addLanes); } - static int mulAll(int[] a, int idx) { + static int mulLanes(int[] a, int idx) { int res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static int mulAll(int[] a) { + static int mulLanes(int[] a) { int res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllInt256VectorTests(IntFunction fa) { + static void mulLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::mulAll, Int256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::mulLanes, Int256VectorTests::mulLanes); } - static int minAll(int[] a, int idx) { + static int minLanes(int[] a, int idx) { int res = Integer.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static int minAll(int[] a) { + static int minLanes(int[] a) { int res = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllInt256VectorTests(IntFunction fa) { + static void minLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::minAll, Int256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::minLanes, Int256VectorTests::minLanes); } - static int maxAll(int[] a, int idx) { + static int maxLanes(int[] a, int idx) { int res = Integer.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static int maxAll(int[] a) { + static int maxLanes(int[] a) { int res = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllInt256VectorTests(IntFunction fa) { + static void maxLanesInt256VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Int256VectorTests::maxAll, Int256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Int256VectorTests::maxLanes, Int256VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Int512VectorTests.java 2019-04-26 14:53:41.391805800 -0700 +++ new/test/jdk/jdk/incubator/vector/Int512VectorTests.java 2019-04-26 14:53:40.791287100 -0700 @@ -682,12 +682,12 @@ } - static int shiftR(int a, int b) { - return (int)((a >>> b)); + static int shiftLeft(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftInt512VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int512VectorTests::shiftR); + assertArraysEquals(a, b, r, Int512VectorTests::shiftLeft); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt512VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int512VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Int512VectorTests::shiftLeft); } - static int shiftL(int a, int b) { - return (int)((a << b)); + + + + + static int shiftRight(int a, int b) { + return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightInt512VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int512VectorTests::shiftL); + assertArraysEquals(a, b, r, Int512VectorTests::shiftRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt512VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int512VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Int512VectorTests::shiftRight); } - static int aShiftR(int a, int b) { + + + + + static int shiftArithmeticRight(int a, int b) { return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt512VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int512VectorTests::aShiftR); + assertArraysEquals(a, b, r, Int512VectorTests::shiftArithmeticRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt512VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int512VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Int512VectorTests::shiftArithmeticRight); } - static int aShiftR_unary(int a, int b) { - return (int)((a >> b)); + + + + + static int shiftLeft_unary(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftInt512VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int512VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Int512VectorTests::shiftLeft_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftInt512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::shiftLeft_unary); } - static int shiftR_unary(int a, int b) { + + + + + static int shiftRight_unary(int a, int b) { return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightInt512VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Int512VectorTests::shiftRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightInt512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::shiftRight_unary); } - static int shiftL_unary(int a, int b) { - return (int)((a << b)); + + + + + static int shiftArithmeticRight_unary(int a, int b) { + return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt512VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Int512VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Int512VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static int max(int a, int b) { return (int)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Int512VectorTests::min); } - static int andAll(int[] a, int idx) { + static int andLanes(int[] a, int idx) { int res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static int andAll(int[] a) { + static int andLanes(int[] a) { int res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllInt512VectorTests(IntFunction fa) { + static void andLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::andAll, Int512VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::andLanes, Int512VectorTests::andLanes); } - static int orAll(int[] a, int idx) { + static int orLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static int orAll(int[] a) { + static int orLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllInt512VectorTests(IntFunction fa) { + static void orLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::orAll, Int512VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::orLanes, Int512VectorTests::orLanes); } - static int xorAll(int[] a, int idx) { + static int xorLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static int xorAll(int[] a) { + static int xorLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllInt512VectorTests(IntFunction fa) { + static void xorLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::xorAll, Int512VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::xorLanes, Int512VectorTests::xorLanes); } - static int addAll(int[] a, int idx) { + static int addLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static int addAll(int[] a) { + static int addLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllInt512VectorTests(IntFunction fa) { + static void addLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::addAll, Int512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::addLanes, Int512VectorTests::addLanes); } - static int mulAll(int[] a, int idx) { + static int mulLanes(int[] a, int idx) { int res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static int mulAll(int[] a) { + static int mulLanes(int[] a) { int res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllInt512VectorTests(IntFunction fa) { + static void mulLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::mulAll, Int512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::mulLanes, Int512VectorTests::mulLanes); } - static int minAll(int[] a, int idx) { + static int minLanes(int[] a, int idx) { int res = Integer.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static int minAll(int[] a) { + static int minLanes(int[] a) { int res = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllInt512VectorTests(IntFunction fa) { + static void minLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::minAll, Int512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::minLanes, Int512VectorTests::minLanes); } - static int maxAll(int[] a, int idx) { + static int maxLanes(int[] a, int idx) { int res = Integer.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static int maxAll(int[] a) { + static int maxLanes(int[] a) { int res = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllInt512VectorTests(IntFunction fa) { + static void maxLanesInt512VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Int512VectorTests::maxAll, Int512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Int512VectorTests::maxLanes, Int512VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Int64VectorTests.java 2019-04-26 14:53:46.031788000 -0700 +++ new/test/jdk/jdk/incubator/vector/Int64VectorTests.java 2019-04-26 14:53:45.443798900 -0700 @@ -682,12 +682,12 @@ } - static int shiftR(int a, int b) { - return (int)((a >>> b)); + static int shiftLeft(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftInt64VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int64VectorTests::shiftR); + assertArraysEquals(a, b, r, Int64VectorTests::shiftLeft); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt64VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int64VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Int64VectorTests::shiftLeft); } - static int shiftL(int a, int b) { - return (int)((a << b)); + + + + + static int shiftRight(int a, int b) { + return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightInt64VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int64VectorTests::shiftL); + assertArraysEquals(a, b, r, Int64VectorTests::shiftRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt64VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int64VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Int64VectorTests::shiftRight); } - static int aShiftR(int a, int b) { + + + + + static int shiftArithmeticRight(int a, int b) { return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt64VectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Int64VectorTests::aShiftR); + assertArraysEquals(a, b, r, Int64VectorTests::shiftArithmeticRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt64VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Int64VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Int64VectorTests::shiftArithmeticRight); } - static int aShiftR_unary(int a, int b) { - return (int)((a >> b)); + + + + + static int shiftLeft_unary(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRInt64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftInt64VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Int64VectorTests::shiftLeft_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRInt64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftInt64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::shiftLeft_unary); } - static int shiftR_unary(int a, int b) { + + + + + static int shiftRight_unary(int a, int b) { return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRInt64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightInt64VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Int64VectorTests::shiftRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRInt64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightInt64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::shiftRight_unary); } - static int shiftL_unary(int a, int b) { - return (int)((a << b)); + + + + + static int shiftArithmeticRight_unary(int a, int b) { + return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLInt64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightInt64VectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Int64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Int64VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLInt64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightInt64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Int64VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static int max(int a, int b) { return (int)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Int64VectorTests::min); } - static int andAll(int[] a, int idx) { + static int andLanes(int[] a, int idx) { int res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static int andAll(int[] a) { + static int andLanes(int[] a) { int res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllInt64VectorTests(IntFunction fa) { + static void andLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::andAll, Int64VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::andLanes, Int64VectorTests::andLanes); } - static int orAll(int[] a, int idx) { + static int orLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static int orAll(int[] a) { + static int orLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllInt64VectorTests(IntFunction fa) { + static void orLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::orAll, Int64VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::orLanes, Int64VectorTests::orLanes); } - static int xorAll(int[] a, int idx) { + static int xorLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static int xorAll(int[] a) { + static int xorLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllInt64VectorTests(IntFunction fa) { + static void xorLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::xorAll, Int64VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::xorLanes, Int64VectorTests::xorLanes); } - static int addAll(int[] a, int idx) { + static int addLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static int addAll(int[] a) { + static int addLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllInt64VectorTests(IntFunction fa) { + static void addLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::addAll, Int64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::addLanes, Int64VectorTests::addLanes); } - static int mulAll(int[] a, int idx) { + static int mulLanes(int[] a, int idx) { int res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static int mulAll(int[] a) { + static int mulLanes(int[] a) { int res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllInt64VectorTests(IntFunction fa) { + static void mulLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::mulAll, Int64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::mulLanes, Int64VectorTests::mulLanes); } - static int minAll(int[] a, int idx) { + static int minLanes(int[] a, int idx) { int res = Integer.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static int minAll(int[] a) { + static int minLanes(int[] a) { int res = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllInt64VectorTests(IntFunction fa) { + static void minLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::minAll, Int64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::minLanes, Int64VectorTests::minLanes); } - static int maxAll(int[] a, int idx) { + static int maxLanes(int[] a, int idx) { int res = Integer.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static int maxAll(int[] a) { + static int maxLanes(int[] a) { int res = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllInt64VectorTests(IntFunction fa) { + static void maxLanesInt64VectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Int64VectorTests::maxAll, Int64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Int64VectorTests::maxLanes, Int64VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java 2019-04-26 14:53:50.592302800 -0700 +++ new/test/jdk/jdk/incubator/vector/IntMaxVectorTests.java 2019-04-26 14:53:49.994698600 -0700 @@ -686,12 +686,12 @@ } - static int shiftR(int a, int b) { - return (int)((a >>> b)); + static int shiftLeft(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftIntMaxVectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -700,17 +700,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, IntMaxVectorTests::shiftR); + assertArraysEquals(a, b, r, IntMaxVectorTests::shiftLeft); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRIntMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -722,20 +722,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftR); + assertArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftLeft); } - static int shiftL(int a, int b) { - return (int)((a << b)); + + + + + static int shiftRight(int a, int b) { + return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightIntMaxVectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -744,17 +748,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, IntMaxVectorTests::shiftL); + assertArraysEquals(a, b, r, IntMaxVectorTests::shiftRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLIntMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftRightIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -766,20 +770,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftL); + assertArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftRight); } - static int aShiftR(int a, int b) { + + + + + static int shiftArithmeticRight(int a, int b) { return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRIntMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightIntMaxVectorTests(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -788,17 +796,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, IntMaxVectorTests::aShiftR); + assertArraysEquals(a, b, r, IntMaxVectorTests::shiftArithmeticRight); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRIntMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightIntMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -810,20 +818,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, IntMaxVectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftArithmeticRight); } - static int aShiftR_unary(int a, int b) { - return (int)((a >> b)); + + + + + static int shiftLeft_unary(int a, int b) { + return (int)((a << b)); } @Test(dataProvider = "intBinaryOpProvider") - static void aShiftRIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -831,17 +843,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, IntMaxVectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, IntMaxVectorTests::shiftLeft_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void aShiftRIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -852,20 +864,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftLeft_unary); } - static int shiftR_unary(int a, int b) { + + + + + static int shiftRight_unary(int a, int b) { return (int)((a >>> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftRIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -873,17 +889,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, IntMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, IntMaxVectorTests::shiftRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftRIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -894,20 +910,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftRight_unary); } - static int shiftL_unary(int a, int b) { - return (int)((a << b)); + + + + + static int shiftArithmeticRight_unary(int a, int b) { + return (int)((a >> b)); } @Test(dataProvider = "intBinaryOpProvider") - static void shiftLIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightIntMaxVectorTestsShift(IntFunction fa, IntFunction fb) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -915,17 +935,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, IntMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, IntMaxVectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "intBinaryOpMaskProvider") - static void shiftLIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightIntMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); @@ -936,25 +956,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, IntMaxVectorTests::shiftArithmeticRight_unary); } - - - - - - - - static int max(int a, int b) { return (int)(Math.max(a, b)); } @@ -996,7 +1008,7 @@ assertArraysEquals(a, b, r, IntMaxVectorTests::min); } - static int andAll(int[] a, int idx) { + static int andLanes(int[] a, int idx) { int res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1005,7 +1017,7 @@ return res; } - static int andAll(int[] a) { + static int andLanes(int[] a) { int res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = -1; @@ -1020,7 +1032,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void andAllIntMaxVectorTests(IntFunction fa) { + static void andLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = -1; @@ -1028,7 +1040,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1036,15 +1048,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::andAll, IntMaxVectorTests::andAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::andLanes, IntMaxVectorTests::andLanes); } - static int orAll(int[] a, int idx) { + static int orLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1053,7 +1065,7 @@ return res; } - static int orAll(int[] a) { + static int orLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1068,7 +1080,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void orAllIntMaxVectorTests(IntFunction fa) { + static void orLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1076,7 +1088,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1084,15 +1096,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::orAll, IntMaxVectorTests::orAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::orLanes, IntMaxVectorTests::orLanes); } - static int xorAll(int[] a, int idx) { + static int xorLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1101,7 +1113,7 @@ return res; } - static int xorAll(int[] a) { + static int xorLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1116,7 +1128,7 @@ @Test(dataProvider = "intUnaryOpProvider") - static void xorAllIntMaxVectorTests(IntFunction fa) { + static void xorLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1124,7 +1136,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1132,14 +1144,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::xorAll, IntMaxVectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::xorLanes, IntMaxVectorTests::xorLanes); } - static int addAll(int[] a, int idx) { + static int addLanes(int[] a, int idx) { int res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1148,7 +1160,7 @@ return res; } - static int addAll(int[] a) { + static int addLanes(int[] a) { int res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 0; @@ -1161,7 +1173,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void addAllIntMaxVectorTests(IntFunction fa) { + static void addLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 0; @@ -1169,7 +1181,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1177,13 +1189,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::addAll, IntMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::addLanes, IntMaxVectorTests::addLanes); } - static int mulAll(int[] a, int idx) { + static int mulLanes(int[] a, int idx) { int res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1192,7 +1204,7 @@ return res; } - static int mulAll(int[] a) { + static int mulLanes(int[] a) { int res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { int tmp = 1; @@ -1205,7 +1217,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void mulAllIntMaxVectorTests(IntFunction fa) { + static void mulLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = 1; @@ -1213,7 +1225,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1221,13 +1233,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::mulAll, IntMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::mulLanes, IntMaxVectorTests::mulLanes); } - static int minAll(int[] a, int idx) { + static int minLanes(int[] a, int idx) { int res = Integer.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.min(res, a[i]); @@ -1236,7 +1248,7 @@ return res; } - static int minAll(int[] a) { + static int minLanes(int[] a) { int res = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.min(res, a[i]); @@ -1245,7 +1257,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void minAllIntMaxVectorTests(IntFunction fa) { + static void minLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -1253,7 +1265,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1261,13 +1273,13 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::minAll, IntMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::minLanes, IntMaxVectorTests::minLanes); } - static int maxAll(int[] a, int idx) { + static int maxLanes(int[] a, int idx) { int res = Integer.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (int)Math.max(res, a[i]); @@ -1276,7 +1288,7 @@ return res; } - static int maxAll(int[] a) { + static int maxLanes(int[] a) { int res = Integer.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (int)Math.max(res, a[i]); @@ -1285,7 +1297,7 @@ return res; } @Test(dataProvider = "intUnaryOpProvider") - static void maxAllIntMaxVectorTests(IntFunction fa) { + static void maxLanesIntMaxVectorTests(IntFunction fa) { int[] a = fa.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -1293,7 +1305,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1301,11 +1313,11 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::maxAll, IntMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, IntMaxVectorTests::maxLanes, IntMaxVectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Long128VectorTests.java 2019-04-26 14:53:55.160073200 -0700 +++ new/test/jdk/jdk/incubator/vector/Long128VectorTests.java 2019-04-26 14:53:54.575950300 -0700 @@ -682,12 +682,12 @@ } - static long shiftR(long a, long b) { - return (long)((a >>> b)); + static long shiftLeft(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long128VectorTests::shiftR); + assertArraysEquals(a, b, r, Long128VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftLeft); } - static long shiftL(long a, long b) { - return (long)((a << b)); + + + + + static long shiftRight(long a, long b) { + return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long128VectorTests::shiftL); + assertArraysEquals(a, b, r, Long128VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong128VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong128VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long128VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long128VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong128VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long128VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long128VectorTests::shiftArithmeticRight); } - static long aShiftR_unary(long a, long b) { - return (long)((a >> b)); + + + + + static long shiftLeft_unary(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftLeft_unary); } - static long shiftR_unary(long a, long b) { + + + + + static long shiftRight_unary(long a, long b) { return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftRight_unary); } - static long shiftL_unary(long a, long b) { - return (long)((a << b)); + + + + + static long shiftArithmeticRight_unary(long a, long b) { + return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong128VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long128VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long128VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long128VectorTests::min); } - static long andAll(long[] a, int idx) { + static long andLanes(long[] a, int idx) { long res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static long andAll(long[] a) { + static long andLanes(long[] a) { long res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLong128VectorTests(IntFunction fa) { + static void andLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::andAll, Long128VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::andLanes, Long128VectorTests::andLanes); } - static long orAll(long[] a, int idx) { + static long orLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static long orAll(long[] a) { + static long orLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLong128VectorTests(IntFunction fa) { + static void orLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::orAll, Long128VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::orLanes, Long128VectorTests::orLanes); } - static long xorAll(long[] a, int idx) { + static long xorLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static long xorAll(long[] a) { + static long xorLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLong128VectorTests(IntFunction fa) { + static void xorLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::xorAll, Long128VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::xorLanes, Long128VectorTests::xorLanes); } - static long addAll(long[] a, int idx) { + static long addLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static long addAll(long[] a) { + static long addLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLong128VectorTests(IntFunction fa) { + static void addLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::addAll, Long128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::addLanes, Long128VectorTests::addLanes); } - static long mulAll(long[] a, int idx) { + static long mulLanes(long[] a, int idx) { long res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static long mulAll(long[] a) { + static long mulLanes(long[] a) { long res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLong128VectorTests(IntFunction fa) { + static void mulLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::mulAll, Long128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::mulLanes, Long128VectorTests::mulLanes); } - static long minAll(long[] a, int idx) { + static long minLanes(long[] a, int idx) { long res = Long.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static long minAll(long[] a) { + static long minLanes(long[] a) { long res = Long.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLong128VectorTests(IntFunction fa) { + static void minLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::minAll, Long128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::minLanes, Long128VectorTests::minLanes); } - static long maxAll(long[] a, int idx) { + static long maxLanes(long[] a, int idx) { long res = Long.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static long maxAll(long[] a) { + static long maxLanes(long[] a) { long res = Long.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLong128VectorTests(IntFunction fa) { + static void maxLanesLong128VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Long128VectorTests::maxAll, Long128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long128VectorTests::maxLanes, Long128VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Long256VectorTests.java 2019-04-26 14:53:59.905914700 -0700 +++ new/test/jdk/jdk/incubator/vector/Long256VectorTests.java 2019-04-26 14:53:59.261983400 -0700 @@ -682,12 +682,12 @@ } - static long shiftR(long a, long b) { - return (long)((a >>> b)); + static long shiftLeft(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong256VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long256VectorTests::shiftR); + assertArraysEquals(a, b, r, Long256VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong256VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long256VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long256VectorTests::shiftLeft); } - static long shiftL(long a, long b) { - return (long)((a << b)); + + + + + static long shiftRight(long a, long b) { + return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong256VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long256VectorTests::shiftL); + assertArraysEquals(a, b, r, Long256VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong256VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long256VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long256VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong256VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong256VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long256VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long256VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong256VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long256VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long256VectorTests::shiftArithmeticRight); } - static long aShiftR_unary(long a, long b) { - return (long)((a >> b)); + + + + + static long shiftLeft_unary(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong256VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long256VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long256VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::shiftLeft_unary); } - static long shiftR_unary(long a, long b) { + + + + + static long shiftRight_unary(long a, long b) { return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong256VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long256VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::shiftRight_unary); } - static long shiftL_unary(long a, long b) { - return (long)((a << b)); + + + + + static long shiftArithmeticRight_unary(long a, long b) { + return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong256VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long256VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long256VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long256VectorTests::min); } - static long andAll(long[] a, int idx) { + static long andLanes(long[] a, int idx) { long res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static long andAll(long[] a) { + static long andLanes(long[] a) { long res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLong256VectorTests(IntFunction fa) { + static void andLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::andAll, Long256VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::andLanes, Long256VectorTests::andLanes); } - static long orAll(long[] a, int idx) { + static long orLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static long orAll(long[] a) { + static long orLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLong256VectorTests(IntFunction fa) { + static void orLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::orAll, Long256VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::orLanes, Long256VectorTests::orLanes); } - static long xorAll(long[] a, int idx) { + static long xorLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static long xorAll(long[] a) { + static long xorLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLong256VectorTests(IntFunction fa) { + static void xorLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::xorAll, Long256VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::xorLanes, Long256VectorTests::xorLanes); } - static long addAll(long[] a, int idx) { + static long addLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static long addAll(long[] a) { + static long addLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLong256VectorTests(IntFunction fa) { + static void addLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::addAll, Long256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::addLanes, Long256VectorTests::addLanes); } - static long mulAll(long[] a, int idx) { + static long mulLanes(long[] a, int idx) { long res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static long mulAll(long[] a) { + static long mulLanes(long[] a) { long res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLong256VectorTests(IntFunction fa) { + static void mulLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::mulAll, Long256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::mulLanes, Long256VectorTests::mulLanes); } - static long minAll(long[] a, int idx) { + static long minLanes(long[] a, int idx) { long res = Long.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static long minAll(long[] a) { + static long minLanes(long[] a) { long res = Long.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLong256VectorTests(IntFunction fa) { + static void minLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::minAll, Long256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::minLanes, Long256VectorTests::minLanes); } - static long maxAll(long[] a, int idx) { + static long maxLanes(long[] a, int idx) { long res = Long.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static long maxAll(long[] a) { + static long maxLanes(long[] a) { long res = Long.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLong256VectorTests(IntFunction fa) { + static void maxLanesLong256VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Long256VectorTests::maxAll, Long256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long256VectorTests::maxLanes, Long256VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Long512VectorTests.java 2019-04-26 14:54:04.403051200 -0700 +++ new/test/jdk/jdk/incubator/vector/Long512VectorTests.java 2019-04-26 14:54:03.819048800 -0700 @@ -682,12 +682,12 @@ } - static long shiftR(long a, long b) { - return (long)((a >>> b)); + static long shiftLeft(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong512VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long512VectorTests::shiftR); + assertArraysEquals(a, b, r, Long512VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong512VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long512VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long512VectorTests::shiftLeft); } - static long shiftL(long a, long b) { - return (long)((a << b)); + + + + + static long shiftRight(long a, long b) { + return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong512VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long512VectorTests::shiftL); + assertArraysEquals(a, b, r, Long512VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong512VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long512VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long512VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong512VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong512VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long512VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long512VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong512VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long512VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long512VectorTests::shiftArithmeticRight); } - static long aShiftR_unary(long a, long b) { - return (long)((a >> b)); + + + + + static long shiftLeft_unary(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong512VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long512VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long512VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::shiftLeft_unary); } - static long shiftR_unary(long a, long b) { + + + + + static long shiftRight_unary(long a, long b) { return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong512VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long512VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::shiftRight_unary); } - static long shiftL_unary(long a, long b) { - return (long)((a << b)); + + + + + static long shiftArithmeticRight_unary(long a, long b) { + return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong512VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long512VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long512VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long512VectorTests::min); } - static long andAll(long[] a, int idx) { + static long andLanes(long[] a, int idx) { long res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static long andAll(long[] a) { + static long andLanes(long[] a) { long res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLong512VectorTests(IntFunction fa) { + static void andLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::andAll, Long512VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::andLanes, Long512VectorTests::andLanes); } - static long orAll(long[] a, int idx) { + static long orLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static long orAll(long[] a) { + static long orLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLong512VectorTests(IntFunction fa) { + static void orLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::orAll, Long512VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::orLanes, Long512VectorTests::orLanes); } - static long xorAll(long[] a, int idx) { + static long xorLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static long xorAll(long[] a) { + static long xorLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLong512VectorTests(IntFunction fa) { + static void xorLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::xorAll, Long512VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::xorLanes, Long512VectorTests::xorLanes); } - static long addAll(long[] a, int idx) { + static long addLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static long addAll(long[] a) { + static long addLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLong512VectorTests(IntFunction fa) { + static void addLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::addAll, Long512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::addLanes, Long512VectorTests::addLanes); } - static long mulAll(long[] a, int idx) { + static long mulLanes(long[] a, int idx) { long res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static long mulAll(long[] a) { + static long mulLanes(long[] a) { long res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLong512VectorTests(IntFunction fa) { + static void mulLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::mulAll, Long512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::mulLanes, Long512VectorTests::mulLanes); } - static long minAll(long[] a, int idx) { + static long minLanes(long[] a, int idx) { long res = Long.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static long minAll(long[] a) { + static long minLanes(long[] a) { long res = Long.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLong512VectorTests(IntFunction fa) { + static void minLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::minAll, Long512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::minLanes, Long512VectorTests::minLanes); } - static long maxAll(long[] a, int idx) { + static long maxLanes(long[] a, int idx) { long res = Long.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static long maxAll(long[] a) { + static long maxLanes(long[] a) { long res = Long.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLong512VectorTests(IntFunction fa) { + static void maxLanesLong512VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Long512VectorTests::maxAll, Long512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long512VectorTests::maxLanes, Long512VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Long64VectorTests.java 2019-04-26 14:54:09.022057300 -0700 +++ new/test/jdk/jdk/incubator/vector/Long64VectorTests.java 2019-04-26 14:54:08.437037100 -0700 @@ -682,12 +682,12 @@ } - static long shiftR(long a, long b) { - return (long)((a >>> b)); + static long shiftLeft(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLong64VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -696,17 +696,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long64VectorTests::shiftR); + assertArraysEquals(a, b, r, Long64VectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -718,20 +718,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftR); + assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftLeft); } - static long shiftL(long a, long b) { - return (long)((a << b)); + + + + + static long shiftRight(long a, long b) { + return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLong64VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -740,17 +744,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long64VectorTests::shiftL); + assertArraysEquals(a, b, r, Long64VectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -762,20 +766,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftL); + assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong64VectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong64VectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -784,17 +792,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, Long64VectorTests::aShiftR); + assertArraysEquals(a, b, r, Long64VectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong64VectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -806,20 +814,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, Long64VectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, Long64VectorTests::shiftArithmeticRight); } - static long aShiftR_unary(long a, long b) { - return (long)((a >> b)); + + + + + static long shiftLeft_unary(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLong64VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -827,17 +839,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLong64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -848,20 +860,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftLeft_unary); } - static long shiftR_unary(long a, long b) { + + + + + static long shiftRight_unary(long a, long b) { return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLong64VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -869,17 +885,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLong64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -890,20 +906,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftRight_unary); } - static long shiftL_unary(long a, long b) { - return (long)((a << b)); + + + + + static long shiftArithmeticRight_unary(long a, long b) { + return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLong64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLong64VectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -911,17 +931,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Long64VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLong64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLong64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -932,25 +952,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Long64VectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -992,7 +1004,7 @@ assertArraysEquals(a, b, r, Long64VectorTests::min); } - static long andAll(long[] a, int idx) { + static long andLanes(long[] a, int idx) { long res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1001,7 +1013,7 @@ return res; } - static long andAll(long[] a) { + static long andLanes(long[] a) { long res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = -1; @@ -1016,7 +1028,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLong64VectorTests(IntFunction fa) { + static void andLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1024,7 +1036,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1032,15 +1044,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::andAll, Long64VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::andLanes, Long64VectorTests::andLanes); } - static long orAll(long[] a, int idx) { + static long orLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1049,7 +1061,7 @@ return res; } - static long orAll(long[] a) { + static long orLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1064,7 +1076,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLong64VectorTests(IntFunction fa) { + static void orLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1072,7 +1084,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1080,15 +1092,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::orAll, Long64VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::orLanes, Long64VectorTests::orLanes); } - static long xorAll(long[] a, int idx) { + static long xorLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1097,7 +1109,7 @@ return res; } - static long xorAll(long[] a) { + static long xorLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1112,7 +1124,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLong64VectorTests(IntFunction fa) { + static void xorLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1120,7 +1132,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1128,14 +1140,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::xorAll, Long64VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::xorLanes, Long64VectorTests::xorLanes); } - static long addAll(long[] a, int idx) { + static long addLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1144,7 +1156,7 @@ return res; } - static long addAll(long[] a) { + static long addLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1157,7 +1169,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLong64VectorTests(IntFunction fa) { + static void addLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1165,7 +1177,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1173,13 +1185,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::addAll, Long64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::addLanes, Long64VectorTests::addLanes); } - static long mulAll(long[] a, int idx) { + static long mulLanes(long[] a, int idx) { long res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1188,7 +1200,7 @@ return res; } - static long mulAll(long[] a) { + static long mulLanes(long[] a) { long res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 1; @@ -1201,7 +1213,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLong64VectorTests(IntFunction fa) { + static void mulLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1209,7 +1221,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1217,13 +1229,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::mulAll, Long64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::mulLanes, Long64VectorTests::mulLanes); } - static long minAll(long[] a, int idx) { + static long minLanes(long[] a, int idx) { long res = Long.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.min(res, a[i]); @@ -1232,7 +1244,7 @@ return res; } - static long minAll(long[] a) { + static long minLanes(long[] a) { long res = Long.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.min(res, a[i]); @@ -1241,7 +1253,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLong64VectorTests(IntFunction fa) { + static void minLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1249,7 +1261,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1257,13 +1269,13 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::minAll, Long64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::minLanes, Long64VectorTests::minLanes); } - static long maxAll(long[] a, int idx) { + static long maxLanes(long[] a, int idx) { long res = Long.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.max(res, a[i]); @@ -1272,7 +1284,7 @@ return res; } - static long maxAll(long[] a) { + static long maxLanes(long[] a) { long res = Long.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.max(res, a[i]); @@ -1281,7 +1293,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLong64VectorTests(IntFunction fa) { + static void maxLanesLong64VectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1289,7 +1301,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1297,11 +1309,11 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Long64VectorTests::maxAll, Long64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Long64VectorTests::maxLanes, Long64VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java 2019-04-26 14:54:13.536432100 -0700 +++ new/test/jdk/jdk/incubator/vector/LongMaxVectorTests.java 2019-04-26 14:54:12.958956400 -0700 @@ -686,12 +686,12 @@ } - static long shiftR(long a, long b) { - return (long)((a >>> b)); + static long shiftLeft(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftLeftLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -700,17 +700,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, LongMaxVectorTests::shiftR); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftLeftLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -722,20 +722,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftR); + assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftLeft); } - static long shiftL(long a, long b) { - return (long)((a << b)); + + + + + static long shiftRight(long a, long b) { + return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftRightLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -744,17 +748,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, LongMaxVectorTests::shiftL); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftRightLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -766,20 +770,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftL); + assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftRight); } - static long aShiftR(long a, long b) { + + + + + static long shiftArithmeticRight(long a, long b) { return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLongMaxVectorTests(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLongMaxVectorTests(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -788,17 +796,17 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertArraysEquals(a, b, r, LongMaxVectorTests::aShiftR); + assertArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLongMaxVectorTests(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLongMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -810,20 +818,24 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertArraysEquals(a, b, r, mask, LongMaxVectorTests::aShiftR); + assertArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftArithmeticRight); } - static long aShiftR_unary(long a, long b) { - return (long)((a >> b)); + + + + + static long shiftLeft_unary(long a, long b) { + return (long)((a << b)); } @Test(dataProvider = "longBinaryOpProvider") - static void aShiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -831,17 +843,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, LongMaxVectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftLeft_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void aShiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -852,20 +864,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::aShiftR_unary); + assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftLeft_unary); } - static long shiftR_unary(long a, long b) { + + + + + static long shiftRight_unary(long a, long b) { return (long)((a >>> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -873,17 +889,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftRLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -894,20 +910,24 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftRight_unary); } - static long shiftL_unary(long a, long b) { - return (long)((a << b)); + + + + + static long shiftArithmeticRight_unary(long a, long b) { + return (long)((a >> b)); } @Test(dataProvider = "longBinaryOpProvider") - static void shiftLLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -915,17 +935,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, LongMaxVectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "longBinaryOpMaskProvider") - static void shiftLLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightLongMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); @@ -936,25 +956,17 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, LongMaxVectorTests::shiftArithmeticRight_unary); } - - - - - - - - static long max(long a, long b) { return (long)(Math.max(a, b)); } @@ -996,7 +1008,7 @@ assertArraysEquals(a, b, r, LongMaxVectorTests::min); } - static long andAll(long[] a, int idx) { + static long andLanes(long[] a, int idx) { long res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -1005,7 +1017,7 @@ return res; } - static long andAll(long[] a) { + static long andLanes(long[] a) { long res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = -1; @@ -1020,7 +1032,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void andAllLongMaxVectorTests(IntFunction fa) { + static void andLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = -1; @@ -1028,7 +1040,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -1036,15 +1048,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::andAll, LongMaxVectorTests::andAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::andLanes, LongMaxVectorTests::andLanes); } - static long orAll(long[] a, int idx) { + static long orLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -1053,7 +1065,7 @@ return res; } - static long orAll(long[] a) { + static long orLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1068,7 +1080,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void orAllLongMaxVectorTests(IntFunction fa) { + static void orLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1076,7 +1088,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -1084,15 +1096,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::orAll, LongMaxVectorTests::orAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::orLanes, LongMaxVectorTests::orLanes); } - static long xorAll(long[] a, int idx) { + static long xorLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -1101,7 +1113,7 @@ return res; } - static long xorAll(long[] a) { + static long xorLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1116,7 +1128,7 @@ @Test(dataProvider = "longUnaryOpProvider") - static void xorAllLongMaxVectorTests(IntFunction fa) { + static void xorLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1124,7 +1136,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -1132,14 +1144,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::xorAll, LongMaxVectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::xorLanes, LongMaxVectorTests::xorLanes); } - static long addAll(long[] a, int idx) { + static long addLanes(long[] a, int idx) { long res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -1148,7 +1160,7 @@ return res; } - static long addAll(long[] a) { + static long addLanes(long[] a) { long res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 0; @@ -1161,7 +1173,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void addAllLongMaxVectorTests(IntFunction fa) { + static void addLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 0; @@ -1169,7 +1181,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1177,13 +1189,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::addAll, LongMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::addLanes, LongMaxVectorTests::addLanes); } - static long mulAll(long[] a, int idx) { + static long mulLanes(long[] a, int idx) { long res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1192,7 +1204,7 @@ return res; } - static long mulAll(long[] a) { + static long mulLanes(long[] a) { long res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { long tmp = 1; @@ -1205,7 +1217,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void mulAllLongMaxVectorTests(IntFunction fa) { + static void mulLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = 1; @@ -1213,7 +1225,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1221,13 +1233,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::mulAll, LongMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::mulLanes, LongMaxVectorTests::mulLanes); } - static long minAll(long[] a, int idx) { + static long minLanes(long[] a, int idx) { long res = Long.MAX_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.min(res, a[i]); @@ -1236,7 +1248,7 @@ return res; } - static long minAll(long[] a) { + static long minLanes(long[] a) { long res = Long.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.min(res, a[i]); @@ -1245,7 +1257,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void minAllLongMaxVectorTests(IntFunction fa) { + static void minLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -1253,7 +1265,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1261,13 +1273,13 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::minAll, LongMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::minLanes, LongMaxVectorTests::minLanes); } - static long maxAll(long[] a, int idx) { + static long maxLanes(long[] a, int idx) { long res = Long.MIN_VALUE; for (int i = idx; i < (idx + SPECIES.length()); i++) { res = (long)Math.max(res, a[i]); @@ -1276,7 +1288,7 @@ return res; } - static long maxAll(long[] a) { + static long maxLanes(long[] a) { long res = Long.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (long)Math.max(res, a[i]); @@ -1285,7 +1297,7 @@ return res; } @Test(dataProvider = "longUnaryOpProvider") - static void maxAllLongMaxVectorTests(IntFunction fa) { + static void maxLanesLongMaxVectorTests(IntFunction fa) { long[] a = fa.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -1293,7 +1305,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1301,11 +1313,11 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::maxAll, LongMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, LongMaxVectorTests::maxLanes, LongMaxVectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Short128VectorTests.java 2019-04-26 14:54:18.177830100 -0700 +++ new/test/jdk/jdk/incubator/vector/Short128VectorTests.java 2019-04-26 14:54:17.570728400 -0700 @@ -662,26 +662,108 @@ + static short shiftLeft(short a, short b) { + return (short)((a << (b & 0xF))); + } + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftLeftShort128VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Short128VectorTests::shiftLeft); + } + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftLeftShort128VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Short128VectorTests::shiftLeft); + } + static short shiftRight(short a, short b) { + return (short)((a >>> (b & 0xF))); + } - static short aShiftR_unary(short a, short b) { - return (short)((a >> (b & 15))); + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftRightShort128VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Short128VectorTests::shiftRight); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort128VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Short128VectorTests::shiftRight); + } + + + + + + + static short shiftArithmeticRight(short a, short b) { + return (short)((a >> (b & 0xF))); } @Test(dataProvider = "shortBinaryOpProvider") - static void aShiftRShort128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightShort128VectorTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -689,17 +771,18 @@ 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short128VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Short128VectorTests::shiftArithmeticRight); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void aShiftRShort128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort128VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -710,20 +793,25 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Short128VectorTests::shiftArithmeticRight); } - static short shiftL_unary(short a, short b) { + + + + + static short shiftLeft_unary(short a, short b) { return (short)((a << (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftLShort128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftShort128VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -731,17 +819,17 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Short128VectorTests::shiftLeft_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftLShort128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftShort128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -752,20 +840,70 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::shiftLeft_unary); } - static short shiftR_unary(short a, short b) { + + + + + static short shiftRight_unary(short a, short b) { return (short)(((a & 0xFFFF) >>> (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftRShort128VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightShort128VectorTestsShift(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftRight((int)b[i]).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, Short128VectorTests::shiftRight_unary); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort128VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::shiftRight_unary); + } + + + + + + + static short shiftArithmeticRight_unary(short a, short b) { + return (short)((a >> (b & 15))); + } + + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftArithmeticRightShort128VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -773,17 +911,17 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Short128VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftRShort128VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort128VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -794,11 +932,11 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Short128VectorTests::shiftArithmeticRight_unary); } static short max(short a, short b) { @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Short128VectorTests::min); } - static short andAll(short[] a, int idx) { + static short andLanes(short[] a, int idx) { short res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static short andAll(short[] a) { + static short andLanes(short[] a) { short res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void andAllShort128VectorTests(IntFunction fa) { + static void andLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = -1; @@ -874,7 +1012,7 @@ 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); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::andAll, Short128VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::andLanes, Short128VectorTests::andLanes); } - static short orAll(short[] a, int idx) { + static short orLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static short orAll(short[] a) { + static short orLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void orAllShort128VectorTests(IntFunction fa) { + static void orLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -922,7 +1060,7 @@ 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); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::orAll, Short128VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::orLanes, Short128VectorTests::orLanes); } - static short xorAll(short[] a, int idx) { + static short xorLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static short xorAll(short[] a) { + static short xorLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void xorAllShort128VectorTests(IntFunction fa) { + static void xorLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -970,7 +1108,7 @@ 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); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::xorAll, Short128VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::xorLanes, Short128VectorTests::xorLanes); } - static short addAll(short[] a, int idx) { + static short addLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static short addAll(short[] a) { + static short addLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void addAllShort128VectorTests(IntFunction fa) { + static void addLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -1015,7 +1153,7 @@ 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); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::addAll, Short128VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::addLanes, Short128VectorTests::addLanes); } - static short mulAll(short[] a, int idx) { + static short mulLanes(short[] a, int idx) { short res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static short mulAll(short[] a) { + static short mulLanes(short[] a) { short res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void mulAllShort128VectorTests(IntFunction fa) { + static void mulLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 1; @@ -1059,7 +1197,7 @@ 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); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::mulAll, Short128VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::mulLanes, Short128VectorTests::mulLanes); } - static short minAll(short[] a, int idx) { + static short minLanes(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]); @@ -1082,7 +1220,7 @@ return res; } - static short minAll(short[] a) { + static short minLanes(short[] a) { short res = Short.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void minAllShort128VectorTests(IntFunction fa) { + static void minLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -1099,7 +1237,7 @@ 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); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::minAll, Short128VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::minLanes, Short128VectorTests::minLanes); } - static short maxAll(short[] a, int idx) { + static short maxLanes(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]); @@ -1122,7 +1260,7 @@ return res; } - static short maxAll(short[] a) { + static short maxLanes(short[] a) { short res = Short.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void maxAllShort128VectorTests(IntFunction fa) { + static void maxLanesShort128VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -1139,7 +1277,7 @@ 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); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Short128VectorTests::maxAll, Short128VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Short128VectorTests::maxLanes, Short128VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Short256VectorTests.java 2019-04-26 14:54:22.860336700 -0700 +++ new/test/jdk/jdk/incubator/vector/Short256VectorTests.java 2019-04-26 14:54:22.256629400 -0700 @@ -662,26 +662,108 @@ + static short shiftLeft(short a, short b) { + return (short)((a << (b & 0xF))); + } + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftLeftShort256VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Short256VectorTests::shiftLeft); + } + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftLeftShort256VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Short256VectorTests::shiftLeft); + } + static short shiftRight(short a, short b) { + return (short)((a >>> (b & 0xF))); + } - static short aShiftR_unary(short a, short b) { - return (short)((a >> (b & 15))); + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftRightShort256VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Short256VectorTests::shiftRight); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort256VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Short256VectorTests::shiftRight); + } + + + + + + + static short shiftArithmeticRight(short a, short b) { + return (short)((a >> (b & 0xF))); } @Test(dataProvider = "shortBinaryOpProvider") - static void aShiftRShort256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightShort256VectorTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -689,17 +771,18 @@ 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short256VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Short256VectorTests::shiftArithmeticRight); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void aShiftRShort256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort256VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -710,20 +793,25 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Short256VectorTests::shiftArithmeticRight); } - static short shiftL_unary(short a, short b) { + + + + + static short shiftLeft_unary(short a, short b) { return (short)((a << (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftLShort256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftShort256VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -731,17 +819,17 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Short256VectorTests::shiftLeft_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftLShort256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftShort256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -752,20 +840,70 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::shiftLeft_unary); } - static short shiftR_unary(short a, short b) { + + + + + static short shiftRight_unary(short a, short b) { return (short)(((a & 0xFFFF) >>> (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftRShort256VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightShort256VectorTestsShift(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftRight((int)b[i]).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, Short256VectorTests::shiftRight_unary); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort256VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::shiftRight_unary); + } + + + + + + + static short shiftArithmeticRight_unary(short a, short b) { + return (short)((a >> (b & 15))); + } + + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftArithmeticRightShort256VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -773,17 +911,17 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Short256VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftRShort256VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort256VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -794,11 +932,11 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Short256VectorTests::shiftArithmeticRight_unary); } static short max(short a, short b) { @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Short256VectorTests::min); } - static short andAll(short[] a, int idx) { + static short andLanes(short[] a, int idx) { short res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static short andAll(short[] a) { + static short andLanes(short[] a) { short res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void andAllShort256VectorTests(IntFunction fa) { + static void andLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = -1; @@ -874,7 +1012,7 @@ 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); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::andAll, Short256VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::andLanes, Short256VectorTests::andLanes); } - static short orAll(short[] a, int idx) { + static short orLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static short orAll(short[] a) { + static short orLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void orAllShort256VectorTests(IntFunction fa) { + static void orLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -922,7 +1060,7 @@ 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); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::orAll, Short256VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::orLanes, Short256VectorTests::orLanes); } - static short xorAll(short[] a, int idx) { + static short xorLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static short xorAll(short[] a) { + static short xorLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void xorAllShort256VectorTests(IntFunction fa) { + static void xorLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -970,7 +1108,7 @@ 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); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::xorAll, Short256VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::xorLanes, Short256VectorTests::xorLanes); } - static short addAll(short[] a, int idx) { + static short addLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static short addAll(short[] a) { + static short addLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void addAllShort256VectorTests(IntFunction fa) { + static void addLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -1015,7 +1153,7 @@ 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); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::addAll, Short256VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::addLanes, Short256VectorTests::addLanes); } - static short mulAll(short[] a, int idx) { + static short mulLanes(short[] a, int idx) { short res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static short mulAll(short[] a) { + static short mulLanes(short[] a) { short res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void mulAllShort256VectorTests(IntFunction fa) { + static void mulLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 1; @@ -1059,7 +1197,7 @@ 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); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::mulAll, Short256VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::mulLanes, Short256VectorTests::mulLanes); } - static short minAll(short[] a, int idx) { + static short minLanes(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]); @@ -1082,7 +1220,7 @@ return res; } - static short minAll(short[] a) { + static short minLanes(short[] a) { short res = Short.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void minAllShort256VectorTests(IntFunction fa) { + static void minLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -1099,7 +1237,7 @@ 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); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::minAll, Short256VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::minLanes, Short256VectorTests::minLanes); } - static short maxAll(short[] a, int idx) { + static short maxLanes(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]); @@ -1122,7 +1260,7 @@ return res; } - static short maxAll(short[] a) { + static short maxLanes(short[] a) { short res = Short.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void maxAllShort256VectorTests(IntFunction fa) { + static void maxLanesShort256VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -1139,7 +1277,7 @@ 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); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Short256VectorTests::maxAll, Short256VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Short256VectorTests::maxLanes, Short256VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Short512VectorTests.java 2019-04-26 14:54:27.542444500 -0700 +++ new/test/jdk/jdk/incubator/vector/Short512VectorTests.java 2019-04-26 14:54:26.908524600 -0700 @@ -662,26 +662,108 @@ + static short shiftLeft(short a, short b) { + return (short)((a << (b & 0xF))); + } + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftLeftShort512VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Short512VectorTests::shiftLeft); + } + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftLeftShort512VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Short512VectorTests::shiftLeft); + } + static short shiftRight(short a, short b) { + return (short)((a >>> (b & 0xF))); + } - static short aShiftR_unary(short a, short b) { - return (short)((a >> (b & 15))); + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftRightShort512VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Short512VectorTests::shiftRight); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort512VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Short512VectorTests::shiftRight); + } + + + + + + + static short shiftArithmeticRight(short a, short b) { + return (short)((a >> (b & 0xF))); } @Test(dataProvider = "shortBinaryOpProvider") - static void aShiftRShort512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightShort512VectorTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -689,17 +771,18 @@ 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short512VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Short512VectorTests::shiftArithmeticRight); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void aShiftRShort512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort512VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -710,20 +793,25 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Short512VectorTests::shiftArithmeticRight); } - static short shiftL_unary(short a, short b) { + + + + + static short shiftLeft_unary(short a, short b) { return (short)((a << (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftLShort512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftShort512VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -731,17 +819,17 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Short512VectorTests::shiftLeft_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftLShort512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftShort512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -752,20 +840,70 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::shiftLeft_unary); } - static short shiftR_unary(short a, short b) { + + + + + static short shiftRight_unary(short a, short b) { return (short)(((a & 0xFFFF) >>> (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftRShort512VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightShort512VectorTestsShift(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftRight((int)b[i]).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, Short512VectorTests::shiftRight_unary); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort512VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::shiftRight_unary); + } + + + + + + + static short shiftArithmeticRight_unary(short a, short b) { + return (short)((a >> (b & 15))); + } + + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftArithmeticRightShort512VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -773,17 +911,17 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Short512VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftRShort512VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort512VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -794,11 +932,11 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Short512VectorTests::shiftArithmeticRight_unary); } static short max(short a, short b) { @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Short512VectorTests::min); } - static short andAll(short[] a, int idx) { + static short andLanes(short[] a, int idx) { short res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static short andAll(short[] a) { + static short andLanes(short[] a) { short res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void andAllShort512VectorTests(IntFunction fa) { + static void andLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = -1; @@ -874,7 +1012,7 @@ 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); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::andAll, Short512VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::andLanes, Short512VectorTests::andLanes); } - static short orAll(short[] a, int idx) { + static short orLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static short orAll(short[] a) { + static short orLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void orAllShort512VectorTests(IntFunction fa) { + static void orLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -922,7 +1060,7 @@ 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); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::orAll, Short512VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::orLanes, Short512VectorTests::orLanes); } - static short xorAll(short[] a, int idx) { + static short xorLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static short xorAll(short[] a) { + static short xorLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void xorAllShort512VectorTests(IntFunction fa) { + static void xorLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -970,7 +1108,7 @@ 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); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::xorAll, Short512VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::xorLanes, Short512VectorTests::xorLanes); } - static short addAll(short[] a, int idx) { + static short addLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static short addAll(short[] a) { + static short addLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void addAllShort512VectorTests(IntFunction fa) { + static void addLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -1015,7 +1153,7 @@ 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); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::addAll, Short512VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::addLanes, Short512VectorTests::addLanes); } - static short mulAll(short[] a, int idx) { + static short mulLanes(short[] a, int idx) { short res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static short mulAll(short[] a) { + static short mulLanes(short[] a) { short res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void mulAllShort512VectorTests(IntFunction fa) { + static void mulLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 1; @@ -1059,7 +1197,7 @@ 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); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::mulAll, Short512VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::mulLanes, Short512VectorTests::mulLanes); } - static short minAll(short[] a, int idx) { + static short minLanes(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]); @@ -1082,7 +1220,7 @@ return res; } - static short minAll(short[] a) { + static short minLanes(short[] a) { short res = Short.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void minAllShort512VectorTests(IntFunction fa) { + static void minLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -1099,7 +1237,7 @@ 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); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::minAll, Short512VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::minLanes, Short512VectorTests::minLanes); } - static short maxAll(short[] a, int idx) { + static short maxLanes(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]); @@ -1122,7 +1260,7 @@ return res; } - static short maxAll(short[] a) { + static short maxLanes(short[] a) { short res = Short.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void maxAllShort512VectorTests(IntFunction fa) { + static void maxLanesShort512VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -1139,7 +1277,7 @@ 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); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Short512VectorTests::maxAll, Short512VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Short512VectorTests::maxLanes, Short512VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/Short64VectorTests.java 2019-04-26 14:54:32.181022600 -0700 +++ new/test/jdk/jdk/incubator/vector/Short64VectorTests.java 2019-04-26 14:54:31.591576800 -0700 @@ -662,26 +662,108 @@ + static short shiftLeft(short a, short b) { + return (short)((a << (b & 0xF))); + } + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftLeftShort64VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, Short64VectorTests::shiftLeft); + } + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftLeftShort64VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, Short64VectorTests::shiftLeft); + } + static short shiftRight(short a, short b) { + return (short)((a >>> (b & 0xF))); + } - static short aShiftR_unary(short a, short b) { - return (short)((a >> (b & 15))); + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftRightShort64VectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, Short64VectorTests::shiftRight); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort64VectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, Short64VectorTests::shiftRight); + } + + + + + + + static short shiftArithmeticRight(short a, short b) { + return (short)((a >> (b & 0xF))); } @Test(dataProvider = "shortBinaryOpProvider") - static void aShiftRShort64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightShort64VectorTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -689,17 +771,18 @@ 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short64VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, Short64VectorTests::shiftArithmeticRight); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void aShiftRShort64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort64VectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -710,20 +793,25 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, Short64VectorTests::shiftArithmeticRight); } - static short shiftL_unary(short a, short b) { + + + + + static short shiftLeft_unary(short a, short b) { return (short)((a << (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftLShort64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftShort64VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -731,17 +819,17 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, Short64VectorTests::shiftLeft_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftLShort64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftShort64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -752,20 +840,70 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::shiftLeft_unary); } - static short shiftR_unary(short a, short b) { + + + + + static short shiftRight_unary(short a, short b) { return (short)(((a & 0xFFFF) >>> (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftRShort64VectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightShort64VectorTestsShift(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftRight((int)b[i]).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, Short64VectorTests::shiftRight_unary); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShort64VectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::shiftRight_unary); + } + + + + + + + static short shiftArithmeticRight_unary(short a, short b) { + return (short)((a >> (b & 15))); + } + + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftArithmeticRightShort64VectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -773,17 +911,17 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, Short64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, Short64VectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftRShort64VectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShort64VectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -794,11 +932,11 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, Short64VectorTests::shiftArithmeticRight_unary); } static short max(short a, short b) { @@ -842,7 +980,7 @@ assertArraysEquals(a, b, r, Short64VectorTests::min); } - static short andAll(short[] a, int idx) { + static short andLanes(short[] a, int idx) { short res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -851,7 +989,7 @@ return res; } - static short andAll(short[] a) { + static short andLanes(short[] a) { short res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = -1; @@ -866,7 +1004,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void andAllShort64VectorTests(IntFunction fa) { + static void andLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = -1; @@ -874,7 +1012,7 @@ 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); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -882,15 +1020,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::andAll, Short64VectorTests::andAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::andLanes, Short64VectorTests::andLanes); } - static short orAll(short[] a, int idx) { + static short orLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -899,7 +1037,7 @@ return res; } - static short orAll(short[] a) { + static short orLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -914,7 +1052,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void orAllShort64VectorTests(IntFunction fa) { + static void orLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -922,7 +1060,7 @@ 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); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -930,15 +1068,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::orAll, Short64VectorTests::orAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::orLanes, Short64VectorTests::orLanes); } - static short xorAll(short[] a, int idx) { + static short xorLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -947,7 +1085,7 @@ return res; } - static short xorAll(short[] a) { + static short xorLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -962,7 +1100,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void xorAllShort64VectorTests(IntFunction fa) { + static void xorLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -970,7 +1108,7 @@ 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); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -978,14 +1116,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::xorAll, Short64VectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::xorLanes, Short64VectorTests::xorLanes); } - static short addAll(short[] a, int idx) { + static short addLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -994,7 +1132,7 @@ return res; } - static short addAll(short[] a) { + static short addLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -1007,7 +1145,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void addAllShort64VectorTests(IntFunction fa) { + static void addLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -1015,7 +1153,7 @@ 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); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1023,13 +1161,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::addAll, Short64VectorTests::addAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::addLanes, Short64VectorTests::addLanes); } - static short mulAll(short[] a, int idx) { + static short mulLanes(short[] a, int idx) { short res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1038,7 +1176,7 @@ return res; } - static short mulAll(short[] a) { + static short mulLanes(short[] a) { short res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 1; @@ -1051,7 +1189,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void mulAllShort64VectorTests(IntFunction fa) { + static void mulLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 1; @@ -1059,7 +1197,7 @@ 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); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1067,13 +1205,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::mulAll, Short64VectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::mulLanes, Short64VectorTests::mulLanes); } - static short minAll(short[] a, int idx) { + static short minLanes(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]); @@ -1082,7 +1220,7 @@ return res; } - static short minAll(short[] a) { + static short minLanes(short[] a) { short res = Short.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.min(res, a[i]); @@ -1091,7 +1229,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void minAllShort64VectorTests(IntFunction fa) { + static void minLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -1099,7 +1237,7 @@ 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); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1107,13 +1245,13 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::minAll, Short64VectorTests::minAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::minLanes, Short64VectorTests::minLanes); } - static short maxAll(short[] a, int idx) { + static short maxLanes(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]); @@ -1122,7 +1260,7 @@ return res; } - static short maxAll(short[] a) { + static short maxLanes(short[] a) { short res = Short.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.max(res, a[i]); @@ -1131,7 +1269,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void maxAllShort64VectorTests(IntFunction fa) { + static void maxLanesShort64VectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -1139,7 +1277,7 @@ 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); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1147,11 +1285,11 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, Short64VectorTests::maxAll, Short64VectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, Short64VectorTests::maxLanes, Short64VectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java 2019-04-26 14:54:36.723806000 -0700 +++ new/test/jdk/jdk/incubator/vector/ShortMaxVectorTests.java 2019-04-26 14:54:36.123999100 -0700 @@ -666,26 +666,108 @@ + static short shiftLeft(short a, short b) { + return (short)((a << (b & 0xF))); + } + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftLeftShortMaxVectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, ShortMaxVectorTests::shiftLeft); + } + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftLeftShortMaxVectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + assertArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftLeft); + } + static short shiftRight(short a, short b) { + return (short)((a >>> (b & 0xF))); + } - static short aShiftR_unary(short a, short b) { - return (short)((a >> (b & 15))); + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftRightShortMaxVectorTests(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, ShortMaxVectorTests::shiftRight); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShortMaxVectorTests(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + + assertArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftRight); + } + + + + + + + static short shiftArithmeticRight(short a, short b) { + return (short)((a >> (b & 0xF))); } @Test(dataProvider = "shortBinaryOpProvider") - static void aShiftRShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftArithmeticRightShortMaxVectorTests(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -693,17 +775,18 @@ 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, ShortMaxVectorTests::shiftArithmeticRight); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void aShiftRShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShortMaxVectorTests(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -714,20 +797,25 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::aShiftR_unary); + assertArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftArithmeticRight); } - static short shiftL_unary(short a, short b) { + + + + + static short shiftLeft_unary(short a, short b) { return (short)((a << (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftLShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftLeftShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -735,17 +823,17 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::shiftLeft_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftLShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftLeftShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -756,20 +844,70 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftL_unary); + assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftLeft_unary); } - static short shiftR_unary(short a, short b) { + + + + + static short shiftRight_unary(short a, short b) { return (short)(((a & 0xFFFF) >>> (b & 15))); } @Test(dataProvider = "shortBinaryOpProvider") - static void shiftRShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + static void shiftRightShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftRight((int)b[i]).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::shiftRight_unary); + } + + + + @Test(dataProvider = "shortBinaryOpMaskProvider") + static void shiftRightShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, + IntFunction fm) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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.shiftRight((int)b[i], vmask).intoArray(r, i); + } + } + + assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftRight_unary); + } + + + + + + + static short shiftArithmeticRight_unary(short a, short b) { + return (short)((a >> (b & 15))); + } + + @Test(dataProvider = "shortBinaryOpProvider") + static void shiftArithmeticRightShortMaxVectorTestsShift(IntFunction fa, IntFunction fb) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -777,17 +915,17 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, ShortMaxVectorTests::shiftArithmeticRight_unary); } @Test(dataProvider = "shortBinaryOpMaskProvider") - static void shiftRShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, + static void shiftArithmeticRightShortMaxVectorTestsShift(IntFunction fa, IntFunction fb, IntFunction fm) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); @@ -798,11 +936,11 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } - assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftR_unary); + assertShiftArraysEquals(a, b, r, mask, ShortMaxVectorTests::shiftArithmeticRight_unary); } static short max(short a, short b) { @@ -846,7 +984,7 @@ assertArraysEquals(a, b, r, ShortMaxVectorTests::min); } - static short andAll(short[] a, int idx) { + static short andLanes(short[] a, int idx) { short res = -1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res &= a[i]; @@ -855,7 +993,7 @@ return res; } - static short andAll(short[] a) { + static short andLanes(short[] a) { short res = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = -1; @@ -870,7 +1008,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void andAllShortMaxVectorTests(IntFunction fa) { + static void andLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = -1; @@ -878,7 +1016,7 @@ 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); - r[i] = av.andAll(); + r[i] = av.andLanes(); } } @@ -886,15 +1024,15 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::andAll, ShortMaxVectorTests::andAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::andLanes, ShortMaxVectorTests::andLanes); } - static short orAll(short[] a, int idx) { + static short orLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res |= a[i]; @@ -903,7 +1041,7 @@ return res; } - static short orAll(short[] a) { + static short orLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -918,7 +1056,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void orAllShortMaxVectorTests(IntFunction fa) { + static void orLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -926,7 +1064,7 @@ 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); - r[i] = av.orAll(); + r[i] = av.orLanes(); } } @@ -934,15 +1072,15 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::orAll, ShortMaxVectorTests::orAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::orLanes, ShortMaxVectorTests::orLanes); } - static short xorAll(short[] a, int idx) { + static short xorLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res ^= a[i]; @@ -951,7 +1089,7 @@ return res; } - static short xorAll(short[] a) { + static short xorLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -966,7 +1104,7 @@ @Test(dataProvider = "shortUnaryOpProvider") - static void xorAllShortMaxVectorTests(IntFunction fa) { + static void xorLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -974,7 +1112,7 @@ 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); - r[i] = av.xorAll(); + r[i] = av.xorLanes(); } } @@ -982,14 +1120,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::xorAll, ShortMaxVectorTests::xorAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::xorLanes, ShortMaxVectorTests::xorLanes); } - static short addAll(short[] a, int idx) { + static short addLanes(short[] a, int idx) { short res = 0; for (int i = idx; i < (idx + SPECIES.length()); i++) { res += a[i]; @@ -998,7 +1136,7 @@ return res; } - static short addAll(short[] a) { + static short addLanes(short[] a) { short res = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 0; @@ -1011,7 +1149,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void addAllShortMaxVectorTests(IntFunction fa) { + static void addLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 0; @@ -1019,7 +1157,7 @@ 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); - r[i] = av.addAll(); + r[i] = av.addLanes(); } } @@ -1027,13 +1165,13 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::addAll, ShortMaxVectorTests::addAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::addLanes, ShortMaxVectorTests::addLanes); } - static short mulAll(short[] a, int idx) { + static short mulLanes(short[] a, int idx) { short res = 1; for (int i = idx; i < (idx + SPECIES.length()); i++) { res *= a[i]; @@ -1042,7 +1180,7 @@ return res; } - static short mulAll(short[] a) { + static short mulLanes(short[] a) { short res = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { short tmp = 1; @@ -1055,7 +1193,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void mulAllShortMaxVectorTests(IntFunction fa) { + static void mulLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = 1; @@ -1063,7 +1201,7 @@ 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); - r[i] = av.mulAll(); + r[i] = av.mulLanes(); } } @@ -1071,13 +1209,13 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::mulAll, ShortMaxVectorTests::mulAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::mulLanes, ShortMaxVectorTests::mulLanes); } - static short minAll(short[] a, int idx) { + static short minLanes(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]); @@ -1086,7 +1224,7 @@ return res; } - static short minAll(short[] a) { + static short minLanes(short[] a) { short res = Short.MAX_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.min(res, a[i]); @@ -1095,7 +1233,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void minAllShortMaxVectorTests(IntFunction fa) { + static void minLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -1103,7 +1241,7 @@ 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); - r[i] = av.minAll(); + r[i] = av.minLanes(); } } @@ -1111,13 +1249,13 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::minAll, ShortMaxVectorTests::minAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::minLanes, ShortMaxVectorTests::minLanes); } - static short maxAll(short[] a, int idx) { + static short maxLanes(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]); @@ -1126,7 +1264,7 @@ return res; } - static short maxAll(short[] a) { + static short maxLanes(short[] a) { short res = Short.MIN_VALUE; for (int i = 0; i < a.length; i++) { res = (short)Math.max(res, a[i]); @@ -1135,7 +1273,7 @@ return res; } @Test(dataProvider = "shortUnaryOpProvider") - static void maxAllShortMaxVectorTests(IntFunction fa) { + static void maxLanesShortMaxVectorTests(IntFunction fa) { short[] a = fa.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -1143,7 +1281,7 @@ 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); - r[i] = av.maxAll(); + r[i] = av.maxLanes(); } } @@ -1151,11 +1289,11 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } - assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::maxAll, ShortMaxVectorTests::maxAll); + assertReductionArraysEquals(a, r, ra, ShortMaxVectorTests::maxLanes, ShortMaxVectorTests::maxLanes); } static boolean anyTrue(boolean[] a, int idx) { --- old/test/jdk/jdk/incubator/vector/VectorHash.java 2019-04-26 14:54:41.293471500 -0700 +++ new/test/jdk/jdk/incubator/vector/VectorHash.java 2019-04-26 14:54:40.710856300 -0700 @@ -122,7 +122,7 @@ for (; i < (a.length & ~(BYTE_64_SPECIES.length() - 1)); i += BYTE_64_SPECIES.length()) { ByteVector b = ByteVector.fromArray(BYTE_64_SPECIES, a, i); IntVector x = (IntVector) b.cast(INT_256_SPECIES); - h = h * COEFF_31_TO_8 + x.mul(H_COEFF_8).addAll(); + h = h * COEFF_31_TO_8 + x.mul(H_COEFF_8).addLanes(); } for (; i < a.length; i++) { @@ -137,7 +137,7 @@ for (; i < (a.length & ~(BYTE_128_SPECIES.length() - 1)); i += BYTE_128_SPECIES.length()) { ByteVector b = ByteVector.fromArray(BYTE_128_SPECIES, a, i); IntVector x = (IntVector) b.cast(INT_512_SPECIES); - h = h * COEFF_31_TO_16 + x.mul(H_COEFF_16).addAll(); + h = h * COEFF_31_TO_16 + x.mul(H_COEFF_16).addLanes(); } for (; i < a.length; i++) { @@ -172,9 +172,9 @@ // Reduce the size of the byte vector and then cast to int IntVector x = (IntVector)(b.reshape(bytesForIntsSpecies)).cast(intSpecies); - h = h * top_h_coeff + x.mul(v_h_coeff).addAll(); + h = h * top_h_coeff + x.mul(v_h_coeff).addLanes(); - b = b.shiftEL(intSpecies.length()); + b = b.shiftLanesLeft(intSpecies.length()); } } --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/ChaChaBench.java 2019-04-26 14:54:45.908375300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/ChaChaBench.java 2019-04-26 14:54:45.314932300 -0700 @@ -37,9 +37,9 @@ @Param({"16384", "65536"}) private int dataSize; - private ChaChaVector cc20_S128 = makeCC20(Vector.Shape.S_128_BIT); - private ChaChaVector cc20_S256 = makeCC20(Vector.Shape.S_256_BIT); - private ChaChaVector cc20_S512 = makeCC20(Vector.Shape.S_512_BIT); + private ChaChaVector cc20_S128 = makeCC20(VectorShape.S_128_BIT); + private ChaChaVector cc20_S256 = makeCC20(VectorShape.S_256_BIT); + private ChaChaVector cc20_S512 = makeCC20(VectorShape.S_512_BIT); private byte[] in; private byte[] out; @@ -48,7 +48,7 @@ private byte[] nonce = new byte[12]; private long counter = 0; - private static ChaChaVector makeCC20(Vector.Shape shape) { + private static ChaChaVector makeCC20(VectorShape shape) { ChaChaVector cc20 = new ChaChaVector(shape); runKAT(cc20); return cc20; @@ -81,29 +81,29 @@ private static final int[] STATE_CONSTANTS = new int[]{0x61707865, 0x3320646e, 0x79622d32, 0x6b206574}; - private final Vector.Species intSpecies; + private final VectorSpecies intSpecies; private final int numBlocks; - private final Vector.Shuffle rot1; - private final Vector.Shuffle rot2; - private final Vector.Shuffle rot3; + private final VectorShuffle rot1; + private final VectorShuffle rot2; + private final VectorShuffle rot3; private final IntVector counterAdd; - private final Vector.Shuffle shuf0; - private final Vector.Shuffle shuf1; - private final Vector.Shuffle shuf2; - private final Vector.Shuffle shuf3; - - private final Vector.Mask mask0; - private final Vector.Mask mask1; - private final Vector.Mask mask2; - private final Vector.Mask mask3; + private final VectorShuffle shuf0; + private final VectorShuffle shuf1; + private final VectorShuffle shuf2; + private final VectorShuffle shuf3; + + private final VectorMask mask0; + private final VectorMask mask1; + private final VectorMask mask2; + private final VectorMask mask3; private final int[] state; - public ChaChaVector(Vector.Shape shape) { - this.intSpecies = Vector.Species.of(Integer.class, shape); + public ChaChaVector(VectorShape shape) { + this.intSpecies = VectorSpecies.of(Integer.class, shape); this.numBlocks = intSpecies.length() / 4; this.rot1 = makeRotate(1); @@ -125,7 +125,7 @@ this.state = new int[numBlocks * 16]; } - private Vector.Shuffle makeRotate(int amount) { + private VectorShuffle makeRotate(int amount) { int[] shuffleArr = new int[intSpecies.length()]; for (int i = 0; i < intSpecies.length(); i ++) { @@ -133,7 +133,7 @@ shuffleArr[i] = offset + ((i + amount) % 4); } - return IntVector.shuffleFromValues(intSpecies, shuffleArr); + return VectorShuffle.fromValues(intSpecies, shuffleArr); } private IntVector makeCounterAdd() { @@ -144,16 +144,16 @@ return IntVector.fromArray(intSpecies, addArr, 0); } - private Vector.Shuffle makeRearrangeShuffle(int order) { + private VectorShuffle makeRearrangeShuffle(int order) { int[] shuffleArr = new int[intSpecies.length()]; int start = order * 4; for (int i = 0; i < shuffleArr.length; i++) { shuffleArr[i] = (i % 4) + start; } - return IntVector.shuffleFromArray(intSpecies, shuffleArr, 0); + return VectorShuffle.fromArray(intSpecies, shuffleArr, 0); } - private Vector.Mask makeRearrangeMask(int order) { + private VectorMask makeRearrangeMask(int order) { boolean[] maskArr = new boolean[intSpecies.length()]; int start = order * 4; if (start < maskArr.length) { @@ -162,7 +162,7 @@ } } - return IntVector.maskFromValues(intSpecies, maskArr); + return VectorMask.fromValues(intSpecies, maskArr); } public void makeState(byte[] key, byte[] nonce, long counter, @@ -243,19 +243,19 @@ // first round a = a.add(b); d = d.xor(a); - d = d.rotateL(16); + d = d.rotateLeft(16); c = c.add(d); b = b.xor(c); - b = b.rotateL(12); + b = b.rotateLeft(12); a = a.add(b); d = d.xor(a); - d = d.rotateL(8); + d = d.rotateLeft(8); c = c.add(d); b = b.xor(c); - b = b.rotateL(7); + b = b.rotateLeft(7); // makeRotate b = b.rearrange(rot1); @@ -265,19 +265,19 @@ // second round a = a.add(b); d = d.xor(a); - d = d.rotateL(16); + d = d.rotateLeft(16); c = c.add(d); b = b.xor(c); - b = b.rotateL(12); + b = b.rotateLeft(12); a = a.add(b); d = d.xor(a); - d = d.rotateL(8); + d = d.rotateLeft(8); c = c.add(d); b = b.xor(c); - b = b.rotateL(7); + b = b.rotateLeft(7); // makeRotate b = b.rearrange(rot3); --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/Poly1305Bench.java 2019-04-26 14:54:50.404942100 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/crypto/Poly1305Bench.java 2019-04-26 14:54:49.830084700 -0700 @@ -37,15 +37,15 @@ @Param({"16384", "65536"}) private int dataSize; - private Poly1305Vector poly1305_S128 = makePoly1305(Vector.Shape.S_128_BIT); - private Poly1305Vector poly1305_S256 = makePoly1305(Vector.Shape.S_256_BIT); - private Poly1305Vector poly1305_S512 = makePoly1305(Vector.Shape.S_512_BIT); + private Poly1305Vector poly1305_S128 = makePoly1305(VectorShape.S_128_BIT); + private Poly1305Vector poly1305_S256 = makePoly1305(VectorShape.S_256_BIT); + private Poly1305Vector poly1305_S512 = makePoly1305(VectorShape.S_512_BIT); private byte[] in; private byte[] out = new byte[16]; private byte[] key = new byte[32]; - private static Poly1305Vector makePoly1305(Vector.Shape shape) { + private static Poly1305Vector makePoly1305(VectorShape shape) { Poly1305Vector poly = new Poly1305Vector(shape); runKAT(poly); return poly; @@ -78,21 +78,21 @@ private static final int KEY_LENGTH = 32; private static final int RS_LENGTH = KEY_LENGTH / 2; - private final Vector.Species longSpecies; - private final Vector.Species intSpecies; + private final VectorSpecies longSpecies; + private final VectorSpecies intSpecies; private final int vectorWidth; private final int parBlockCount; - private final LongVector.Shuffle inShuffle0; - private final LongVector.Shuffle inShuffle1; - private final IntVector.Mask inMask; + private final VectorShuffle inShuffle0; + private final VectorShuffle inShuffle1; + private final VectorMask inMask; - public Poly1305Vector(Vector.Shape shape) { + public Poly1305Vector(VectorShape shape) { - this.longSpecies = Vector.Species.of(long.class, shape); + this.longSpecies = VectorSpecies.of(long.class, shape); int intSize = shape.bitSize() / 2; - Vector.Shape intShape = Vector.Shape.forBitSize(intSize); - this.intSpecies = Vector.Species.of(int.class, intShape); + VectorShape intShape = VectorShape.forBitSize(intSize); + this.intSpecies = VectorSpecies.of(int.class, intShape); this.vectorWidth = longSpecies.length(); this.parBlockCount = vectorWidth * 16; @@ -101,26 +101,26 @@ this.inMask = makeInMask(); } - private LongVector.Shuffle makeInShuffle0() { + private VectorShuffle makeInShuffle0() { int[] indexArr = new int[vectorWidth]; for (int i = 0; i < indexArr.length; i++) { indexArr[i] = (2 * i) % vectorWidth; } - return LongVector.shuffleFromArray(longSpecies, indexArr, 0); + return VectorShuffle.fromArray(longSpecies, indexArr, 0); } - private LongVector.Shuffle makeInShuffle1() { + private VectorShuffle makeInShuffle1() { int[] indexArr = new int[vectorWidth]; for (int i = 0; i < indexArr.length; i++) { indexArr[i] = ((2 * i) % vectorWidth) + 1; } - return LongVector.shuffleFromArray(longSpecies, indexArr, 0); + return VectorShuffle.fromArray(longSpecies, indexArr, 0); } - private LongVector.Mask makeInMask() { + private VectorMask makeInMask() { boolean[] maskArr = new boolean[vectorWidth]; for (int i = vectorWidth / 2; i < vectorWidth; i++) { maskArr[i] = true; } - return LongVector.maskFromArray(longSpecies, maskArr, 0); + return VectorMask.fromArray(longSpecies, maskArr, 0); } private static int[] fromByteArray(byte[] buf) { @@ -298,14 +298,14 @@ IntVector a0 = (IntVector) inAlign0.and(LIMB_MASK).cast(intSpecies); IntVector a1 = (IntVector) - inAlign0.shiftR(26).and(LIMB_MASK).cast(intSpecies); + inAlign0.shiftRight(26).and(LIMB_MASK).cast(intSpecies); IntVector a2 = (IntVector) - inAlign0.shiftR(52).and(0xFFF).cast(intSpecies); - a2 = a2.or(inAlign1.and(0x3FFF).shiftL(12).cast(intSpecies)); + inAlign0.shiftRight(52).and(0xFFF).cast(intSpecies); + a2 = a2.or(inAlign1.and(0x3FFF).shiftLeft(12).cast(intSpecies)); IntVector a3 = (IntVector) - inAlign1.shiftR(14).and(LIMB_MASK).cast(intSpecies); + inAlign1.shiftRight(14).and(LIMB_MASK).cast(intSpecies); IntVector a4 = (IntVector) - inAlign1.shiftR(40).and(0xFFFFFF).cast(intSpecies); + inAlign1.shiftRight(40).and(0xFFFFFF).cast(intSpecies); a4 = a4.or(1 << 24); int numParBlocks = msg.length / parBlockCount - 1; @@ -349,17 +349,17 @@ // carry/reduce // Note: this carry/reduce sequence might not be correct - c4 = c4.add(c3.shiftR(BITS_PER_LIMB)); + c4 = c4.add(c3.shiftRight(BITS_PER_LIMB)); c3 = c3.and(LIMB_MASK); - c0 = c0.add(c4.shiftR(BITS_PER_LIMB).mul(5)); + c0 = c0.add(c4.shiftRight(BITS_PER_LIMB).mul(5)); c4 = c4.and(LIMB_MASK); - c1 = c1.add(c0.shiftR(BITS_PER_LIMB)); + c1 = c1.add(c0.shiftRight(BITS_PER_LIMB)); c0 = c0.and(LIMB_MASK); - c2 = c2.add(c1.shiftR(BITS_PER_LIMB)); + c2 = c2.add(c1.shiftRight(BITS_PER_LIMB)); c1 = c1.and(LIMB_MASK); - c3 = c3.add(c2.shiftR(BITS_PER_LIMB)); + c3 = c3.add(c2.shiftRight(BITS_PER_LIMB)); c2 = c2.and(LIMB_MASK); - c4 = c4.add(c3.shiftR(BITS_PER_LIMB)); + c4 = c4.add(c3.shiftRight(BITS_PER_LIMB)); c3 = c3.and(LIMB_MASK); a0 = (IntVector) c0.cast(intSpecies); @@ -381,14 +381,14 @@ IntVector in0 = (IntVector) inAlign0.and(LIMB_MASK).cast(intSpecies); IntVector in1 = (IntVector) - inAlign0.shiftR(26).and(LIMB_MASK).cast(intSpecies); + inAlign0.shiftRight(26).and(LIMB_MASK).cast(intSpecies); IntVector in2 = (IntVector) - inAlign0.shiftR(52).and(0xFFF).cast(intSpecies); - in2 = in2.or(inAlign1.and(0x3FFF).shiftL(12).cast(intSpecies)); + inAlign0.shiftRight(52).and(0xFFF).cast(intSpecies); + in2 = in2.or(inAlign1.and(0x3FFF).shiftLeft(12).cast(intSpecies)); IntVector in3 = (IntVector) - inAlign1.shiftR(14).and(LIMB_MASK).cast(intSpecies); + inAlign1.shiftRight(14).and(LIMB_MASK).cast(intSpecies); IntVector in4 = (IntVector) - inAlign1.shiftR(40).and(0xFFFFFF).cast(intSpecies); + inAlign1.shiftRight(40).and(0xFFFFFF).cast(intSpecies); in4 = in4.or(1 << 24); a0 = a0.add(in0); @@ -437,17 +437,17 @@ .add(a3.cast(longSpecies).mul(rFin1)) .add(a4.cast(longSpecies).mul(rFin0)); - c4 = c4.add(c3.shiftR(BITS_PER_LIMB)); + c4 = c4.add(c3.shiftRight(BITS_PER_LIMB)); c3 = c3.and(LIMB_MASK); - c0 = c0.add(c4.shiftR(BITS_PER_LIMB).mul(5)); + c0 = c0.add(c4.shiftRight(BITS_PER_LIMB).mul(5)); c4 = c4.and(LIMB_MASK); - c1 = c1.add(c0.shiftR(BITS_PER_LIMB)); + c1 = c1.add(c0.shiftRight(BITS_PER_LIMB)); c0 = c0.and(LIMB_MASK); - c2 = c2.add(c1.shiftR(BITS_PER_LIMB)); + c2 = c2.add(c1.shiftRight(BITS_PER_LIMB)); c1 = c1.and(LIMB_MASK); - c3 = c3.add(c2.shiftR(BITS_PER_LIMB)); + c3 = c3.add(c2.shiftRight(BITS_PER_LIMB)); c2 = c2.and(LIMB_MASK); - c4 = c4.add(c3.shiftR(BITS_PER_LIMB)); + c4 = c4.add(c3.shiftRight(BITS_PER_LIMB)); c3 = c3.and(LIMB_MASK); a0 = (IntVector) c0.cast(intSpecies); @@ -457,11 +457,11 @@ a4 = (IntVector) c4.cast(intSpecies); // collect lanes and calculate tag - long a0Fin = a0.addAll(); - long a1Fin = a1.addAll(); - long a2Fin = a2.addAll(); - long a3Fin = a3.addAll(); - long a4Fin = a4.addAll(); + long a0Fin = a0.addLanes(); + long a1Fin = a1.addLanes(); + long a2Fin = a2.addLanes(); + long a3Fin = a3.addLanes(); + long a4Fin = a4.addLanes(); // carry/reduce the result a4Fin = a4Fin + (a3Fin >>> BITS_PER_LIMB); --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/AbstractVectorBenchmark.java 2019-04-26 14:54:55.082423300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/AbstractVectorBenchmark.java 2019-04-26 14:54:54.473103200 -0700 @@ -28,8 +28,9 @@ import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.LongVector; import jdk.incubator.vector.Vector; -import jdk.incubator.vector.Vector.Shape; -import jdk.incubator.vector.Vector.Species; +import jdk.incubator.vector.VectorShape; +import jdk.incubator.vector.VectorSpecies; +import jdk.incubator.vector.VectorMask; import java.util.Random; import java.util.function.IntFunction; @@ -37,78 +38,78 @@ public class AbstractVectorBenchmark { static final Random RANDOM = new Random(Integer.getInteger("jdk.incubator.vector.random-seed", 1337)); - static final Species B64 = ByteVector.SPECIES_64; - static final Species B128 = ByteVector.SPECIES_128; - static final Species B256 = ByteVector.SPECIES_256; - static final Species B512 = ByteVector.SPECIES_512; - - static final Species S64 = ShortVector.SPECIES_64; - static final Species S128 = ShortVector.SPECIES_128; - static final Species S256 = ShortVector.SPECIES_256; - static final Species S512 = ShortVector.SPECIES_512; - - static final Species I64 = IntVector.SPECIES_64; - static final Species I128 = IntVector.SPECIES_128; - static final Species I256 = IntVector.SPECIES_256; - static final Species I512 = IntVector.SPECIES_512; - - static final Species L64 = LongVector.SPECIES_64; - static final Species L128 = LongVector.SPECIES_128; - static final Species L256 = LongVector.SPECIES_256; - static final Species L512 = LongVector.SPECIES_512; + static final VectorSpecies B64 = ByteVector.SPECIES_64; + static final VectorSpecies B128 = ByteVector.SPECIES_128; + static final VectorSpecies B256 = ByteVector.SPECIES_256; + static final VectorSpecies B512 = ByteVector.SPECIES_512; + + static final VectorSpecies S64 = ShortVector.SPECIES_64; + static final VectorSpecies S128 = ShortVector.SPECIES_128; + static final VectorSpecies S256 = ShortVector.SPECIES_256; + static final VectorSpecies S512 = ShortVector.SPECIES_512; + + static final VectorSpecies I64 = IntVector.SPECIES_64; + static final VectorSpecies I128 = IntVector.SPECIES_128; + static final VectorSpecies I256 = IntVector.SPECIES_256; + static final VectorSpecies I512 = IntVector.SPECIES_512; + + static final VectorSpecies L64 = LongVector.SPECIES_64; + static final VectorSpecies L128 = LongVector.SPECIES_128; + static final VectorSpecies L256 = LongVector.SPECIES_256; + static final VectorSpecies L512 = LongVector.SPECIES_512; - static Shape widen(Shape s) { + static VectorShape widen(VectorShape s) { switch (s) { - case S_64_BIT: return Shape.S_128_BIT; - case S_128_BIT: return Shape.S_256_BIT; - case S_256_BIT: return Shape.S_512_BIT; + case S_64_BIT: return VectorShape.S_128_BIT; + case S_128_BIT: return VectorShape.S_256_BIT; + case S_256_BIT: return VectorShape.S_512_BIT; default: throw new IllegalArgumentException("" + s); } } - static Shape narrow(Shape s) { + static VectorShape narrow(VectorShape s) { switch (s) { - case S_512_BIT: return Shape.S_256_BIT; - case S_256_BIT: return Shape.S_128_BIT; - case S_128_BIT: return Shape.S_64_BIT; + case S_512_BIT: return VectorShape.S_256_BIT; + case S_256_BIT: return VectorShape.S_128_BIT; + case S_128_BIT: return VectorShape.S_64_BIT; default: throw new IllegalArgumentException("" + s); } } - static Species widen(Species s) { - return Vector.Species.of(s.elementType(), widen(s.shape())); + static VectorSpecies widen(VectorSpecies s) { + return VectorSpecies.of(s.elementType(), widen(s.shape())); } - static Species narrow(Species s) { - return Vector.Species.of(s.elementType(), narrow(s.shape())); + static VectorSpecies narrow(VectorSpecies s) { + return VectorSpecies.of(s.elementType(), narrow(s.shape())); } - static IntVector join(Species from, Species to, IntVector lo, IntVector hi) { + static IntVector join(VectorSpecies from, VectorSpecies to, IntVector lo, IntVector hi) { assert 2 * from.length() == to.length(); int vlen = from.length(); var lo_mask = mask(from, to, 0); var v1 = lo.reshape(to); - var v2 = hi.reshape(to).shiftER(vlen); + var v2 = hi.reshape(to).shiftLanesRight(vlen); var r = v2.blend(v1, lo_mask); return r; } - static Vector.Mask mask(Species from, Species to, int i) { + static VectorMask mask(VectorSpecies from, VectorSpecies to, int i) { int vlen = from.length(); var v1 = IntVector.broadcast(from, 1); // [1 1 ... 1] var v2 = v1.reshape(to); // [0 0 ... 0 | ... | 1 1 ... 1] - var v3 = v2.shiftER(i * vlen); // [0 0 ... 0 | 1 1 ... 1 | 0 0 ... 0] + var v3 = v2.shiftLanesRight(i * vlen); // [0 0 ... 0 | 1 1 ... 1 | 0 0 ... 0] return v3.notEqual(0); // [F F ... F | T T ... T | F F ... F] } static IntVector sum(ByteVector va) { - Species species = Species.of(Integer.class, va.shape()); + VectorSpecies species = VectorSpecies.of(Integer.class, va.shape()); var acc = IntVector.zero(species); int limit = va.length() / species.length(); for (int k = 0; k < limit; k++) { - var vb = ((IntVector)(va.shiftEL(k * B64.length()).reshape(B64).cast(species))).and(0xFF); + var vb = ((IntVector)(va.shiftLanesLeft(k * B64.length()).reshape(B64).cast(species))).and(0xFF); acc = acc.add(vb); } return acc; --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte128Vector.java 2019-04-26 14:54:59.739721000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte128Vector.java 2019-04-26 14:54:59.149358500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -319,9 +320,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,7 +409,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -338,7 +417,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -348,7 +428,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -358,7 +438,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -367,8 +448,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -376,7 +461,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -386,7 +471,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -396,7 +481,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -405,8 +490,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -414,7 +503,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -424,7 +513,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -434,7 +523,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -447,6 +536,44 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + @Benchmark public void max(Blackhole bh) { @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte256Vector.java 2019-04-26 14:55:04.284138300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte256Vector.java 2019-04-26 14:55:03.695540100 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -319,9 +320,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,7 +409,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -338,7 +417,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -348,7 +428,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -358,7 +438,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -367,8 +448,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -376,7 +461,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -386,7 +471,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -396,7 +481,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -405,8 +490,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -414,7 +503,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -424,7 +513,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -434,7 +523,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -447,6 +536,44 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + @Benchmark public void max(Blackhole bh) { @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte512Vector.java 2019-04-26 14:55:08.942202500 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte512Vector.java 2019-04-26 14:55:08.340769200 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -319,9 +320,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,7 +409,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -338,7 +417,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -348,7 +428,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -358,7 +438,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -367,8 +448,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -376,7 +461,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -386,7 +471,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -396,7 +481,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -405,8 +490,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -414,7 +503,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -424,7 +513,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -434,7 +523,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -447,6 +536,44 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + @Benchmark public void max(Blackhole bh) { @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte64Vector.java 2019-04-26 14:55:13.586592000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Byte64Vector.java 2019-04-26 14:55:12.988910600 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -319,9 +320,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,7 +409,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -338,7 +417,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -348,7 +428,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -358,7 +438,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -367,8 +448,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -376,7 +461,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -386,7 +471,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -396,7 +481,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -405,8 +490,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -414,7 +503,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -424,7 +513,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -434,7 +523,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -447,6 +536,44 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + @Benchmark public void max(Blackhole bh) { @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ByteMaxVector.java 2019-04-26 14:55:18.231128400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ByteMaxVector.java 2019-04-26 14:55:17.610377800 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -319,9 +320,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,7 +409,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -338,7 +417,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -348,7 +428,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -358,7 +438,8 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + ByteVector bv = ByteVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -367,8 +448,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -376,7 +461,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -386,7 +471,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -396,7 +481,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -405,8 +490,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -414,7 +503,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -424,7 +513,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte[] b = fb.apply(SPECIES.length()); byte[] r = fr.apply(SPECIES.length()); @@ -434,7 +523,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -447,6 +536,44 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] a = fa.apply(SPECIES.length()); + byte[] b = fb.apply(SPECIES.length()); + byte[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < a.length; i += SPECIES.length()) { + ByteVector av = ByteVector.fromArray(SPECIES, a, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + @Benchmark public void max(Blackhole bh) { @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Byte.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.min(ra, av.minAll()); + ra = (byte)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] a = fa.apply(SPECIES.length()); byte ra = Byte.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Byte.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ByteVector av = ByteVector.fromArray(SPECIES, a, i); - ra = (byte)Math.max(ra, av.maxAll()); + ra = (byte)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ byte[] a = fa.apply(size); byte[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ByteScalar.java 2019-04-26 14:55:22.878066500 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ByteScalar.java 2019-04-26 14:55:22.257265800 -0700 @@ -319,18 +319,54 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + rs[i] = (byte)((a << (b & 0x7))); + } + } + bh.consume(rs); + } + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + if (ms[i % ms.length]) { + rs[i] = (byte)((a << (b & 0x7))); + } else { + rs[i] = a; + } + } + } + bh.consume(rs); + } + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftRight(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -339,7 +375,7 @@ for (int i = 0; i < as.length; i++) { byte a = as[i]; byte b = bs[i]; - rs[i] = (byte)((a >> (b & 7))); + rs[i] = (byte)((a >>> (b & 0x7))); } } @@ -349,7 +385,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -359,8 +395,33 @@ for (int i = 0; i < as.length; i++) { byte a = as[i]; byte b = bs[i]; - boolean m = ms[i % ms.length]; - rs[i] = (m ? (byte)((a >> (b & 7))) : a); + if (ms[i % ms.length]) { + rs[i] = (byte)((a >>> (b & 0x7))); + } else { + rs[i] = a; + } + } + } + bh.consume(rs); + } + + + + + + + + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + rs[i] = (byte)((a >> (b & 0x7))); } } @@ -370,7 +431,34 @@ @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + if (ms[i % ms.length]) { + rs[i] = (byte)((a >> (b & 0x7))); + } else { + rs[i] = a; + } + } + } + bh.consume(rs); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -389,7 +477,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -409,8 +497,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -429,7 +521,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { byte[] as = fa.apply(size); byte[] bs = fb.apply(size); byte[] rs = fr.apply(size); @@ -453,6 +545,46 @@ + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + rs[i] = (byte)((a >> (b & 7))); + } + } + + bh.consume(rs); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + byte[] as = fa.apply(size); + byte[] bs = fb.apply(size); + byte[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + byte a = as[i]; + byte b = bs[i]; + boolean m = ms[i % ms.length]; + rs[i] = (m ? (byte)((a >> (b & 7))) : a); + } + } + + bh.consume(rs); + } + + + @Benchmark public void max(Blackhole bh) { @@ -490,7 +622,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = -1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -505,7 +637,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -520,7 +652,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -534,7 +666,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -547,7 +679,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -560,7 +692,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = Byte.MAX_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -573,7 +705,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { byte[] as = fa.apply(size); byte r = Byte.MIN_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double128Vector.java 2019-04-26 14:55:27.619905800 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double128Vector.java 2019-04-26 14:55:27.032023000 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double256Vector.java 2019-04-26 14:55:32.234673700 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double256Vector.java 2019-04-26 14:55:31.619960400 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double512Vector.java 2019-04-26 14:55:36.927632400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double512Vector.java 2019-04-26 14:55:36.324858100 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double64Vector.java 2019-04-26 14:55:41.496299800 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Double64Vector.java 2019-04-26 14:55:40.909748700 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleMaxVector.java 2019-04-26 14:55:46.113315200 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleMaxVector.java 2019-04-26 14:55:45.530611100 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Double.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.min(ra, av.minAll()); + ra = (double)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] a = fa.apply(SPECIES.length()); double ra = Double.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Double.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { DoubleVector av = DoubleVector.fromArray(SPECIES, a, i); - ra = (double)Math.max(ra, av.maxAll()); + ra = (double)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ double[] a = fa.apply(size); double[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java 2019-04-26 14:55:50.828903300 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/DoubleScalar.java 2019-04-26 14:55:50.225877400 -0700 @@ -260,6 +260,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { double[] as = fa.apply(size); @@ -298,7 +310,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { double[] as = fa.apply(size); double r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -311,7 +323,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { double[] as = fa.apply(size); double r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -324,7 +336,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { double[] as = fa.apply(size); double r = Double.POSITIVE_INFINITY; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -337,7 +349,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { double[] as = fa.apply(size); double r = Double.NEGATIVE_INFINITY; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float128Vector.java 2019-04-26 14:55:55.379381100 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float128Vector.java 2019-04-26 14:55:54.757334300 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float256Vector.java 2019-04-26 14:56:00.033522100 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float256Vector.java 2019-04-26 14:55:59.458800500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float512Vector.java 2019-04-26 14:56:04.546793500 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float512Vector.java 2019-04-26 14:56:03.970862300 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float64Vector.java 2019-04-26 14:56:09.193011400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Float64Vector.java 2019-04-26 14:56:08.599356300 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatMaxVector.java 2019-04-26 14:56:13.729152600 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatMaxVector.java 2019-04-26 14:56:13.143710500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -264,6 +265,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); @@ -302,7 +315,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 0; @@ -310,14 +323,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = 1; @@ -325,14 +338,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.POSITIVE_INFINITY; @@ -340,14 +353,14 @@ ra = Float.POSITIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.min(ra, av.minAll()); + ra = (float)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] a = fa.apply(SPECIES.length()); float ra = Float.NEGATIVE_INFINITY; @@ -355,7 +368,7 @@ ra = Float.NEGATIVE_INFINITY; for (int i = 0; i < a.length; i += SPECIES.length()) { FloatVector av = FloatVector.fromArray(SPECIES, a, i); - ra = (float)Math.max(ra, av.maxAll()); + ra = (float)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -383,7 +396,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -403,7 +416,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -423,7 +436,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -443,7 +456,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -463,7 +476,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -483,7 +496,7 @@ float[] a = fa.apply(size); float[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatScalar.java 2019-04-26 14:56:18.341487000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/FloatScalar.java 2019-04-26 14:56:17.760490700 -0700 @@ -260,6 +260,18 @@ + + + + + + + + + + + + @Benchmark public void max(Blackhole bh) { float[] as = fa.apply(size); @@ -298,7 +310,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { float[] as = fa.apply(size); float r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -311,7 +323,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { float[] as = fa.apply(size); float r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -324,7 +336,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { float[] as = fa.apply(size); float r = Float.POSITIVE_INFINITY; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -337,7 +349,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { float[] as = fa.apply(size); float r = Float.NEGATIVE_INFINITY; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int128Vector.java 2019-04-26 14:56:22.917321200 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int128Vector.java 2019-04-26 14:56:22.272708400 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int256Vector.java 2019-04-26 14:56:27.656315000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int256Vector.java 2019-04-26 14:56:27.064604800 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int512Vector.java 2019-04-26 14:56:32.247327400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int512Vector.java 2019-04-26 14:56:31.624356000 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int64Vector.java 2019-04-26 14:56:36.934904100 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Int64Vector.java 2019-04-26 14:56:36.343471600 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/IntMaxVector.java 2019-04-26 14:56:41.413799400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/IntMaxVector.java 2019-04-26 14:56:40.823458200 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); IntVector bv = IntVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int[] b = fb.apply(SPECIES.length()); int[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Integer.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.min(ra, av.minAll()); + ra = (int)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] a = fa.apply(SPECIES.length()); int ra = Integer.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Integer.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { IntVector av = IntVector.fromArray(SPECIES, a, i); - ra = (int)Math.max(ra, av.maxAll()); + ra = (int)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ int[] a = fa.apply(size); int[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/IntScalar.java 2019-04-26 14:56:46.058437700 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/IntScalar.java 2019-04-26 14:56:45.456873300 -0700 @@ -318,7 +318,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -327,7 +327,7 @@ for (int i = 0; i < as.length; i++) { int a = as[i]; int b = bs[i]; - rs[i] = (int)((a >>> b)); + rs[i] = (int)((a << b)); } } @@ -337,7 +337,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -348,7 +348,7 @@ int a = as[i]; int b = bs[i]; if (ms[i % ms.length]) { - rs[i] = (int)((a >>> b)); + rs[i] = (int)((a << b)); } else { rs[i] = a; } @@ -359,8 +359,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -369,7 +373,7 @@ for (int i = 0; i < as.length; i++) { int a = as[i]; int b = bs[i]; - rs[i] = (int)((a << b)); + rs[i] = (int)((a >>> b)); } } @@ -379,7 +383,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -390,7 +394,7 @@ int a = as[i]; int b = bs[i]; if (ms[i % ms.length]) { - rs[i] = (int)((a << b)); + rs[i] = (int)((a >>> b)); } else { rs[i] = a; } @@ -401,8 +405,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -421,7 +429,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -443,8 +451,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -453,7 +465,7 @@ for (int i = 0; i < as.length; i++) { int a = as[i]; int b = bs[i]; - rs[i] = (int)((a >> b)); + rs[i] = (int)((a << b)); } } @@ -463,7 +475,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -474,7 +486,7 @@ int a = as[i]; int b = bs[i]; boolean m = ms[i % ms.length]; - rs[i] = (m ? (int)((a >> b)) : a); + rs[i] = (m ? (int)((a << b)) : a); } } @@ -483,8 +495,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -503,7 +519,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -523,8 +539,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -533,7 +553,7 @@ for (int i = 0; i < as.length; i++) { int a = as[i]; int b = bs[i]; - rs[i] = (int)((a << b)); + rs[i] = (int)((a >> b)); } } @@ -543,7 +563,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { int[] as = fa.apply(size); int[] bs = fb.apply(size); int[] rs = fr.apply(size); @@ -554,7 +574,7 @@ int a = as[i]; int b = bs[i]; boolean m = ms[i % ms.length]; - rs[i] = (m ? (int)((a << b)) : a); + rs[i] = (m ? (int)((a >> b)) : a); } } @@ -566,14 +586,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { int[] as = fa.apply(size); @@ -610,7 +622,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { int[] as = fa.apply(size); int r = -1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -625,7 +637,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { int[] as = fa.apply(size); int r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -640,7 +652,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { int[] as = fa.apply(size); int r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -654,7 +666,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { int[] as = fa.apply(size); int r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -667,7 +679,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { int[] as = fa.apply(size); int r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -680,7 +692,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { int[] as = fa.apply(size); int r = Integer.MAX_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -693,7 +705,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { int[] as = fa.apply(size); int r = Integer.MIN_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long128Vector.java 2019-04-26 14:56:50.597208200 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long128Vector.java 2019-04-26 14:56:50.003960900 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long256Vector.java 2019-04-26 14:56:55.129501000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long256Vector.java 2019-04-26 14:56:54.527769600 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long512Vector.java 2019-04-26 14:56:59.661532900 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long512Vector.java 2019-04-26 14:56:59.042133500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long64Vector.java 2019-04-26 14:57:04.154021800 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Long64Vector.java 2019-04-26 14:57:03.558867000 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/LongMaxVector.java 2019-04-26 14:57:08.797279100 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/LongMaxVector.java 2019-04-26 14:57:08.213819300 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -318,7 +319,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -327,7 +328,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv).intoArray(r, i); + av.shiftLeft(bv).intoArray(r, i); } } @@ -337,7 +338,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -348,7 +349,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftR(bv, vmask).intoArray(r, i); + av.shiftLeft(bv, vmask).intoArray(r, i); } } @@ -357,8 +358,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -367,7 +372,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv).intoArray(r, i); + av.shiftRight(bv).intoArray(r, i); } } @@ -377,7 +382,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -388,7 +393,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.shiftL(bv, vmask).intoArray(r, i); + av.shiftRight(bv, vmask).intoArray(r, i); } } @@ -397,8 +402,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -407,7 +416,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv).intoArray(r, i); + av.shiftArithmeticRight(bv).intoArray(r, i); } } @@ -417,7 +426,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -428,7 +437,7 @@ for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); LongVector bv = LongVector.fromArray(SPECIES, b, i); - av.aShiftR(bv, vmask).intoArray(r, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); } } @@ -437,8 +446,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -446,7 +459,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i]).intoArray(r, i); + av.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -456,7 +469,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -466,7 +479,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -475,8 +488,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -484,7 +501,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -494,7 +511,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -504,7 +521,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -513,8 +530,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -522,7 +543,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -532,7 +553,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long[] b = fb.apply(SPECIES.length()); long[] r = fr.apply(SPECIES.length()); @@ -542,7 +563,7 @@ for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - av.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -554,14 +575,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); @@ -598,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = -1; @@ -606,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -615,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -623,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -632,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -640,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -648,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 0; @@ -656,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = 1; @@ -671,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MAX_VALUE; @@ -686,14 +699,14 @@ ra = Long.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.min(ra, av.minAll()); + ra = (long)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] a = fa.apply(SPECIES.length()); long ra = Long.MIN_VALUE; @@ -701,7 +714,7 @@ ra = Long.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { LongVector av = LongVector.fromArray(SPECIES, a, i); - ra = (long)Math.max(ra, av.maxAll()); + ra = (long)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -761,7 +774,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -781,7 +794,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -801,7 +814,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -821,7 +834,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -841,7 +854,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -861,7 +874,7 @@ long[] a = fa.apply(size); long[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/LongScalar.java 2019-04-26 14:57:13.534850400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/LongScalar.java 2019-04-26 14:57:12.924798700 -0700 @@ -318,7 +318,7 @@ @Benchmark - public void shiftR(Blackhole bh) { + public void shiftLeft(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -327,7 +327,7 @@ for (int i = 0; i < as.length; i++) { long a = as[i]; long b = bs[i]; - rs[i] = (long)((a >>> b)); + rs[i] = (long)((a << b)); } } @@ -337,7 +337,7 @@ @Benchmark - public void shiftRMasked(Blackhole bh) { + public void shiftLeftMasked(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -348,7 +348,7 @@ long a = as[i]; long b = bs[i]; if (ms[i % ms.length]) { - rs[i] = (long)((a >>> b)); + rs[i] = (long)((a << b)); } else { rs[i] = a; } @@ -359,8 +359,12 @@ + + + + @Benchmark - public void shiftL(Blackhole bh) { + public void shiftRight(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -369,7 +373,7 @@ for (int i = 0; i < as.length; i++) { long a = as[i]; long b = bs[i]; - rs[i] = (long)((a << b)); + rs[i] = (long)((a >>> b)); } } @@ -379,7 +383,7 @@ @Benchmark - public void shiftLMasked(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -390,7 +394,7 @@ long a = as[i]; long b = bs[i]; if (ms[i % ms.length]) { - rs[i] = (long)((a << b)); + rs[i] = (long)((a >>> b)); } else { rs[i] = a; } @@ -401,8 +405,12 @@ + + + + @Benchmark - public void aShiftR(Blackhole bh) { + public void shiftArithmeticRight(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -421,7 +429,7 @@ @Benchmark - public void aShiftRMasked(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -443,8 +451,12 @@ + + + + @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -453,7 +465,7 @@ for (int i = 0; i < as.length; i++) { long a = as[i]; long b = bs[i]; - rs[i] = (long)((a >> b)); + rs[i] = (long)((a << b)); } } @@ -463,7 +475,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -474,7 +486,7 @@ long a = as[i]; long b = bs[i]; boolean m = ms[i % ms.length]; - rs[i] = (m ? (long)((a >> b)) : a); + rs[i] = (m ? (long)((a << b)) : a); } } @@ -483,8 +495,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -503,7 +519,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -523,8 +539,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -533,7 +553,7 @@ for (int i = 0; i < as.length; i++) { long a = as[i]; long b = bs[i]; - rs[i] = (long)((a << b)); + rs[i] = (long)((a >> b)); } } @@ -543,7 +563,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { long[] as = fa.apply(size); long[] bs = fb.apply(size); long[] rs = fr.apply(size); @@ -554,7 +574,7 @@ long a = as[i]; long b = bs[i]; boolean m = ms[i % ms.length]; - rs[i] = (m ? (long)((a << b)) : a); + rs[i] = (m ? (long)((a >> b)) : a); } } @@ -566,14 +586,6 @@ - - - - - - - - @Benchmark public void max(Blackhole bh) { long[] as = fa.apply(size); @@ -610,7 +622,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { long[] as = fa.apply(size); long r = -1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -625,7 +637,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { long[] as = fa.apply(size); long r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -640,7 +652,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { long[] as = fa.apply(size); long r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -654,7 +666,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { long[] as = fa.apply(size); long r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -667,7 +679,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { long[] as = fa.apply(size); long r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -680,7 +692,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { long[] as = fa.apply(size); long r = Long.MAX_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -693,7 +705,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { long[] as = fa.apply(size); long r = Long.MIN_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Merge.java 2019-04-26 14:57:18.081850900 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Merge.java 2019-04-26 14:57:17.472240500 -0700 @@ -25,7 +25,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.*; -import jdk.incubator.vector.Vector.Species; +import jdk.incubator.vector.VectorSpecies; import org.openjdk.jmh.annotations.*; import java.util.concurrent.TimeUnit; @@ -85,7 +85,7 @@ merge(I64, I256); } - IntVector merge(Species from, Species to, int idx) { + IntVector merge(VectorSpecies from, VectorSpecies to, int idx) { assert from.length() <= to.length(); int vlenFrom = from.length(); @@ -103,7 +103,7 @@ } - void merge(Species from, Species to) { + void merge(VectorSpecies from, VectorSpecies to) { int vlenTo = to.length(); for (int i = 0; i < in.length; i += vlenTo) { var r = merge(from, to, i); --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/PopulationCount.java 2019-04-26 14:57:22.625892600 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/PopulationCount.java 2019-04-26 14:57:21.999525900 -0700 @@ -28,7 +28,7 @@ import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.IntVector; import jdk.incubator.vector.LongVector; -import jdk.incubator.vector.Vector.Species; +import jdk.incubator.vector.VectorSpecies; import org.openjdk.jmh.annotations.*; import java.util.concurrent.TimeUnit; @@ -350,7 +350,7 @@ var low_mask = ByteVector.broadcast(B128, (byte)0x0f); var lo = v .and(low_mask); - var hi = v.shiftR(4).and(low_mask); + var hi = v.shiftRight(4).and(low_mask); var cnt1 = MULA128_LOOKUP.rearrange(lo.toShuffle()); var cnt2 = MULA128_LOOKUP.rearrange(hi.toShuffle()); @@ -373,7 +373,7 @@ } acc = acc.add(sumUnsignedBytes(bacc)); } - var r = acc.addAll() + tail(upper); + var r = acc.addLanes() + tail(upper); return r; } @@ -390,7 +390,7 @@ var low_mask = ByteVector.broadcast(B256, (byte)0x0F); var lo = v .and(low_mask); - var hi = v.shiftR(4).and(low_mask); + var hi = v.shiftRight(4).and(low_mask); var cnt1 = MULA256_LOOKUP.rearrange(lo.toShuffle()); var cnt2 = MULA256_LOOKUP.rearrange(hi.toShuffle()); @@ -408,9 +408,9 @@ } LongVector sumUnsignedBytesShapes(ByteVector vb) { - Species shortSpecies = Species.of(short.class, vb.shape()); - Species intSpecies = Species.of(int.class, vb.shape()); - Species longSpecies = Species.of(long.class, vb.shape()); + VectorSpecies shortSpecies = VectorSpecies.of(short.class, vb.shape()); + VectorSpecies intSpecies = VectorSpecies.of(int.class, vb.shape()); + VectorSpecies longSpecies = VectorSpecies.of(long.class, vb.shape()); var low_short_mask = ShortVector.broadcast(shortSpecies, (short) 0xFF); var low_int_mask = IntVector.broadcast(intSpecies, 0xFFFF); @@ -418,37 +418,37 @@ var vs = (ShortVector)vb.reinterpret(shortSpecies); // 16-bit var vs0 = vs.and(low_short_mask); - var vs1 = vs.shiftR(8).and(low_short_mask); + var vs1 = vs.shiftRight(8).and(low_short_mask); var vs01 = vs0.add(vs1); var vi = (IntVector)vs01.reinterpret(intSpecies); // 32-bit var vi0 = vi.and(low_int_mask); - var vi1 = vi.shiftR(16).and(low_int_mask); + var vi1 = vi.shiftRight(16).and(low_int_mask); var vi01 = vi0.add(vi1); var vl = (LongVector)vi01.reinterpret(longSpecies); // 64-bit var vl0 = vl.and(low_long_mask); - var vl1 = vl.shiftR(32).and(low_long_mask); + var vl1 = vl.shiftRight(32).and(low_long_mask); var vl01 = vl0.add(vl1); return vl01; } LongVector sumUnsignedBytesShifts(ByteVector vb) { - Species to = Species.of(long.class, vb.shape()); + VectorSpecies to = VectorSpecies.of(long.class, vb.shape()); var low_mask = LongVector.broadcast(to, 0xFF); var vl = (LongVector)vb.reinterpret(to); var v0 = vl .and(low_mask); // 8-bit - var v1 = vl.shiftR( 8).and(low_mask); // 8-bit - var v2 = vl.shiftR(16).and(low_mask); // 8-bit - var v3 = vl.shiftR(24).and(low_mask); // 8-bit - var v4 = vl.shiftR(32).and(low_mask); // 8-bit - var v5 = vl.shiftR(40).and(low_mask); // 8-bit - var v6 = vl.shiftR(48).and(low_mask); // 8-bit - var v7 = vl.shiftR(56).and(low_mask); // 8-bit + var v1 = vl.shiftRight( 8).and(low_mask); // 8-bit + var v2 = vl.shiftRight(16).and(low_mask); // 8-bit + var v3 = vl.shiftRight(24).and(low_mask); // 8-bit + var v4 = vl.shiftRight(32).and(low_mask); // 8-bit + var v5 = vl.shiftRight(40).and(low_mask); // 8-bit + var v6 = vl.shiftRight(48).and(low_mask); // 8-bit + var v7 = vl.shiftRight(56).and(low_mask); // 8-bit var v01 = v0.add(v1); var v23 = v2.add(v3); @@ -476,7 +476,7 @@ } acc = acc.add(sumUnsignedBytes(bacc)); } - return acc.addAll() + tail(upper); + return acc.addLanes() + tail(upper); } @@ -614,7 +614,7 @@ vtotal = vtotal.add(popcntL256(twos).mul(2)); // << 1 vtotal = vtotal.add(popcntL256(ones)); // << 0 - var total = vtotal.addAll(); + var total = vtotal.addLanes(); return total + tail(upper); } --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short128Vector.java 2019-04-26 14:57:27.015729700 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short128Vector.java 2019-04-26 14:57:26.418019500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -321,8 +322,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,21 +410,60 @@ + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); + } + } + bh.consume(r); + } @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -354,7 +473,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -364,7 +483,7 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -373,8 +492,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -382,7 +505,7 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -392,7 +515,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -402,7 +525,7 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -411,8 +534,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -420,7 +547,7 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -430,7 +557,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -440,7 +567,7 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short256Vector.java 2019-04-26 14:57:31.547881200 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short256Vector.java 2019-04-26 14:57:30.959380700 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -321,8 +322,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,21 +410,60 @@ + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); + } + } + bh.consume(r); + } @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -354,7 +473,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -364,7 +483,7 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -373,8 +492,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -382,7 +505,7 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -392,7 +515,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -402,7 +525,7 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -411,8 +534,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -420,7 +547,7 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -430,7 +557,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -440,7 +567,7 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short512Vector.java 2019-04-26 14:57:35.986652900 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short512Vector.java 2019-04-26 14:57:35.397206500 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -321,8 +322,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,21 +410,60 @@ + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); + } + } + bh.consume(r); + } @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -354,7 +473,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -364,7 +483,7 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -373,8 +492,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -382,7 +505,7 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -392,7 +515,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -402,7 +525,7 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -411,8 +534,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -420,7 +547,7 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -430,7 +557,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -440,7 +567,7 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short64Vector.java 2019-04-26 14:57:40.591715900 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/Short64Vector.java 2019-04-26 14:57:40.004252000 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -321,8 +322,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,21 +410,60 @@ + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); + } + } + bh.consume(r); + } @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -354,7 +473,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -364,7 +483,7 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -373,8 +492,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -382,7 +505,7 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -392,7 +515,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -402,7 +525,7 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -411,8 +534,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -420,7 +547,7 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -430,7 +557,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -440,7 +567,7 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ShortMaxVector.java 2019-04-26 14:57:45.149557400 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ShortMaxVector.java 2019-04-26 14:57:44.514912100 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle; @@ -321,8 +322,87 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftLeft(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + @Benchmark + public void shiftRightMasked(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.apply(SPECIES.length()); + short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); + 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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftRight(bv, vmask).intoArray(r, i); + } + } + bh.consume(r); + } @@ -330,21 +410,60 @@ + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv).intoArray(r, i); + } + } + bh.consume(r); + } @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftArithmeticRightMasked(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); + boolean[] mask = fm.apply(SPECIES.length()); + VectorMask vmask = VectorMask.fromValues(SPECIES, mask); 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.aShiftR((int)b[i]).intoArray(r, i); + ShortVector bv = ShortVector.fromArray(SPECIES, b, i); + av.shiftArithmeticRight(bv, vmask).intoArray(r, i); + } + } + + bh.consume(r); + } + + + + + + + + @Benchmark + public void shiftLeftShift(Blackhole bh) { + short[] a = fa.apply(SPECIES.length()); + short[] b = fb.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.shiftLeft((int)b[i]).intoArray(r, i); } } @@ -354,7 +473,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -364,7 +483,7 @@ 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.aShiftR((int)b[i], vmask).intoArray(r, i); + av.shiftLeft((int)b[i], vmask).intoArray(r, i); } } @@ -373,8 +492,12 @@ + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -382,7 +505,7 @@ 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.shiftL((int)b[i]).intoArray(r, i); + av.shiftRight((int)b[i]).intoArray(r, i); } } @@ -392,7 +515,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -402,7 +525,7 @@ 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.shiftL((int)b[i], vmask).intoArray(r, i); + av.shiftRight((int)b[i], vmask).intoArray(r, i); } } @@ -411,8 +534,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftArithmeticRightShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -420,7 +547,7 @@ 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.shiftR((int)b[i]).intoArray(r, i); + av.shiftArithmeticRight((int)b[i]).intoArray(r, i); } } @@ -430,7 +557,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftArithmeticRightMaskedShift(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short[] b = fb.apply(SPECIES.length()); short[] r = fr.apply(SPECIES.length()); @@ -440,7 +567,7 @@ 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.shiftR((int)b[i], vmask).intoArray(r, i); + av.shiftArithmeticRight((int)b[i], vmask).intoArray(r, i); } } @@ -484,7 +611,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = -1; @@ -492,7 +619,7 @@ ra = -1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra &= av.andAll(); + ra &= av.andLanes(); } } bh.consume(ra); @@ -501,7 +628,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -509,7 +636,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra |= av.orAll(); + ra |= av.orLanes(); } } bh.consume(ra); @@ -518,7 +645,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -526,7 +653,7 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra ^= av.xorAll(); + ra ^= av.xorLanes(); } } bh.consume(ra); @@ -534,7 +661,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 0; @@ -542,14 +669,14 @@ ra = 0; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra += av.addAll(); + ra += av.addLanes(); } } bh.consume(ra); } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = 1; @@ -557,14 +684,14 @@ ra = 1; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra *= av.mulAll(); + ra *= av.mulLanes(); } } bh.consume(ra); } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MAX_VALUE; @@ -572,14 +699,14 @@ ra = Short.MAX_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.min(ra, av.minAll()); + ra = (short)Math.min(ra, av.minLanes()); } } bh.consume(ra); } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] a = fa.apply(SPECIES.length()); short ra = Short.MIN_VALUE; @@ -587,7 +714,7 @@ ra = Short.MIN_VALUE; for (int i = 0; i < a.length; i += SPECIES.length()) { ShortVector av = ShortVector.fromArray(SPECIES, a, i); - ra = (short)Math.max(ra, av.maxAll()); + ra = (short)Math.max(ra, av.maxLanes()); } } bh.consume(ra); @@ -647,7 +774,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -667,7 +794,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -687,7 +814,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -707,7 +834,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -727,7 +854,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { @@ -747,7 +874,7 @@ short[] a = fa.apply(size); short[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ShortScalar.java 2019-04-26 14:57:49.758053000 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/ShortScalar.java 2019-04-26 14:57:49.151372500 -0700 @@ -321,13 +321,45 @@ + @Benchmark + public void shiftLeft(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + rs[i] = (short)((a << (b & 0xF))); + } + } + bh.consume(rs); + } + @Benchmark + public void shiftLeftMasked(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); - + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + if (ms[i % ms.length]) { + rs[i] = (short)((a << (b & 0xF))); + } else { + rs[i] = a; + } + } + } + bh.consume(rs); + } @@ -336,7 +368,7 @@ @Benchmark - public void aShiftRShift(Blackhole bh) { + public void shiftRight(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -345,7 +377,7 @@ for (int i = 0; i < as.length; i++) { short a = as[i]; short b = bs[i]; - rs[i] = (short)((a >> (b & 15))); + rs[i] = (short)((a >>> (b & 0xF))); } } @@ -355,7 +387,7 @@ @Benchmark - public void aShiftRMaskedShift(Blackhole bh) { + public void shiftRightMasked(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -365,18 +397,70 @@ for (int i = 0; i < as.length; i++) { short a = as[i]; short b = bs[i]; - boolean m = ms[i % ms.length]; - rs[i] = (m ? (short)((a >> (b & 15))) : a); + if (ms[i % ms.length]) { + rs[i] = (short)((a >>> (b & 0xF))); + } else { + rs[i] = a; + } } } + bh.consume(rs); + } + + + + + + + + @Benchmark + public void shiftArithmeticRight(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + rs[i] = (short)((a >> (b & 0xF))); + } + } + + bh.consume(rs); + } + + + + @Benchmark + public void shiftArithmeticRightMasked(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + if (ms[i % ms.length]) { + rs[i] = (short)((a >> (b & 0xF))); + } else { + rs[i] = a; + } + } + } bh.consume(rs); } + + + + @Benchmark - public void shiftLShift(Blackhole bh) { + public void shiftLeftShift(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -395,7 +479,7 @@ @Benchmark - public void shiftLMaskedShift(Blackhole bh) { + public void shiftLeftMaskedShift(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -415,8 +499,12 @@ + + + + @Benchmark - public void shiftRShift(Blackhole bh) { + public void shiftRightShift(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -435,7 +523,7 @@ @Benchmark - public void shiftRMaskedShift(Blackhole bh) { + public void shiftRightMaskedShift(Blackhole bh) { short[] as = fa.apply(size); short[] bs = fb.apply(size); short[] rs = fr.apply(size); @@ -454,6 +542,50 @@ } + + + + + + @Benchmark + public void shiftArithmeticRightShift(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + rs[i] = (short)((a >> (b & 15))); + } + } + + bh.consume(rs); + } + + + + @Benchmark + public void shiftArithmeticRightMaskedShift(Blackhole bh) { + short[] as = fa.apply(size); + short[] bs = fb.apply(size); + short[] rs = fr.apply(size); + boolean[] ms = fm.apply(size); + + for (int ic = 0; ic < INVOC_COUNT; ic++) { + for (int i = 0; i < as.length; i++) { + short a = as[i]; + short b = bs[i]; + boolean m = ms[i % ms.length]; + rs[i] = (m ? (short)((a >> (b & 15))) : a); + } + } + + bh.consume(rs); + } + + @Benchmark public void max(Blackhole bh) { short[] as = fa.apply(size); @@ -490,7 +622,7 @@ @Benchmark - public void andAll(Blackhole bh) { + public void andLanes(Blackhole bh) { short[] as = fa.apply(size); short r = -1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -505,7 +637,7 @@ @Benchmark - public void orAll(Blackhole bh) { + public void orLanes(Blackhole bh) { short[] as = fa.apply(size); short r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -520,7 +652,7 @@ @Benchmark - public void xorAll(Blackhole bh) { + public void xorLanes(Blackhole bh) { short[] as = fa.apply(size); short r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -534,7 +666,7 @@ @Benchmark - public void addAll(Blackhole bh) { + public void addLanes(Blackhole bh) { short[] as = fa.apply(size); short r = 0; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -547,7 +679,7 @@ } @Benchmark - public void mulAll(Blackhole bh) { + public void mulLanes(Blackhole bh) { short[] as = fa.apply(size); short r = 1; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -560,7 +692,7 @@ } @Benchmark - public void minAll(Blackhole bh) { + public void minLanes(Blackhole bh) { short[] as = fa.apply(size); short r = Short.MAX_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { @@ -573,7 +705,7 @@ } @Benchmark - public void maxAll(Blackhole bh) { + public void maxLanes(Blackhole bh) { short[] as = fa.apply(size); short r = Short.MIN_VALUE; for (int ic = 0; ic < INVOC_COUNT; ic++) { --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/SortVector.java 2019-04-26 14:57:54.269125600 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/SortVector.java 2019-04-26 14:57:53.676224100 -0700 @@ -26,8 +26,9 @@ import jdk.incubator.vector.IntVector; import jdk.incubator.vector.Vector; -import jdk.incubator.vector.Vector.Mask; -import jdk.incubator.vector.Vector.Species; +import jdk.incubator.vector.VectorMask; +import jdk.incubator.vector.VectorSpecies; +import jdk.incubator.vector.VectorShuffle; import org.openjdk.jmh.annotations.*; import java.util.concurrent.TimeUnit; @@ -76,8 +77,8 @@ } - void sort(Species spec) { - var iota = (IntVector) IntVector.shuffleIota(spec).toVector(); // [ 0 1 ... n ] + void sort(VectorSpecies spec) { + var iota = (IntVector) VectorShuffle.shuffleIota(spec).toVector(); // [ 0 1 ... n ] var result = IntVector.broadcast(spec, 0); var index = IntVector.broadcast(spec, 0); --- old/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/SumOfUnsignedBytes.java 2019-04-26 14:57:58.909731600 -0700 +++ new/test/jdk/jdk/incubator/vector/benchmark/src/main/java/benchmark/jdk/incubator/vector/SumOfUnsignedBytes.java 2019-04-26 14:57:58.321299900 -0700 @@ -80,11 +80,11 @@ var vb = ByteVector.fromArray(B256, data, i); var vi = (IntVector)vb.reinterpret(I256); for (int j = 0; j < 4; j++) { - var tj = vi.shiftR(j * 8).and(lobyte_mask); + var tj = vi.shiftRight(j * 8).and(lobyte_mask); acc = acc.add(tj); } } - return (int)Integer.toUnsignedLong(acc.addAll()); + return (int)Integer.toUnsignedLong(acc.addLanes()); } // 2. 16-bit accumulators @@ -98,15 +98,15 @@ var vb = ByteVector.fromArray(B256, data, i); var vs = (ShortVector)vb.reinterpret(S256); for (int j = 0; j < 2; j++) { - var tj = vs.shiftR(j * 8).and(lobyte_mask); + var tj = vs.shiftRight(j * 8).and(lobyte_mask); acc = acc.add(tj); } } int mid = S128.length(); var accLo = ((IntVector)(acc .reshape(S128).cast(I256))).and(0xFFFF); // low half as ints - var accHi = ((IntVector)(acc.shiftEL(mid).reshape(S128).cast(I256))).and(0xFFFF); // high half as ints - return accLo.addAll() + accHi.addAll(); + var accHi = ((IntVector)(acc.shiftLanesLeft(mid).reshape(S128).cast(I256))).and(0xFFFF); // high half as ints + return accLo.addLanes() + accHi.addLanes(); } /* --- old/test/jdk/jdk/incubator/vector/gen-template.sh 2019-04-26 14:58:03.408621300 -0700 +++ new/test/jdk/jdk/incubator/vector/gen-template.sh 2019-04-26 14:58:02.837776900 -0700 @@ -257,31 +257,37 @@ gen_binary_alu_op "xor" "a ^ b" $unit_output $perf_output $perf_scalar_output "BITWISE" # Shifts -gen_binary_alu_op "shiftR" "(a >>> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_binary_alu_op "shiftL" "(a << b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_binary_alu_op "aShiftR" "(a >> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_shift_cst_op "aShiftR" "(a >> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_shift_cst_op "shiftR" "(a >>> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_shift_cst_op "shiftL" "(a << b)" $unit_output $perf_output $perf_scalar_output "intOrLong" -gen_shift_cst_op "aShiftR" "(a >> (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" -gen_shift_cst_op "shiftL" "(a << (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" -gen_shift_cst_op "shiftR" "((a \& 0xFF) >>> (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" -gen_shift_cst_op "aShiftR" "(a >> (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" -gen_shift_cst_op "shiftL" "(a << (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" -gen_shift_cst_op "shiftR" "((a \& 0xFFFF) >>> (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" +gen_binary_alu_op "shiftLeft" "(a << b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_binary_alu_op "shiftLeft" "(a << (b \& 0x7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_binary_alu_op "shiftLeft" "(a << (b \& 0xF))" $unit_output $perf_output $perf_scalar_output "short" +gen_binary_alu_op "shiftRight" "(a >>> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_binary_alu_op "shiftRight" "(a >>> (b \& 0x7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_binary_alu_op "shiftRight" "(a >>> (b \& 0xF))" $unit_output $perf_output $perf_scalar_output "short" +gen_binary_alu_op "shiftArithmeticRight" "(a >> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_binary_alu_op "shiftArithmeticRight" "(a >> (b \& 0x7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_binary_alu_op "shiftArithmeticRight" "(a >> (b \& 0xF))" $unit_output $perf_output $perf_scalar_output "short" +gen_shift_cst_op "shiftLeft" "(a << b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_shift_cst_op "shiftLeft" "(a << (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_shift_cst_op "shiftLeft" "(a << (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" +gen_shift_cst_op "shiftRight" "(a >>> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_shift_cst_op "shiftRight" "((a \& 0xFF) >>> (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_shift_cst_op "shiftRight" "((a \& 0xFFFF) >>> (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" +gen_shift_cst_op "shiftArithmeticRight" "(a >> b)" $unit_output $perf_output $perf_scalar_output "intOrLong" +gen_shift_cst_op "shiftArithmeticRight" "(a >> (b \& 7))" $unit_output $perf_output $perf_scalar_output "byte" +gen_shift_cst_op "shiftArithmeticRight" "(a >> (b \& 15))" $unit_output $perf_output $perf_scalar_output "short" # Masked reductions. gen_binary_op "max" "Math.max(a, b)" $unit_output $perf_output $perf_scalar_output gen_binary_op "min" "Math.min(a, b)" $unit_output $perf_output $perf_scalar_output # Reductions. -gen_reduction_op "andAll" "\&" $unit_output $perf_output $perf_scalar_output "BITWISE" "-1" -gen_reduction_op "orAll" "|" $unit_output $perf_output $perf_scalar_output "BITWISE" "0" -gen_reduction_op "xorAll" "^" $unit_output $perf_output $perf_scalar_output "BITWISE" "0" -gen_reduction_op "addAll" "+" $unit_output $perf_output $perf_scalar_output "" "0" -gen_reduction_op "mulAll" "*" $unit_output $perf_output $perf_scalar_output "" "1" -gen_reduction_op_min "minAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MaxValue\$" -gen_reduction_op_max "maxAll" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MinValue\$" +gen_reduction_op "andLanes" "\&" $unit_output $perf_output $perf_scalar_output "BITWISE" "-1" +gen_reduction_op "orLanes" "|" $unit_output $perf_output $perf_scalar_output "BITWISE" "0" +gen_reduction_op "xorLanes" "^" $unit_output $perf_output $perf_scalar_output "BITWISE" "0" +gen_reduction_op "addLanes" "+" $unit_output $perf_output $perf_scalar_output "" "0" +gen_reduction_op "mulLanes" "*" $unit_output $perf_output $perf_scalar_output "" "1" +gen_reduction_op_min "minLanes" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MaxValue\$" +gen_reduction_op_max "maxLanes" "" $unit_output $perf_output $perf_scalar_output "" "\$Wideboxtype\$.\$MinValue\$" # Boolean reductions. --- old/test/jdk/jdk/incubator/vector/templates/Perf-Compare.template 2019-04-26 14:58:08.045295100 -0700 +++ new/test/jdk/jdk/incubator/vector/templates/Perf-Compare.template 2019-04-26 14:58:07.464836300 -0700 @@ -4,7 +4,7 @@ $type$[] a = fa.apply(size); $type$[] b = fb.apply(size); boolean[] ms = fm.apply(size); - VectorMask<$Wideboxtype$> m = VectorMask.maskFromArray(SPECIES, ms, 0); + VectorMask<$Wideboxtype$> m = VectorMask.fromArray(SPECIES, ms, 0); for (int ic = 0; ic < INVOC_COUNT; ic++) { for (int i = 0; i < a.length; i += SPECIES.length()) { --- old/test/jdk/jdk/incubator/vector/templates/Perf-header.template 2019-04-26 14:58:12.615361900 -0700 +++ new/test/jdk/jdk/incubator/vector/templates/Perf-header.template 2019-04-26 14:58:12.033162400 -0700 @@ -24,6 +24,7 @@ package benchmark.jdk.incubator.vector; import jdk.incubator.vector.Vector; +import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorShape; import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorShuffle;