--- old/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java 2019-04-15 14:42:03.164617000 -0700 +++ new/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java 2019-04-15 14:42:02.718579400 -0700 @@ -38,7 +38,7 @@ @SuppressWarnings("cast") final class DoubleMaxVector extends DoubleVector { - private static final Species SPECIES = DoubleVector.SPECIES_MAX; + private static final VectorSpecies SPECIES = DoubleVector.SPECIES_MAX; static final DoubleMaxVector ZERO = new DoubleMaxVector(); @@ -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 double[] vec; // Don't access directly, use getElements() instead. @@ -82,7 +82,7 @@ } @Override - DoubleMaxVector uOp(Mask o, FUnOp f) { + DoubleMaxVector uOp(VectorMask o, FUnOp f) { double[] vec = getElements(); double[] res = new double[length()]; boolean[] mbits = ((DoubleMaxMask)o).getBits(); @@ -106,7 +106,7 @@ } @Override - DoubleMaxVector bOp(Vector o1, Mask o2, FBinOp f) { + DoubleMaxVector bOp(Vector o1, VectorMask o2, FBinOp f) { double[] res = new double[length()]; double[] vec1 = this.getElements(); double[] vec2 = ((DoubleMaxVector)o1).getElements(); @@ -132,7 +132,7 @@ } @Override - DoubleMaxVector tOp(Vector o1, Vector o2, Mask o3, FTriOp f) { + DoubleMaxVector tOp(Vector o1, Vector o2, VectorMask o3, FTriOp f) { double[] res = new double[length()]; double[] vec1 = getElements(); double[] vec2 = ((DoubleMaxVector)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(double.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 DoubleVector reshape(Species s) { + public DoubleVector reshape(VectorSpecies s) { Objects.requireNonNull(s); if (s.bitSize() == 64 && (s.boxType() == Double64Vector.class)) { return VectorIntrinsics.reinterpret( @@ -362,7 +362,7 @@ @Override @ForceInline - public DoubleVector add(double o, Mask m) { + public DoubleVector add(double o, VectorMask m) { return add((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -374,7 +374,7 @@ @Override @ForceInline - public DoubleVector sub(double o, Mask m) { + public DoubleVector sub(double o, VectorMask m) { return sub((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -386,7 +386,7 @@ @Override @ForceInline - public DoubleVector mul(double o, Mask m) { + public DoubleVector mul(double o, VectorMask m) { return mul((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -404,43 +404,43 @@ @Override @ForceInline - public Mask equal(double o) { + public VectorMask equal(double o) { return equal((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask notEqual(double o) { + public VectorMask notEqual(double o) { return notEqual((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThan(double o) { + public VectorMask lessThan(double o) { return lessThan((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask lessThanEq(double o) { + public VectorMask lessThanEq(double o) { return lessThanEq((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThan(double o) { + public VectorMask greaterThan(double o) { return greaterThan((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public Mask greaterThanEq(double o) { + public VectorMask greaterThanEq(double o) { return greaterThanEq((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o)); } @Override @ForceInline - public DoubleVector blend(double o, Mask m) { + public DoubleVector blend(double o, VectorMask m) { return blend((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -452,13 +452,13 @@ @Override @ForceInline - public DoubleVector div(double o, Mask m) { + public DoubleVector div(double o, VectorMask m) { return div((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @Override @ForceInline - public DoubleMaxVector div(Vector v, Mask m) { + public DoubleMaxVector div(Vector v, VectorMask m) { return blend(div(v), m); } @@ -470,7 +470,7 @@ @Override @ForceInline - public DoubleVector atan2(double o, Mask m) { + public DoubleVector atan2(double o, VectorMask m) { return atan2((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -482,7 +482,7 @@ @Override @ForceInline - public DoubleVector pow(double o, Mask m) { + public DoubleVector pow(double o, VectorMask m) { return pow((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -494,7 +494,7 @@ @Override @ForceInline - public DoubleVector fma(double o1, double o2, Mask m) { + public DoubleVector fma(double o1, double o2, VectorMask m) { return fma((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o1), (DoubleMaxVector)DoubleVector.broadcast(SPECIES, o2), m); } @@ -506,7 +506,7 @@ @Override @ForceInline - public DoubleVector hypot(double o, Mask m) { + public DoubleVector hypot(double o, VectorMask m) { return hypot((DoubleMaxVector)DoubleVector.broadcast(SPECIES, o), m); } @@ -515,7 +515,7 @@ @ForceInline @Override - public DoubleMaxVector neg(Mask m) { + public DoubleMaxVector neg(VectorMask m) { return blend(neg(), m); } @@ -530,7 +530,7 @@ @ForceInline @Override - public DoubleMaxVector abs(Mask m) { + public DoubleMaxVector abs(VectorMask m) { return blend(abs(), m); } @@ -747,7 +747,7 @@ @Override @ForceInline - public DoubleMaxVector add(Vector v, Mask m) { + public DoubleMaxVector add(Vector v, VectorMask m) { return blend(add(v), m); } @@ -764,7 +764,7 @@ @Override @ForceInline - public DoubleMaxVector sub(Vector v, Mask m) { + public DoubleMaxVector sub(Vector v, VectorMask m) { return blend(sub(v), m); } @@ -781,7 +781,7 @@ @Override @ForceInline - public DoubleMaxVector mul(Vector v, Mask m) { + public DoubleMaxVector mul(Vector v, VectorMask m) { return blend(mul(v), m); } @@ -798,7 +798,7 @@ @Override @ForceInline - public DoubleMaxVector min(Vector v, Mask m) { + public DoubleMaxVector min(Vector v, VectorMask m) { return blend(min(v), m); } @@ -815,7 +815,7 @@ @Override @ForceInline - public DoubleMaxVector max(Vector v, Mask m) { + public DoubleMaxVector max(Vector v, VectorMask m) { return blend(max(v), m); } @@ -892,38 +892,38 @@ @Override @ForceInline - public double addAll(Mask m) { + public double addAll(VectorMask m) { return blend((DoubleMaxVector)DoubleVector.broadcast(SPECIES, (double) 0), m).addAll(); } @Override @ForceInline - public double mulAll(Mask m) { + public double mulAll(VectorMask m) { return blend((DoubleMaxVector)DoubleVector.broadcast(SPECIES, (double) 1), m).mulAll(); } @Override @ForceInline - public double minAll(Mask m) { + public double minAll(VectorMask m) { return blend((DoubleMaxVector)DoubleVector.broadcast(SPECIES, Double.MAX_VALUE), m).minAll(); } @Override @ForceInline - public double maxAll(Mask m) { + public double maxAll(VectorMask m) { return blend((DoubleMaxVector)DoubleVector.broadcast(SPECIES, Double.MIN_VALUE), m).maxAll(); } @Override @ForceInline - public Shuffle toShuffle() { + public VectorShuffle toShuffle() { double[] a = toArray(); int[] sa = new int[a.length]; for (int i = 0; i < a.length; i++) { sa[i] = (int) a[i]; } - return DoubleVector.shuffleFromArray(SPECIES, sa, 0); + return VectorShuffle.fromArray(SPECIES, sa, 0); } // Memory operations @@ -945,7 +945,7 @@ @Override @ForceInline - public final void intoArray(double[] a, int ax, Mask m) { + public final void intoArray(double[] a, int ax, VectorMask m) { DoubleVector oldVal = DoubleVector.fromArray(SPECIES, a, ax); DoubleVector newVal = oldVal.blend(this, m); newVal.intoArray(a, ax); @@ -970,7 +970,7 @@ @Override @ForceInline - public final void intoArray(double[] a, int ax, Mask m, int[] b, int iy) { + public final void intoArray(double[] a, int ax, VectorMask m, int[] b, int iy) { // @@@ This can result in out of bounds errors for unset mask lanes DoubleVector oldVal = DoubleVector.fromArray(SPECIES, a, ax, b, iy); DoubleVector newVal = oldVal.blend(this, m); @@ -995,7 +995,7 @@ @Override @ForceInline - public final void intoByteArray(byte[] a, int ix, Mask m) { + public final void intoByteArray(byte[] a, int ix, VectorMask m) { DoubleMaxVector oldVal = (DoubleMaxVector) DoubleVector.fromByteArray(SPECIES, a, ix); DoubleMaxVector newVal = oldVal.blend(this, m); newVal.intoByteArray(a, ix); @@ -1024,7 +1024,7 @@ @Override @ForceInline - public void intoByteBuffer(ByteBuffer bb, int ix, Mask m) { + public void intoByteBuffer(ByteBuffer bb, int ix, VectorMask m) { DoubleMaxVector oldVal = (DoubleMaxVector) DoubleVector.fromByteBuffer(SPECIES, bb, ix); DoubleMaxVector newVal = oldVal.blend(this, m); newVal.intoByteBuffer(bb, ix); @@ -1149,7 +1149,7 @@ } @Override - void forEach(Mask o, FUnCon f) { + void forEach(VectorMask o, FUnCon f) { boolean[] mbits = ((DoubleMaxMask)o).getBits(); forEach((i, a) -> { if (mbits[i]) { f.apply(i, a); } @@ -1214,13 +1214,13 @@ @Override @ForceInline public DoubleMaxVector rearrange(Vector v, - Shuffle s, Mask m) { + VectorShuffle s, VectorMask m) { return this.rearrange(s).blend(v.rearrange(s), m); } @Override @ForceInline - public DoubleMaxVector rearrange(Shuffle o1) { + public DoubleMaxVector rearrange(VectorShuffle o1) { Objects.requireNonNull(o1); DoubleMaxShuffle s = (DoubleMaxShuffle)o1; @@ -1235,7 +1235,7 @@ @Override @ForceInline - public DoubleMaxVector blend(Vector o1, Mask o2) { + public DoubleMaxVector blend(Vector o1, VectorMask o2) { Objects.requireNonNull(o1); Objects.requireNonNull(o2); DoubleMaxVector v = (DoubleMaxVector)o1; @@ -1320,7 +1320,7 @@ } @Override - DoubleMaxMask bOp(Mask o, MBinOp f) { + DoubleMaxMask bOp(VectorMask o, MBinOp f) { boolean[] res = new boolean[species().length()]; boolean[] bits = getBits(); boolean[] mbits = ((DoubleMaxMask)o).getBits(); @@ -1331,7 +1331,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1350,23 +1350,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."); } @@ -1387,7 +1387,7 @@ @Override @ForceInline - public DoubleMaxMask and(Mask o) { + public DoubleMaxMask and(VectorMask o) { Objects.requireNonNull(o); DoubleMaxMask m = (DoubleMaxMask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, long.class, LENGTH, @@ -1397,7 +1397,7 @@ @Override @ForceInline - public DoubleMaxMask or(Mask o) { + public DoubleMaxMask or(VectorMask o) { Objects.requireNonNull(o); DoubleMaxMask m = (DoubleMaxMask)o; return VectorIntrinsics.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, long.class, LENGTH, @@ -1419,7 +1419,7 @@ @ForceInline public boolean allTrue() { return VectorIntrinsics.test(BT_overflow, DoubleMaxMask.class, long.class, LENGTH, - this, DoubleVector.maskAllTrue(species()), + this, VectorMask.maskAllTrue(species()), (m, __) -> allTrueHelper(((DoubleMaxMask)m).getBits())); } } @@ -1444,7 +1444,7 @@ } @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } @@ -1460,30 +1460,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 DoubleMaxShuffle rearrange(Vector.Shuffle o) { + public DoubleMaxShuffle rearrange(VectorShuffle o) { DoubleMaxShuffle s = (DoubleMaxShuffle) o; byte[] r = new byte[reorder.length]; for (int i = 0; i < reorder.length; i++) { @@ -1493,10 +1493,10 @@ } } - // Species + // VectorSpecies @Override - public Species species() { + public VectorSpecies species() { return SPECIES; } }