--- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2019-04-16 10:38:57.274025100 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java 2019-04-16 10:38:56.786122300 -0700 @@ -38,7 +38,7 @@ @SuppressWarnings("cast") final class Int128Vector extends IntVector { - private static final Species SPECIES = IntVector.SPECIES_128; + private static final VectorSpecies SPECIES = IntVector.SPECIES_128; static final Int128Vector ZERO = new Int128Vector(); @@ -49,7 +49,7 @@ static { int bitSize = Vector.bitSizeForVectorLength(int.class, LENGTH); - INDEX_SPECIES = (IntVector.IntSpecies) IntVector.species(Shape.forBitSize(bitSize)); + INDEX_SPECIES = (IntVector.IntSpecies) IntVector.species(VectorShape.forBitSize(bitSize)); } private final int[] vec; // Don't access directly, use getElements() instead. @@ -82,7 +82,7 @@ } @Override - Int128Vector uOp(Mask o, FUnOp f) { + Int128Vector uOp(VectorMask o, FUnOp f) { int[] vec = getElements(); int[] res = new int[length()]; boolean[] mbits = ((Int128Mask)o).getBits(); @@ -106,7 +106,7 @@ } @Override - Int128Vector bOp(Vector o1, Mask o2, FBinOp f) { + Int128Vector bOp(Vector o1, VectorMask o2, FBinOp f) { int[] res = new int[length()]; int[] vec1 = this.getElements(); int[] vec2 = ((Int128Vector)o1).getElements(); @@ -132,7 +132,7 @@ } @Override - Int128Vector tOp(Vector o1, Vector o2, Mask o3, FTriOp f) { + Int128Vector tOp(Vector o1, Vector o2, VectorMask o3, FTriOp f) { int[] res = new int[length()]; int[] vec1 = getElements(); int[] vec2 = ((Int128Vector)o1).getElements(); @@ -155,7 +155,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"); @@ -172,7 +172,7 @@ @SuppressWarnings("unchecked") @ForceInline - private Vector castDefault(Species s) { + private Vector castDefault(VectorSpecies s) { int limit = s.length(); Class stype = s.elementType(); @@ -181,37 +181,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."); } @@ -220,11 +220,11 @@ @Override @ForceInline @SuppressWarnings("unchecked") - public Vector reinterpret(Species s) { + public Vector reinterpret(VectorSpecies s) { Objects.requireNonNull(s); if(s.elementType().equals(int.class)) { - return (Vector) reshape((Species)s); + return (Vector) reshape((VectorSpecies)s); } if(s.bitSize() == bitSize()) { return reinterpretType(s); @@ -234,7 +234,7 @@ } @ForceInline - private Vector reinterpretType(Species s) { + private Vector reinterpretType(VectorSpecies s) { Objects.requireNonNull(s); Class stype = s.elementType(); @@ -299,7 +299,7 @@ @Override @ForceInline - public IntVector reshape(Species s) { + public IntVector reshape(VectorSpecies s) { Objects.requireNonNull(s); if (s.bitSize() == 64 && (s.boxType() == Int64Vector.class)) { return VectorIntrinsics.reinterpret( @@ -362,7 +362,7 @@ @Override @ForceInline - public IntVector add(int o, Mask m) { + public IntVector add(int o, VectorMask m) { return add((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -374,7 +374,7 @@ @Override @ForceInline - public IntVector sub(int o, Mask m) { + public IntVector sub(int o, VectorMask m) { return sub((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -386,7 +386,7 @@ @Override @ForceInline - public IntVector mul(int o, Mask m) { + public IntVector mul(int o, VectorMask m) { return mul((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -404,43 +404,43 @@ @Override @ForceInline - public Mask equal(int o) { + public VectorMask equal(int o) { return equal((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask notEqual(int o) { + public VectorMask notEqual(int o) { return notEqual((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThan(int o) { + public VectorMask lessThan(int o) { return lessThan((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThanEq(int o) { + public VectorMask lessThanEq(int o) { return lessThanEq((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThan(int o) { + public VectorMask greaterThan(int o) { return greaterThan((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThanEq(int o) { + public VectorMask greaterThanEq(int o) { return greaterThanEq((Int128Vector)IntVector.broadcast(SPECIES, o)); } @Override @ForceInline - public IntVector blend(int o, Mask m) { + public IntVector blend(int o, VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -453,7 +453,7 @@ @Override @ForceInline - public IntVector and(int o, Mask m) { + public IntVector and(int o, VectorMask m) { return and((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -465,7 +465,7 @@ @Override @ForceInline - public IntVector or(int o, Mask m) { + public IntVector or(int o, VectorMask m) { return or((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -477,7 +477,7 @@ @Override @ForceInline - public IntVector xor(int o, Mask m) { + public IntVector xor(int o, VectorMask m) { return xor((Int128Vector)IntVector.broadcast(SPECIES, o), m); } @@ -491,7 +491,7 @@ @ForceInline @Override - public Int128Vector neg(Mask m) { + public Int128Vector neg(VectorMask m) { return blend(neg(), m); } @@ -506,7 +506,7 @@ @ForceInline @Override - public Int128Vector abs(Mask m) { + public Int128Vector abs(VectorMask m) { return blend(abs(), m); } @@ -522,7 +522,7 @@ @ForceInline @Override - public Int128Vector not(Mask m) { + public Int128Vector not(VectorMask m) { return blend(not(), m); } // Binary operations @@ -540,7 +540,7 @@ @Override @ForceInline - public Int128Vector add(Vector v, Mask m) { + public Int128Vector add(Vector v, VectorMask m) { return blend(add(v), m); } @@ -557,7 +557,7 @@ @Override @ForceInline - public Int128Vector sub(Vector v, Mask m) { + public Int128Vector sub(Vector v, VectorMask m) { return blend(sub(v), m); } @@ -574,7 +574,7 @@ @Override @ForceInline - public Int128Vector mul(Vector v, Mask m) { + public Int128Vector mul(Vector v, VectorMask m) { return blend(mul(v), m); } @@ -591,7 +591,7 @@ @Override @ForceInline - public Int128Vector min(Vector v, Mask m) { + public Int128Vector min(Vector v, VectorMask m) { return blend(min(v), m); } @@ -608,7 +608,7 @@ @Override @ForceInline - public Int128Vector max(Vector v, Mask m) { + public Int128Vector max(Vector v, VectorMask m) { return blend(max(v), m); } @@ -647,19 +647,19 @@ @Override @ForceInline - public Int128Vector and(Vector v, Mask m) { + public Int128Vector and(Vector v, VectorMask m) { return blend(and(v), m); } @Override @ForceInline - public Int128Vector or(Vector v, Mask m) { + public Int128Vector or(Vector v, VectorMask m) { return blend(or(v), m); } @Override @ForceInline - public Int128Vector xor(Vector v, Mask m) { + public Int128Vector xor(Vector v, VectorMask m) { return blend(xor(v), m); } @@ -674,7 +674,7 @@ @Override @ForceInline - public Int128Vector shiftL(int s, Mask m) { + public Int128Vector shiftL(int s, VectorMask m) { return blend(shiftL(s), m); } @@ -689,7 +689,7 @@ @Override @ForceInline - public Int128Vector shiftR(int s, Mask m) { + public Int128Vector shiftR(int s, VectorMask m) { return blend(shiftR(s), m); } @@ -704,7 +704,7 @@ @Override @ForceInline - public Int128Vector aShiftR(int s, Mask m) { + public Int128Vector aShiftR(int s, VectorMask m) { return blend(aShiftR(s), m); } @@ -768,7 +768,7 @@ @Override @ForceInline - public int andAll(Mask m) { + public int andAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, (int) -1), m).andAll(); } @@ -810,7 +810,7 @@ @Override @ForceInline - public int orAll(Mask m) { + public int orAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, (int) 0), m).orAll(); } @@ -825,45 +825,45 @@ @Override @ForceInline - public int xorAll(Mask m) { + public int xorAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, (int) 0), m).xorAll(); } @Override @ForceInline - public int addAll(Mask m) { + public int addAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, (int) 0), m).addAll(); } @Override @ForceInline - public int mulAll(Mask m) { + public int mulAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, (int) 1), m).mulAll(); } @Override @ForceInline - public int minAll(Mask m) { + public int minAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, Integer.MAX_VALUE), m).minAll(); } @Override @ForceInline - public int maxAll(Mask m) { + public int maxAll(VectorMask m) { return blend((Int128Vector)IntVector.broadcast(SPECIES, Integer.MIN_VALUE), m).maxAll(); } @Override @ForceInline - public Shuffle toShuffle() { + public VectorShuffle toShuffle() { int[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { sa[i] = (int) a[i]; } - return IntVector.shuffleFromArray(SPECIES, sa, 0); + return VectorShuffle.fromArray(SPECIES, sa, 0); } // Memory operations @@ -885,7 +885,7 @@ @Override @ForceInline - public final void intoArray(int[] a, int ax, Mask m) { + public final void intoArray(int[] a, int ax, VectorMask m) { IntVector oldVal = IntVector.fromArray(SPECIES, a, ax); IntVector newVal = oldVal.blend(this, m); newVal.intoArray(a, ax); @@ -910,7 +910,7 @@ @Override @ForceInline - public final void intoArray(int[] a, int ax, Mask m, int[] b, int iy) { + public final void intoArray(int[] a, int ax, VectorMask m, int[] b, int iy) { // @@@ This can result in out of bounds errors for unset mask lanes IntVector oldVal = IntVector.fromArray(SPECIES, a, ax, b, iy); IntVector newVal = oldVal.blend(this, m); @@ -935,7 +935,7 @@ @Override @ForceInline - public final void intoByteArray(byte[] a, int ix, Mask m) { + public final void intoByteArray(byte[] a, int ix, VectorMask m) { Int128Vector oldVal = (Int128Vector) IntVector.fromByteArray(SPECIES, a, ix); Int128Vector newVal = oldVal.blend(this, m); newVal.intoByteArray(a, ix); @@ -964,7 +964,7 @@ @Override @ForceInline - public void intoByteBuffer(ByteBuffer bb, int ix, Mask m) { + public void intoByteBuffer(ByteBuffer bb, int ix, VectorMask m) { Int128Vector oldVal = (Int128Vector) IntVector.fromByteBuffer(SPECIES, bb, ix); Int128Vector newVal = oldVal.blend(this, m); newVal.intoByteBuffer(bb, ix); @@ -1089,7 +1089,7 @@ } @Override - void forEach(Mask o, FUnCon f) { + void forEach(VectorMask o, FUnCon f) { boolean[] mbits = ((Int128Mask)o).getBits(); forEach((i, a) -> { if (mbits[i]) { f.apply(i, a); } @@ -1154,13 +1154,13 @@ @Override @ForceInline public Int128Vector rearrange(Vector v, - Shuffle s, Mask m) { + VectorShuffle s, VectorMask m) { return this.rearrange(s).blend(v.rearrange(s), m); } @Override @ForceInline - public Int128Vector rearrange(Shuffle o1) { + public Int128Vector rearrange(VectorShuffle o1) { Objects.requireNonNull(o1); Int128Shuffle s = (Int128Shuffle)o1; @@ -1175,7 +1175,7 @@ @Override @ForceInline - public Int128Vector blend(Vector o1, Mask o2) { + public Int128Vector blend(Vector o1, VectorMask o2) { Objects.requireNonNull(o1); Objects.requireNonNull(o2); Int128Vector v = (Int128Vector)o1; @@ -1259,7 +1259,7 @@ } @Override - Int128Mask bOp(Mask o, MBinOp f) { + Int128Mask bOp(VectorMask o, MBinOp f) { boolean[] res = new boolean[species().length()]; boolean[] bits = getBits(); boolean[] mbits = ((Int128Mask)o).getBits(); @@ -1270,7 +1270,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1289,23 +1289,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 Byte128Vector.Byte128Mask(maskArray); + return (VectorMask ) new Byte128Vector.Byte128Mask(maskArray); } else if (stype == short.class) { - return (Mask ) new Short128Vector.Short128Mask(maskArray); + return (VectorMask ) new Short128Vector.Short128Mask(maskArray); } else if (stype == int.class) { - return (Mask ) new Int128Vector.Int128Mask(maskArray); + return (VectorMask ) new Int128Vector.Int128Mask(maskArray); } else if (stype == long.class) { - return (Mask ) new Long128Vector.Long128Mask(maskArray); + return (VectorMask ) new Long128Vector.Long128Mask(maskArray); } else if (stype == float.class) { - return (Mask ) new Float128Vector.Float128Mask(maskArray); + return (VectorMask ) new Float128Vector.Float128Mask(maskArray); } else if (stype == double.class) { - return (Mask ) new Double128Vector.Double128Mask(maskArray); + return (VectorMask ) new Double128Vector.Double128Mask(maskArray); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } @@ -1326,7 +1326,7 @@ @Override @ForceInline - public Int128Mask and(Mask o) { + public Int128Mask and(VectorMask o) { Objects.requireNonNull(o); Int128Mask m = (Int128Mask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_AND, Int128Mask.class, int.class, LENGTH, @@ -1336,7 +1336,7 @@ @Override @ForceInline - public Int128Mask or(Mask o) { + public Int128Mask or(VectorMask o) { Objects.requireNonNull(o); Int128Mask m = (Int128Mask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_OR, Int128Mask.class, int.class, LENGTH, @@ -1358,7 +1358,7 @@ @ForceInline public boolean allTrue() { return VectorIntrinsics.test(BT_overflow, Int128Mask.class, int.class, LENGTH, - this, IntVector.maskAllTrue(species()), + this, VectorMask.maskAllTrue(species()), (m, __) -> allTrueHelper(((Int128Mask)m).getBits())); } } @@ -1383,7 +1383,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1399,30 +1399,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 Byte128Vector.Byte128Shuffle(shuffleArray); + return (VectorShuffle) new Byte128Vector.Byte128Shuffle(shuffleArray); } else if (stype == short.class) { - return (Shuffle) new Short128Vector.Short128Shuffle(shuffleArray); + return (VectorShuffle) new Short128Vector.Short128Shuffle(shuffleArray); } else if (stype == int.class) { - return (Shuffle) new Int128Vector.Int128Shuffle(shuffleArray); + return (VectorShuffle) new Int128Vector.Int128Shuffle(shuffleArray); } else if (stype == long.class) { - return (Shuffle) new Long128Vector.Long128Shuffle(shuffleArray); + return (VectorShuffle) new Long128Vector.Long128Shuffle(shuffleArray); } else if (stype == float.class) { - return (Shuffle) new Float128Vector.Float128Shuffle(shuffleArray); + return (VectorShuffle) new Float128Vector.Float128Shuffle(shuffleArray); } else if (stype == double.class) { - return (Shuffle) new Double128Vector.Double128Shuffle(shuffleArray); + return (VectorShuffle) new Double128Vector.Double128Shuffle(shuffleArray); } else { throw new UnsupportedOperationException("Bad lane type for casting."); } } @Override - public Int128Shuffle rearrange(Vector.Shuffle o) { + public Int128Shuffle rearrange(VectorShuffle o) { Int128Shuffle s = (Int128Shuffle) o; byte[] r = new byte[reorder.length]; for (int i = 0; i < reorder.length; i++) { @@ -1432,10 +1432,10 @@ } } - // Species + // VectorSpecies @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } }