--- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java 2019-04-15 14:43:45.767110100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java 2019-04-15 14:43:45.300907500 -0700 @@ -38,7 +38,7 @@ @SuppressWarnings("cast") final class ShortMaxVector extends ShortVector { - private static final Species SPECIES = ShortVector.SPECIES_MAX; + private static final VectorSpecies SPECIES = ShortVector.SPECIES_MAX; static final ShortMaxVector ZERO = new ShortMaxVector(); @@ -74,7 +74,7 @@ } @Override - ShortMaxVector uOp(Mask o, FUnOp f) { + ShortMaxVector uOp(VectorMask o, FUnOp f) { short[] vec = getElements(); short[] res = new short[length()]; boolean[] mbits = ((ShortMaxMask)o).getBits(); @@ -98,7 +98,7 @@ } @Override - ShortMaxVector bOp(Vector o1, Mask o2, FBinOp f) { + ShortMaxVector bOp(Vector o1, VectorMask o2, FBinOp f) { short[] res = new short[length()]; short[] vec1 = this.getElements(); short[] vec2 = ((ShortMaxVector)o1).getElements(); @@ -124,7 +124,7 @@ } @Override - ShortMaxVector tOp(Vector o1, Vector o2, Mask o3, FTriOp f) { + ShortMaxVector tOp(Vector o1, Vector o2, VectorMask o3, FTriOp f) { short[] res = new short[length()]; short[] vec1 = getElements(); short[] vec2 = ((ShortMaxVector)o1).getElements(); @@ -147,7 +147,7 @@ @Override @ForceInline - public Vector cast(Species s) { + public Vector cast(VectorSpecies s) { Objects.requireNonNull(s); if (s.length() != LENGTH) throw new IllegalArgumentException("Vector length this species length differ"); @@ -164,7 +164,7 @@ @SuppressWarnings("unchecked") @ForceInline - private Vector castDefault(Species s) { + private Vector castDefault(VectorSpecies s) { int limit = s.length(); Class stype = s.elementType(); @@ -173,37 +173,37 @@ for (int i = 0; i < limit; i++) { a[i] = (byte) this.get(i); } - return (Vector) ByteVector.fromArray((Species) s, a, 0); + return (Vector) ByteVector.fromArray((VectorSpecies) s, a, 0); } else if (stype == short.class) { short[] a = new short[limit]; for (int i = 0; i < limit; i++) { a[i] = (short) this.get(i); } - return (Vector) ShortVector.fromArray((Species) s, a, 0); + return (Vector) ShortVector.fromArray((VectorSpecies) s, a, 0); } else if (stype == int.class) { int[] a = new int[limit]; for (int i = 0; i < limit; i++) { a[i] = (int) this.get(i); } - return (Vector) IntVector.fromArray((Species) s, a, 0); + return (Vector) IntVector.fromArray((VectorSpecies) s, a, 0); } else if (stype == long.class) { long[] a = new long[limit]; for (int i = 0; i < limit; i++) { a[i] = (long) this.get(i); } - return (Vector) LongVector.fromArray((Species) s, a, 0); + return (Vector) LongVector.fromArray((VectorSpecies) s, a, 0); } else if (stype == float.class) { float[] a = new float[limit]; for (int i = 0; i < limit; i++) { a[i] = (float) this.get(i); } - return (Vector) FloatVector.fromArray((Species) s, a, 0); + return (Vector) FloatVector.fromArray((VectorSpecies) s, a, 0); } else if (stype == double.class) { double[] a = new double[limit]; for (int i = 0; i < limit; i++) { a[i] = (double) this.get(i); } - return (Vector) DoubleVector.fromArray((Species) s, a, 0); + return (Vector) DoubleVector.fromArray((VectorSpecies) s, a, 0); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } @@ -212,11 +212,11 @@ @Override @ForceInline @SuppressWarnings("unchecked") - public Vector reinterpret(Species s) { + public Vector reinterpret(VectorSpecies s) { Objects.requireNonNull(s); if(s.elementType().equals(short.class)) { - return (Vector) reshape((Species)s); + return (Vector) reshape((VectorSpecies)s); } if(s.bitSize() == bitSize()) { return reinterpretType(s); @@ -226,7 +226,7 @@ } @ForceInline - private Vector reinterpretType(Species s) { + private Vector reinterpretType(VectorSpecies s) { Objects.requireNonNull(s); Class stype = s.elementType(); @@ -291,7 +291,7 @@ @Override @ForceInline - public ShortVector reshape(Species s) { + public ShortVector reshape(VectorSpecies s) { Objects.requireNonNull(s); if (s.bitSize() == 64 && (s.boxType() == Short64Vector.class)) { return VectorIntrinsics.reinterpret( @@ -354,7 +354,7 @@ @Override @ForceInline - public ShortVector add(short o, Mask m) { + public ShortVector add(short o, VectorMask m) { return add((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -366,7 +366,7 @@ @Override @ForceInline - public ShortVector sub(short o, Mask m) { + public ShortVector sub(short o, VectorMask m) { return sub((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -378,7 +378,7 @@ @Override @ForceInline - public ShortVector mul(short o, Mask m) { + public ShortVector mul(short o, VectorMask m) { return mul((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -396,43 +396,43 @@ @Override @ForceInline - public Mask equal(short o) { + public VectorMask equal(short o) { return equal((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask notEqual(short o) { + public VectorMask notEqual(short o) { return notEqual((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThan(short o) { + public VectorMask lessThan(short o) { return lessThan((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThanEq(short o) { + public VectorMask lessThanEq(short o) { return lessThanEq((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThan(short o) { + public VectorMask greaterThan(short o) { return greaterThan((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThanEq(short o) { + public VectorMask greaterThanEq(short o) { return greaterThanEq((ShortMaxVector)ShortVector.broadcast(SPECIES, o)); } @Override @ForceInline - public ShortVector blend(short o, Mask m) { + public ShortVector blend(short o, VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -445,7 +445,7 @@ @Override @ForceInline - public ShortVector and(short o, Mask m) { + public ShortVector and(short o, VectorMask m) { return and((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -457,7 +457,7 @@ @Override @ForceInline - public ShortVector or(short o, Mask m) { + public ShortVector or(short o, VectorMask m) { return or((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -469,7 +469,7 @@ @Override @ForceInline - public ShortVector xor(short o, Mask m) { + public ShortVector xor(short o, VectorMask m) { return xor((ShortMaxVector)ShortVector.broadcast(SPECIES, o), m); } @@ -483,7 +483,7 @@ @ForceInline @Override - public ShortMaxVector neg(Mask m) { + public ShortMaxVector neg(VectorMask m) { return blend(neg(), m); } @@ -498,7 +498,7 @@ @ForceInline @Override - public ShortMaxVector abs(Mask m) { + public ShortMaxVector abs(VectorMask m) { return blend(abs(), m); } @@ -514,7 +514,7 @@ @ForceInline @Override - public ShortMaxVector not(Mask m) { + public ShortMaxVector not(VectorMask m) { return blend(not(), m); } // Binary operations @@ -532,7 +532,7 @@ @Override @ForceInline - public ShortMaxVector add(Vector v, Mask m) { + public ShortMaxVector add(Vector v, VectorMask m) { return blend(add(v), m); } @@ -549,7 +549,7 @@ @Override @ForceInline - public ShortMaxVector sub(Vector v, Mask m) { + public ShortMaxVector sub(Vector v, VectorMask m) { return blend(sub(v), m); } @@ -566,7 +566,7 @@ @Override @ForceInline - public ShortMaxVector mul(Vector v, Mask m) { + public ShortMaxVector mul(Vector v, VectorMask m) { return blend(mul(v), m); } @@ -583,7 +583,7 @@ @Override @ForceInline - public ShortMaxVector min(Vector v, Mask m) { + public ShortMaxVector min(Vector v, VectorMask m) { return blend(min(v), m); } @@ -600,7 +600,7 @@ @Override @ForceInline - public ShortMaxVector max(Vector v, Mask m) { + public ShortMaxVector max(Vector v, VectorMask m) { return blend(max(v), m); } @@ -639,19 +639,19 @@ @Override @ForceInline - public ShortMaxVector and(Vector v, Mask m) { + public ShortMaxVector and(Vector v, VectorMask m) { return blend(and(v), m); } @Override @ForceInline - public ShortMaxVector or(Vector v, Mask m) { + public ShortMaxVector or(Vector v, VectorMask m) { return blend(or(v), m); } @Override @ForceInline - public ShortMaxVector xor(Vector v, Mask m) { + public ShortMaxVector xor(Vector v, VectorMask m) { return blend(xor(v), m); } @@ -666,7 +666,7 @@ @Override @ForceInline - public ShortMaxVector shiftL(int s, Mask m) { + public ShortMaxVector shiftL(int s, VectorMask m) { return blend(shiftL(s), m); } @@ -681,7 +681,7 @@ @Override @ForceInline - public ShortMaxVector shiftR(int s, Mask m) { + public ShortMaxVector shiftR(int s, VectorMask m) { return blend(shiftR(s), m); } @@ -696,7 +696,7 @@ @Override @ForceInline - public ShortMaxVector aShiftR(int s, Mask m) { + public ShortMaxVector aShiftR(int s, VectorMask m) { return blend(aShiftR(s), m); } // Ternary operations @@ -724,7 +724,7 @@ @Override @ForceInline - public short andAll(Mask m) { + public short andAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, (short) -1), m).andAll(); } @@ -766,7 +766,7 @@ @Override @ForceInline - public short orAll(Mask m) { + public short orAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, (short) 0), m).orAll(); } @@ -781,45 +781,45 @@ @Override @ForceInline - public short xorAll(Mask m) { + public short xorAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, (short) 0), m).xorAll(); } @Override @ForceInline - public short addAll(Mask m) { + public short addAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, (short) 0), m).addAll(); } @Override @ForceInline - public short mulAll(Mask m) { + public short mulAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, (short) 1), m).mulAll(); } @Override @ForceInline - public short minAll(Mask m) { + public short minAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, Short.MAX_VALUE), m).minAll(); } @Override @ForceInline - public short maxAll(Mask m) { + public short maxAll(VectorMask m) { return blend((ShortMaxVector)ShortVector.broadcast(SPECIES, Short.MIN_VALUE), m).maxAll(); } @Override @ForceInline - public Shuffle toShuffle() { + public VectorShuffle toShuffle() { short[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { sa[i] = (int) a[i]; } - return ShortVector.shuffleFromArray(SPECIES, sa, 0); + return VectorShuffle.fromArray(SPECIES, sa, 0); } // Memory operations @@ -841,7 +841,7 @@ @Override @ForceInline - public final void intoArray(short[] a, int ax, Mask m) { + public final void intoArray(short[] a, int ax, VectorMask m) { ShortVector oldVal = ShortVector.fromArray(SPECIES, a, ax); ShortVector newVal = oldVal.blend(this, m); newVal.intoArray(a, ax); @@ -865,7 +865,7 @@ @Override @ForceInline - public final void intoByteArray(byte[] a, int ix, Mask m) { + public final void intoByteArray(byte[] a, int ix, VectorMask m) { ShortMaxVector oldVal = (ShortMaxVector) ShortVector.fromByteArray(SPECIES, a, ix); ShortMaxVector newVal = oldVal.blend(this, m); newVal.intoByteArray(a, ix); @@ -894,7 +894,7 @@ @Override @ForceInline - public void intoByteBuffer(ByteBuffer bb, int ix, Mask m) { + public void intoByteBuffer(ByteBuffer bb, int ix, VectorMask m) { ShortMaxVector oldVal = (ShortMaxVector) ShortVector.fromByteBuffer(SPECIES, bb, ix); ShortMaxVector newVal = oldVal.blend(this, m); newVal.intoByteBuffer(bb, ix); @@ -1019,7 +1019,7 @@ } @Override - void forEach(Mask o, FUnCon f) { + void forEach(VectorMask o, FUnCon f) { boolean[] mbits = ((ShortMaxMask)o).getBits(); forEach((i, a) -> { if (mbits[i]) { f.apply(i, a); } @@ -1076,13 +1076,13 @@ @Override @ForceInline public ShortMaxVector rearrange(Vector v, - Shuffle s, Mask m) { + VectorShuffle s, VectorMask m) { return this.rearrange(s).blend(v.rearrange(s), m); } @Override @ForceInline - public ShortMaxVector rearrange(Shuffle o1) { + public ShortMaxVector rearrange(VectorShuffle o1) { Objects.requireNonNull(o1); ShortMaxShuffle s = (ShortMaxShuffle)o1; @@ -1097,7 +1097,7 @@ @Override @ForceInline - public ShortMaxVector blend(Vector o1, Mask o2) { + public ShortMaxVector blend(Vector o1, VectorMask o2) { Objects.requireNonNull(o1); Objects.requireNonNull(o2); ShortMaxVector v = (ShortMaxVector)o1; @@ -1181,7 +1181,7 @@ } @Override - ShortMaxMask bOp(Mask o, MBinOp f) { + ShortMaxMask bOp(VectorMask o, MBinOp f) { boolean[] res = new boolean[species().length()]; boolean[] bits = getBits(); boolean[] mbits = ((ShortMaxMask)o).getBits(); @@ -1192,7 +1192,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1211,23 +1211,23 @@ @Override @ForceInline @SuppressWarnings("unchecked") - public Mask cast(Species species) { + public VectorMask cast(VectorSpecies species) { if (length() != species.length()) - throw new IllegalArgumentException("Mask length and species length differ"); + throw new IllegalArgumentException("VectorMask length and species length differ"); Class stype = species.elementType(); boolean [] maskArray = toArray(); if (stype == byte.class) { - return (Mask ) new ByteMaxVector.ByteMaxMask(maskArray); + return (VectorMask ) new ByteMaxVector.ByteMaxMask(maskArray); } else if (stype == short.class) { - return (Mask ) new ShortMaxVector.ShortMaxMask(maskArray); + return (VectorMask ) new ShortMaxVector.ShortMaxMask(maskArray); } else if (stype == int.class) { - return (Mask ) new IntMaxVector.IntMaxMask(maskArray); + return (VectorMask ) new IntMaxVector.IntMaxMask(maskArray); } else if (stype == long.class) { - return (Mask ) new LongMaxVector.LongMaxMask(maskArray); + return (VectorMask ) new LongMaxVector.LongMaxMask(maskArray); } else if (stype == float.class) { - return (Mask ) new FloatMaxVector.FloatMaxMask(maskArray); + return (VectorMask ) new FloatMaxVector.FloatMaxMask(maskArray); } else if (stype == double.class) { - return (Mask ) new DoubleMaxVector.DoubleMaxMask(maskArray); + return (VectorMask ) new DoubleMaxVector.DoubleMaxMask(maskArray); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } @@ -1248,7 +1248,7 @@ @Override @ForceInline - public ShortMaxMask and(Mask o) { + public ShortMaxMask and(VectorMask o) { Objects.requireNonNull(o); ShortMaxMask m = (ShortMaxMask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, short.class, LENGTH, @@ -1258,7 +1258,7 @@ @Override @ForceInline - public ShortMaxMask or(Mask o) { + public ShortMaxMask or(VectorMask o) { Objects.requireNonNull(o); ShortMaxMask m = (ShortMaxMask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, short.class, LENGTH, @@ -1280,7 +1280,7 @@ @ForceInline public boolean allTrue() { return VectorIntrinsics.test(BT_overflow, ShortMaxMask.class, short.class, LENGTH, - this, ShortVector.maskAllTrue(species()), + this, VectorMask.maskAllTrue(species()), (m, __) -> allTrueHelper(((ShortMaxMask)m).getBits())); } } @@ -1305,7 +1305,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1321,30 +1321,30 @@ @Override @ForceInline @SuppressWarnings("unchecked") - public Shuffle cast(Species species) { + public VectorShuffle cast(VectorSpecies species) { if (length() != species.length()) throw new IllegalArgumentException("Shuffle length and species length differ"); Class stype = species.elementType(); int [] shuffleArray = toArray(); if (stype == byte.class) { - return (Shuffle) new ByteMaxVector.ByteMaxShuffle(shuffleArray); + return (VectorShuffle) new ByteMaxVector.ByteMaxShuffle(shuffleArray); } else if (stype == short.class) { - return (Shuffle) new ShortMaxVector.ShortMaxShuffle(shuffleArray); + return (VectorShuffle) new ShortMaxVector.ShortMaxShuffle(shuffleArray); } else if (stype == int.class) { - return (Shuffle) new IntMaxVector.IntMaxShuffle(shuffleArray); + return (VectorShuffle) new IntMaxVector.IntMaxShuffle(shuffleArray); } else if (stype == long.class) { - return (Shuffle) new LongMaxVector.LongMaxShuffle(shuffleArray); + return (VectorShuffle) new LongMaxVector.LongMaxShuffle(shuffleArray); } else if (stype == float.class) { - return (Shuffle) new FloatMaxVector.FloatMaxShuffle(shuffleArray); + return (VectorShuffle) new FloatMaxVector.FloatMaxShuffle(shuffleArray); } else if (stype == double.class) { - return (Shuffle) new DoubleMaxVector.DoubleMaxShuffle(shuffleArray); + return (VectorShuffle) new DoubleMaxVector.DoubleMaxShuffle(shuffleArray); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } } @Override - public ShortMaxShuffle rearrange(Vector.Shuffle o) { + public ShortMaxShuffle rearrange(VectorShuffle o) { ShortMaxShuffle s = (ShortMaxShuffle) o; byte[] r = new byte[reorder.length]; for (int i = 0; i < reorder.length; i++) { @@ -1354,10 +1354,10 @@ } } - // Species + // VectorSpecies @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } }