< prev index next >
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java
Print this page
rev 54658 : refactored mask and shuffle creation methods, moved classes to top-level
@@ -35,11 +35,11 @@
import jdk.internal.vm.annotation.ForceInline;
import static jdk.incubator.vector.VectorIntrinsics.*;
@SuppressWarnings("cast")
final class ByteMaxVector extends ByteVector {
- private static final Species<Byte> SPECIES = ByteVector.SPECIES_MAX;
+ private static final VectorSpecies<Byte> SPECIES = ByteVector.SPECIES_MAX;
static final ByteMaxVector ZERO = new ByteMaxVector();
static final int LENGTH = SPECIES.length();
@@ -71,11 +71,11 @@
}
return new ByteMaxVector(res);
}
@Override
- ByteMaxVector uOp(Mask<Byte> o, FUnOp f) {
+ ByteMaxVector uOp(VectorMask<Byte> o, FUnOp f) {
byte[] vec = getElements();
byte[] res = new byte[length()];
boolean[] mbits = ((ByteMaxMask)o).getBits();
for (int i = 0; i < length(); i++) {
res[i] = mbits[i] ? f.apply(i, vec[i]) : vec[i];
@@ -95,11 +95,11 @@
}
return new ByteMaxVector(res);
}
@Override
- ByteMaxVector bOp(Vector<Byte> o1, Mask<Byte> o2, FBinOp f) {
+ ByteMaxVector bOp(Vector<Byte> o1, VectorMask<Byte> o2, FBinOp f) {
byte[] res = new byte[length()];
byte[] vec1 = this.getElements();
byte[] vec2 = ((ByteMaxVector)o1).getElements();
boolean[] mbits = ((ByteMaxMask)o2).getBits();
for (int i = 0; i < length(); i++) {
@@ -121,11 +121,11 @@
}
return new ByteMaxVector(res);
}
@Override
- ByteMaxVector tOp(Vector<Byte> o1, Vector<Byte> o2, Mask<Byte> o3, FTriOp f) {
+ ByteMaxVector tOp(Vector<Byte> o1, Vector<Byte> o2, VectorMask<Byte> o3, FTriOp f) {
byte[] res = new byte[length()];
byte[] vec1 = getElements();
byte[] vec2 = ((ByteMaxVector)o1).getElements();
byte[] vec3 = ((ByteMaxVector)o2).getElements();
boolean[] mbits = ((ByteMaxMask)o3).getBits();
@@ -144,11 +144,11 @@
return v;
}
@Override
@ForceInline
- public <F> Vector<F> cast(Species<F> s) {
+ public <F> Vector<F> cast(VectorSpecies<F> s) {
Objects.requireNonNull(s);
if (s.length() != LENGTH)
throw new IllegalArgumentException("Vector length this species length differ");
return VectorIntrinsics.cast(
@@ -161,73 +161,73 @@
);
}
@SuppressWarnings("unchecked")
@ForceInline
- private <F> Vector<F> castDefault(Species<F> s) {
+ private <F> Vector<F> castDefault(VectorSpecies<F> s) {
int limit = s.length();
Class<?> stype = s.elementType();
if (stype == byte.class) {
byte[] a = new byte[limit];
for (int i = 0; i < limit; i++) {
a[i] = (byte) this.get(i);
}
- return (Vector) ByteVector.fromArray((Species<Byte>) s, a, 0);
+ return (Vector) ByteVector.fromArray((VectorSpecies<Byte>) 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<Short>) s, a, 0);
+ return (Vector) ShortVector.fromArray((VectorSpecies<Short>) 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<Integer>) s, a, 0);
+ return (Vector) IntVector.fromArray((VectorSpecies<Integer>) 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<Long>) s, a, 0);
+ return (Vector) LongVector.fromArray((VectorSpecies<Long>) 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<Float>) s, a, 0);
+ return (Vector) FloatVector.fromArray((VectorSpecies<Float>) 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<Double>) s, a, 0);
+ return (Vector) DoubleVector.fromArray((VectorSpecies<Double>) s, a, 0);
} else {
throw new UnsupportedOperationException("Bad lane type for casting.");
}
}
@Override
@ForceInline
@SuppressWarnings("unchecked")
- public <F> Vector<F> reinterpret(Species<F> s) {
+ public <F> Vector<F> reinterpret(VectorSpecies<F> s) {
Objects.requireNonNull(s);
if(s.elementType().equals(byte.class)) {
- return (Vector<F>) reshape((Species<Byte>)s);
+ return (Vector<F>) reshape((VectorSpecies<Byte>)s);
}
if(s.bitSize() == bitSize()) {
return reinterpretType(s);
}
return defaultReinterpret(s);
}
@ForceInline
- private <F> Vector<F> reinterpretType(Species<F> s) {
+ private <F> Vector<F> reinterpretType(VectorSpecies<F> s) {
Objects.requireNonNull(s);
Class<?> stype = s.elementType();
if (stype == byte.class) {
return VectorIntrinsics.reinterpret(
@@ -288,11 +288,11 @@
}
}
@Override
@ForceInline
- public ByteVector reshape(Species<Byte> s) {
+ public ByteVector reshape(VectorSpecies<Byte> s) {
Objects.requireNonNull(s);
if (s.bitSize() == 64 && (s.boxType() == Byte64Vector.class)) {
return VectorIntrinsics.reinterpret(
ByteMaxVector.class,
byte.class, LENGTH,
@@ -351,11 +351,11 @@
return add((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector add(byte o, Mask<Byte> m) {
+ public ByteVector add(byte o, VectorMask<Byte> m) {
return add((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -363,11 +363,11 @@
return sub((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector sub(byte o, Mask<Byte> m) {
+ public ByteVector sub(byte o, VectorMask<Byte> m) {
return sub((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -375,11 +375,11 @@
return mul((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector mul(byte o, Mask<Byte> m) {
+ public ByteVector mul(byte o, VectorMask<Byte> m) {
return mul((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -393,47 +393,47 @@
return max((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> equal(byte o) {
+ public VectorMask<Byte> equal(byte o) {
return equal((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> notEqual(byte o) {
+ public VectorMask<Byte> notEqual(byte o) {
return notEqual((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> lessThan(byte o) {
+ public VectorMask<Byte> lessThan(byte o) {
return lessThan((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> lessThanEq(byte o) {
+ public VectorMask<Byte> lessThanEq(byte o) {
return lessThanEq((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> greaterThan(byte o) {
+ public VectorMask<Byte> greaterThan(byte o) {
return greaterThan((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public Mask<Byte> greaterThanEq(byte o) {
+ public VectorMask<Byte> greaterThanEq(byte o) {
return greaterThanEq((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector blend(byte o, Mask<Byte> m) {
+ public ByteVector blend(byte o, VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@@ -442,11 +442,11 @@
return and((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector and(byte o, Mask<Byte> m) {
+ public ByteVector and(byte o, VectorMask<Byte> m) {
return and((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -454,11 +454,11 @@
return or((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector or(byte o, Mask<Byte> m) {
+ public ByteVector or(byte o, VectorMask<Byte> m) {
return or((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -466,11 +466,11 @@
return xor((ByteMaxVector)ByteVector.broadcast(SPECIES, o));
}
@Override
@ForceInline
- public ByteVector xor(byte o, Mask<Byte> m) {
+ public ByteVector xor(byte o, VectorMask<Byte> m) {
return xor((ByteMaxVector)ByteVector.broadcast(SPECIES, o), m);
}
@Override
@ForceInline
@@ -480,11 +480,11 @@
// Unary operations
@ForceInline
@Override
- public ByteMaxVector neg(Mask<Byte> m) {
+ public ByteMaxVector neg(VectorMask<Byte> m) {
return blend(neg(), m);
}
@Override
@ForceInline
@@ -495,11 +495,11 @@
v1 -> v1.uOp((i, a) -> (byte) Math.abs(a)));
}
@ForceInline
@Override
- public ByteMaxVector abs(Mask<Byte> m) {
+ public ByteMaxVector abs(VectorMask<Byte> m) {
return blend(abs(), m);
}
@Override
@@ -511,11 +511,11 @@
v1 -> v1.uOp((i, a) -> (byte) ~a));
}
@ForceInline
@Override
- public ByteMaxVector not(Mask<Byte> m) {
+ public ByteMaxVector not(VectorMask<Byte> m) {
return blend(not(), m);
}
// Binary operations
@Override
@@ -529,11 +529,11 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte)(a + b)));
}
@Override
@ForceInline
- public ByteMaxVector add(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector add(Vector<Byte> v, VectorMask<Byte> m) {
return blend(add(v), m);
}
@Override
@ForceInline
@@ -546,11 +546,11 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte)(a - b)));
}
@Override
@ForceInline
- public ByteMaxVector sub(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector sub(Vector<Byte> v, VectorMask<Byte> m) {
return blend(sub(v), m);
}
@Override
@ForceInline
@@ -563,11 +563,11 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte)(a * b)));
}
@Override
@ForceInline
- public ByteMaxVector mul(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector mul(Vector<Byte> v, VectorMask<Byte> m) {
return blend(mul(v), m);
}
@Override
@ForceInline
@@ -580,11 +580,11 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte) Math.min(a, b)));
}
@Override
@ForceInline
- public ByteMaxVector min(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector min(Vector<Byte> v, VectorMask<Byte> m) {
return blend(min(v), m);
}
@Override
@ForceInline
@@ -597,11 +597,11 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte) Math.max(a, b)));
}
@Override
@ForceInline
- public ByteMaxVector max(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector max(Vector<Byte> v, VectorMask<Byte> m) {
return blend(max(v), m);
}
@Override
@ForceInline
@@ -636,23 +636,23 @@
(v1, v2) -> v1.bOp(v2, (i, a, b) -> (byte)(a ^ b)));
}
@Override
@ForceInline
- public ByteMaxVector and(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector and(Vector<Byte> v, VectorMask<Byte> m) {
return blend(and(v), m);
}
@Override
@ForceInline
- public ByteMaxVector or(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector or(Vector<Byte> v, VectorMask<Byte> m) {
return blend(or(v), m);
}
@Override
@ForceInline
- public ByteMaxVector xor(Vector<Byte> v, Mask<Byte> m) {
+ public ByteMaxVector xor(Vector<Byte> v, VectorMask<Byte> m) {
return blend(xor(v), m);
}
@Override
@ForceInline
@@ -663,11 +663,11 @@
(v, i) -> v.uOp((__, a) -> (byte) (a << (i & 7))));
}
@Override
@ForceInline
- public ByteMaxVector shiftL(int s, Mask<Byte> m) {
+ public ByteMaxVector shiftL(int s, VectorMask<Byte> m) {
return blend(shiftL(s), m);
}
@Override
@ForceInline
@@ -678,11 +678,11 @@
(v, i) -> v.uOp((__, a) -> (byte) ((a & 0xFF) >>> (i & 7))));
}
@Override
@ForceInline
- public ByteMaxVector shiftR(int s, Mask<Byte> m) {
+ public ByteMaxVector shiftR(int s, VectorMask<Byte> m) {
return blend(shiftR(s), m);
}
@Override
@ForceInline
@@ -693,11 +693,11 @@
(v, i) -> v.uOp((__, a) -> (byte) (a >> (i & 7))));
}
@Override
@ForceInline
- public ByteMaxVector aShiftR(int s, Mask<Byte> m) {
+ public ByteMaxVector aShiftR(int s, VectorMask<Byte> m) {
return blend(aShiftR(s), m);
}
// Ternary operations
@@ -721,11 +721,11 @@
v -> (long) v.rOp((byte) -1, (i, a, b) -> (byte) (a & b)));
}
@Override
@ForceInline
- public byte andAll(Mask<Byte> m) {
+ public byte andAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, (byte) -1), m).andAll();
}
@Override
@ForceInline
@@ -763,11 +763,11 @@
v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a | b)));
}
@Override
@ForceInline
- public byte orAll(Mask<Byte> m) {
+ public byte orAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, (byte) 0), m).orAll();
}
@Override
@ForceInline
@@ -778,49 +778,49 @@
v -> (long) v.rOp((byte) 0, (i, a, b) -> (byte) (a ^ b)));
}
@Override
@ForceInline
- public byte xorAll(Mask<Byte> m) {
+ public byte xorAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, (byte) 0), m).xorAll();
}
@Override
@ForceInline
- public byte addAll(Mask<Byte> m) {
+ public byte addAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, (byte) 0), m).addAll();
}
@Override
@ForceInline
- public byte mulAll(Mask<Byte> m) {
+ public byte mulAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, (byte) 1), m).mulAll();
}
@Override
@ForceInline
- public byte minAll(Mask<Byte> m) {
+ public byte minAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, Byte.MAX_VALUE), m).minAll();
}
@Override
@ForceInline
- public byte maxAll(Mask<Byte> m) {
+ public byte maxAll(VectorMask<Byte> m) {
return blend((ByteMaxVector)ByteVector.broadcast(SPECIES, Byte.MIN_VALUE), m).maxAll();
}
@Override
@ForceInline
- public Shuffle<Byte> toShuffle() {
+ public VectorShuffle<Byte> toShuffle() {
byte[] a = toArray();
int[] sa = new int[a.length];
for (int i = 0; i < a.length; i++) {
sa[i] = (int) a[i];
}
- return ByteVector.shuffleFromArray(SPECIES, sa, 0);
+ return VectorShuffle.fromArray(SPECIES, sa, 0);
}
// Memory operations
private static final int ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(Unsafe.ARRAY_BYTE_INDEX_SCALE);
@@ -838,11 +838,11 @@
(arr, idx, v) -> v.forEach((i, e) -> arr[idx + i] = e));
}
@Override
@ForceInline
- public final void intoArray(byte[] a, int ax, Mask<Byte> m) {
+ public final void intoArray(byte[] a, int ax, VectorMask<Byte> m) {
ByteVector oldVal = ByteVector.fromArray(SPECIES, a, ax);
ByteVector newVal = oldVal.blend(this, m);
newVal.intoArray(a, ax);
}
@@ -862,11 +862,11 @@
});
}
@Override
@ForceInline
- public final void intoByteArray(byte[] a, int ix, Mask<Byte> m) {
+ public final void intoByteArray(byte[] a, int ix, VectorMask<Byte> m) {
ByteMaxVector oldVal = (ByteMaxVector) ByteVector.fromByteArray(SPECIES, a, ix);
ByteMaxVector newVal = oldVal.blend(this, m);
newVal.intoByteArray(a, ix);
}
@@ -891,11 +891,11 @@
});
}
@Override
@ForceInline
- public void intoByteBuffer(ByteBuffer bb, int ix, Mask<Byte> m) {
+ public void intoByteBuffer(ByteBuffer bb, int ix, VectorMask<Byte> m) {
ByteMaxVector oldVal = (ByteMaxVector) ByteVector.fromByteBuffer(SPECIES, bb, ix);
ByteMaxVector newVal = oldVal.blend(this, m);
newVal.intoByteBuffer(bb, ix);
}
@@ -1016,11 +1016,11 @@
f.apply(i, vec[i]);
}
}
@Override
- void forEach(Mask<Byte> o, FUnCon f) {
+ void forEach(VectorMask<Byte> o, FUnCon f) {
boolean[] mbits = ((ByteMaxMask)o).getBits();
forEach((i, a) -> {
if (mbits[i]) { f.apply(i, a); }
});
}
@@ -1073,17 +1073,17 @@
}
@Override
@ForceInline
public ByteMaxVector rearrange(Vector<Byte> v,
- Shuffle<Byte> s, Mask<Byte> m) {
+ VectorShuffle<Byte> s, VectorMask<Byte> m) {
return this.rearrange(s).blend(v.rearrange(s), m);
}
@Override
@ForceInline
- public ByteMaxVector rearrange(Shuffle<Byte> o1) {
+ public ByteMaxVector rearrange(VectorShuffle<Byte> o1) {
Objects.requireNonNull(o1);
ByteMaxShuffle s = (ByteMaxShuffle)o1;
return VectorIntrinsics.rearrangeOp(
ByteMaxVector.class, ByteMaxShuffle.class, byte.class, LENGTH,
@@ -1094,11 +1094,11 @@
}));
}
@Override
@ForceInline
- public ByteMaxVector blend(Vector<Byte> o1, Mask<Byte> o2) {
+ public ByteMaxVector blend(Vector<Byte> o1, VectorMask<Byte> o2) {
Objects.requireNonNull(o1);
Objects.requireNonNull(o2);
ByteMaxVector v = (ByteMaxVector)o1;
ByteMaxMask m = (ByteMaxMask)o2;
@@ -1178,22 +1178,22 @@
}
return new ByteMaxMask(res);
}
@Override
- ByteMaxMask bOp(Mask<Byte> o, MBinOp f) {
+ ByteMaxMask bOp(VectorMask<Byte> o, MBinOp f) {
boolean[] res = new boolean[species().length()];
boolean[] bits = getBits();
boolean[] mbits = ((ByteMaxMask)o).getBits();
for (int i = 0; i < species().length(); i++) {
res[i] = f.apply(i, bits[i], mbits[i]);
}
return new ByteMaxMask(res);
}
@Override
- public Species<Byte> species() {
+ public VectorSpecies<Byte> species() {
return SPECIES;
}
@Override
public ByteMaxVector toVector() {
@@ -1208,27 +1208,27 @@
}
@Override
@ForceInline
@SuppressWarnings("unchecked")
- public <E> Mask<E> cast(Species<E> species) {
+ public <E> VectorMask<E> cast(VectorSpecies<E> 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 <E>) new ByteMaxVector.ByteMaxMask(maskArray);
+ return (VectorMask <E>) new ByteMaxVector.ByteMaxMask(maskArray);
} else if (stype == short.class) {
- return (Mask <E>) new ShortMaxVector.ShortMaxMask(maskArray);
+ return (VectorMask <E>) new ShortMaxVector.ShortMaxMask(maskArray);
} else if (stype == int.class) {
- return (Mask <E>) new IntMaxVector.IntMaxMask(maskArray);
+ return (VectorMask <E>) new IntMaxVector.IntMaxMask(maskArray);
} else if (stype == long.class) {
- return (Mask <E>) new LongMaxVector.LongMaxMask(maskArray);
+ return (VectorMask <E>) new LongMaxVector.LongMaxMask(maskArray);
} else if (stype == float.class) {
- return (Mask <E>) new FloatMaxVector.FloatMaxMask(maskArray);
+ return (VectorMask <E>) new FloatMaxVector.FloatMaxMask(maskArray);
} else if (stype == double.class) {
- return (Mask <E>) new DoubleMaxVector.DoubleMaxMask(maskArray);
+ return (VectorMask <E>) new DoubleMaxVector.DoubleMaxMask(maskArray);
} else {
throw new UnsupportedOperationException("Bad lane type for casting.");
}
}
@@ -1245,21 +1245,21 @@
// Binary operations
@Override
@ForceInline
- public ByteMaxMask and(Mask<Byte> o) {
+ public ByteMaxMask and(VectorMask<Byte> o) {
Objects.requireNonNull(o);
ByteMaxMask m = (ByteMaxMask)o;
return VectorIntrinsics.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, byte.class, LENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ForceInline
- public ByteMaxMask or(Mask<Byte> o) {
+ public ByteMaxMask or(VectorMask<Byte> o) {
Objects.requireNonNull(o);
ByteMaxMask m = (ByteMaxMask)o;
return VectorIntrinsics.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, byte.class, LENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
@@ -1277,11 +1277,11 @@
@Override
@ForceInline
public boolean allTrue() {
return VectorIntrinsics.test(BT_overflow, ByteMaxMask.class, byte.class, LENGTH,
- this, ByteVector.maskAllTrue(species()),
+ this, VectorMask.maskAllTrue(species()),
(m, __) -> allTrueHelper(((ByteMaxMask)m).getBits()));
}
}
// Shuffle
@@ -1302,11 +1302,11 @@
public ByteMaxShuffle(IntUnaryOperator f) {
super(f);
}
@Override
- public Species<Byte> species() {
+ public VectorSpecies<Byte> species() {
return SPECIES;
}
@Override
public ByteVector toVector() {
@@ -1318,45 +1318,45 @@
}
@Override
@ForceInline
@SuppressWarnings("unchecked")
- public <F> Shuffle<F> cast(Species<F> species) {
+ public <F> VectorShuffle<F> cast(VectorSpecies<F> 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<F>) new ByteMaxVector.ByteMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new ByteMaxVector.ByteMaxShuffle(shuffleArray);
} else if (stype == short.class) {
- return (Shuffle<F>) new ShortMaxVector.ShortMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new ShortMaxVector.ShortMaxShuffle(shuffleArray);
} else if (stype == int.class) {
- return (Shuffle<F>) new IntMaxVector.IntMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new IntMaxVector.IntMaxShuffle(shuffleArray);
} else if (stype == long.class) {
- return (Shuffle<F>) new LongMaxVector.LongMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new LongMaxVector.LongMaxShuffle(shuffleArray);
} else if (stype == float.class) {
- return (Shuffle<F>) new FloatMaxVector.FloatMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new FloatMaxVector.FloatMaxShuffle(shuffleArray);
} else if (stype == double.class) {
- return (Shuffle<F>) new DoubleMaxVector.DoubleMaxShuffle(shuffleArray);
+ return (VectorShuffle<F>) new DoubleMaxVector.DoubleMaxShuffle(shuffleArray);
} else {
throw new UnsupportedOperationException("Bad lane type for casting.");
}
}
@Override
- public ByteMaxShuffle rearrange(Vector.Shuffle<Byte> o) {
+ public ByteMaxShuffle rearrange(VectorShuffle<Byte> o) {
ByteMaxShuffle s = (ByteMaxShuffle) o;
byte[] r = new byte[reorder.length];
for (int i = 0; i < reorder.length; i++) {
r[i] = reorder[s.reorder[i]];
}
return new ByteMaxShuffle(r);
}
}
- // Species
+ // VectorSpecies
@Override
- public Species<Byte> species() {
+ public VectorSpecies<Byte> species() {
return SPECIES;
}
}
< prev index next >