8271515: Integration of JEP 417: Vector API (Third Incubator)

Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Co-authored-by: Jatin Bhateja <jbhateja@openjdk.org>
Co-authored-by: Ningsheng Jian <njian@openjdk.org>
Co-authored-by: Xiaohong Gong <xgong@openjdk.org>
Co-authored-by: Eric Liu <eliu@openjdk.org>
Co-authored-by: Jie Fu <jiefu@openjdk.org>
Co-authored-by: Vladimir Ivanov <vlivanov@openjdk.org>
Co-authored-by: John R Rose <jrose@openjdk.org>
Co-authored-by: Paul Sandoz <psandoz@openjdk.org>
Co-authored-by: Rado Smogura <mail@smogura.eu>
Reviewed-by: kvn, sviswanathan, ngasson
This commit is contained in:
Paul Sandoz 2021-11-15 21:48:38 +00:00
parent 9326eb1461
commit a59c9b2ac2
104 changed files with 20106 additions and 5976 deletions

View file

@ -24,6 +24,8 @@
*/
package jdk.incubator.vector;
import java.util.Objects;
import jdk.internal.vm.annotation.ForceInline;
import static jdk.incubator.vector.VectorOperators.*;
@ -62,24 +64,15 @@ abstract class AbstractMask<E> extends VectorMask<E> {
}
@Override
@ForceInline
public boolean laneIsSet(int i) {
return getBits()[i];
}
@Override
public long toLong() {
// FIXME: This should be an intrinsic.
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
int length = length();
Objects.checkIndex(i, length);
if (length <= Long.SIZE) {
return ((toLong() >>> i) & 1L) == 1;
} else {
return getBits()[i];
}
long res = 0;
long set = 1;
boolean[] bits = getBits();
for (int i = 0; i < bits.length; i++) {
res = bits[i] ? res | set : res;
set = set << 1;
}
return res;
}
@Override
@ -114,6 +107,23 @@ abstract class AbstractMask<E> extends VectorMask<E> {
return (VectorMask<F>) this;
}
@Override
@ForceInline
@SuppressWarnings("unchecked")
<F> VectorMask<F> check(Class<? extends VectorMask<F>> maskClass, Vector<F> vector) {
if (!sameSpecies(maskClass, vector)) {
throw AbstractSpecies.checkFailed(this, vector);
}
return (VectorMask<F>) this;
}
@ForceInline
private <F> boolean sameSpecies(Class<? extends VectorMask<F>> maskClass, Vector<F> vector) {
boolean same = getClass() == maskClass;
assert (same == (vectorSpecies() == vector.species())) : same;
return same;
}
@Override
public VectorMask<E> andNot(VectorMask<E> m) {
return and(m.not());
@ -162,6 +172,17 @@ abstract class AbstractMask<E> extends VectorMask<E> {
return -1;
}
/*package-private*/
static long toLongHelper(boolean[] bits) {
long res = 0;
long set = 1;
for (int i = 0; i < bits.length; i++) {
res = bits[i] ? res | set : res;
set = set << 1;
}
return res;
}
@Override
@ForceInline
public VectorMask<E> indexInRange(int offset, int limit) {
@ -215,14 +236,10 @@ abstract class AbstractMask<E> extends VectorMask<E> {
int elemCount = Math.min(vlength, (alength - offset) / esize);
badMask = checkIndex0(0, elemCount, iota, vlength);
} else {
// This requires a split test.
int clipOffset = Math.max(offset, -(vlength * esize));
int elemCount = Math.min(vlength, (alength - clipOffset) / esize);
badMask = checkIndex0(0, elemCount, iota, vlength);
clipOffset &= (esize - 1); // power of two, so OK
VectorMask<E> badMask2 = checkIndex0(clipOffset / esize, vlength,
iota, vlength);
badMask = badMask.or(badMask2);
badMask = checkIndex0(clipOffset, alength,
iota.lanewise(VectorOperators.MUL, esize),
vlength * esize);
}
badMask = badMask.and(this);
if (badMask.anyTrue()) {

View file

@ -236,8 +236,8 @@ final class Byte128Vector extends ByteVector {
@ForceInline
final @Override
byte rOp(byte v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Byte128Vector extends ByteVector {
return (Byte128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Byte128Vector lanewise(Unary op, VectorMask<Byte> m) {
return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialize
}
@Override
@ForceInline
public Byte128Vector lanewise(Binary op, Vector<Byte> v) {
return (Byte128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Byte128Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v, (Byte128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Byte128Vector
@ -286,15 +298,30 @@ final class Byte128Vector extends ByteVector {
return (Byte128Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Byte128Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
return (Byte128Vector) super.lanewiseShiftTemplate(op, Byte128Mask.class, e, (Byte128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Byte128Vector
lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
return (Byte128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Byte128Vector
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v1, v2, (Byte128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Byte128Vector extends ByteVector {
@ForceInline
public final byte reduceLanes(VectorOperators.Associative op,
VectorMask<Byte> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Byte128Vector extends ByteVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Byte> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Byte128Vector extends ByteVector {
return super.compareTemplate(Byte128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Byte128Mask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
return super.compareTemplate(Byte128Mask.class, op, v, (Byte128Mask) m);
}
@Override
@ForceInline
public Byte128Vector blend(Vector<Byte> v, VectorMask<Byte> m) {
@ -419,6 +453,7 @@ final class Byte128Vector extends ByteVector {
VectorMask<Byte> m) {
return (Byte128Vector)
super.rearrangeTemplate(Byte128Shuffle.class,
Byte128Mask.class,
(Byte128Shuffle) shuffle,
(Byte128Mask) m); // specialize
}
@ -612,16 +647,12 @@ final class Byte128Vector extends ByteVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Byte128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -647,9 +678,9 @@ final class Byte128Vector extends ByteVector {
public Byte128Mask and(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte128Mask m = (Byte128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte128Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte128Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -657,9 +688,9 @@ final class Byte128Vector extends ByteVector {
public Byte128Mask or(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte128Mask m = (Byte128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte128Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte128Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -667,9 +698,9 @@ final class Byte128Vector extends ByteVector {
Byte128Mask xor(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte128Mask m = (Byte128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte128Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte128Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -677,22 +708,32 @@ final class Byte128Vector extends ByteVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(((Byte128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(((Byte128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(((Byte128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte128Mask.class, byte.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -803,6 +844,14 @@ final class Byte128Vector extends ByteVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize
}
@ForceInline
@Override
@ -811,6 +860,13 @@ final class Byte128Vector extends ByteVector {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
return super.fromBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -818,6 +874,13 @@ final class Byte128Vector extends ByteVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromByteArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -825,6 +888,13 @@ final class Byte128Vector extends ByteVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
return super.fromByteBuffer0Template(Byte128Mask.class, bb, offset, (Byte128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -832,6 +902,21 @@ final class Byte128Vector extends ByteVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m);
}
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
super.intoBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m);
}
@ForceInline
@Override
final
@ -839,6 +924,21 @@ final class Byte128Vector extends ByteVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoByteArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
super.intoByteBuffer0Template(Byte128Mask.class, bb, offset, (Byte128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Byte256Vector extends ByteVector {
@ForceInline
final @Override
byte rOp(byte v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Byte256Vector extends ByteVector {
return (Byte256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Byte256Vector lanewise(Unary op, VectorMask<Byte> m) {
return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialize
}
@Override
@ForceInline
public Byte256Vector lanewise(Binary op, Vector<Byte> v) {
return (Byte256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Byte256Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v, (Byte256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Byte256Vector
@ -286,15 +298,30 @@ final class Byte256Vector extends ByteVector {
return (Byte256Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Byte256Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
return (Byte256Vector) super.lanewiseShiftTemplate(op, Byte256Mask.class, e, (Byte256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Byte256Vector
lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
return (Byte256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Byte256Vector
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v1, v2, (Byte256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Byte256Vector extends ByteVector {
@ForceInline
public final byte reduceLanes(VectorOperators.Associative op,
VectorMask<Byte> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Byte256Vector extends ByteVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Byte> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Byte256Vector extends ByteVector {
return super.compareTemplate(Byte256Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Byte256Mask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
return super.compareTemplate(Byte256Mask.class, op, v, (Byte256Mask) m);
}
@Override
@ForceInline
public Byte256Vector blend(Vector<Byte> v, VectorMask<Byte> m) {
@ -419,6 +453,7 @@ final class Byte256Vector extends ByteVector {
VectorMask<Byte> m) {
return (Byte256Vector)
super.rearrangeTemplate(Byte256Shuffle.class,
Byte256Mask.class,
(Byte256Shuffle) shuffle,
(Byte256Mask) m); // specialize
}
@ -644,16 +679,12 @@ final class Byte256Vector extends ByteVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Byte256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -679,9 +710,9 @@ final class Byte256Vector extends ByteVector {
public Byte256Mask and(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte256Mask m = (Byte256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -689,9 +720,9 @@ final class Byte256Vector extends ByteVector {
public Byte256Mask or(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte256Mask m = (Byte256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -699,9 +730,9 @@ final class Byte256Vector extends ByteVector {
Byte256Mask xor(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte256Mask m = (Byte256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -709,22 +740,32 @@ final class Byte256Vector extends ByteVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(((Byte256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(((Byte256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(((Byte256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte256Mask.class, byte.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -835,6 +876,14 @@ final class Byte256Vector extends ByteVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
}
@ForceInline
@Override
@ -843,6 +892,13 @@ final class Byte256Vector extends ByteVector {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
return super.fromBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -850,6 +906,13 @@ final class Byte256Vector extends ByteVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -857,6 +920,13 @@ final class Byte256Vector extends ByteVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
return super.fromByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -864,6 +934,21 @@ final class Byte256Vector extends ByteVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
}
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m);
}
@ForceInline
@Override
final
@ -871,6 +956,21 @@ final class Byte256Vector extends ByteVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
super.intoByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Byte512Vector extends ByteVector {
@ForceInline
final @Override
byte rOp(byte v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Byte512Vector extends ByteVector {
return (Byte512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Byte512Vector lanewise(Unary op, VectorMask<Byte> m) {
return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialize
}
@Override
@ForceInline
public Byte512Vector lanewise(Binary op, Vector<Byte> v) {
return (Byte512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Byte512Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v, (Byte512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Byte512Vector
@ -286,15 +298,30 @@ final class Byte512Vector extends ByteVector {
return (Byte512Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Byte512Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
return (Byte512Vector) super.lanewiseShiftTemplate(op, Byte512Mask.class, e, (Byte512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Byte512Vector
lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
return (Byte512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Byte512Vector
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v1, v2, (Byte512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Byte512Vector extends ByteVector {
@ForceInline
public final byte reduceLanes(VectorOperators.Associative op,
VectorMask<Byte> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Byte512Vector extends ByteVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Byte> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Byte512Vector extends ByteVector {
return super.compareTemplate(Byte512Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Byte512Mask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
return super.compareTemplate(Byte512Mask.class, op, v, (Byte512Mask) m);
}
@Override
@ForceInline
public Byte512Vector blend(Vector<Byte> v, VectorMask<Byte> m) {
@ -419,6 +453,7 @@ final class Byte512Vector extends ByteVector {
VectorMask<Byte> m) {
return (Byte512Vector)
super.rearrangeTemplate(Byte512Shuffle.class,
Byte512Mask.class,
(Byte512Shuffle) shuffle,
(Byte512Mask) m); // specialize
}
@ -708,16 +743,12 @@ final class Byte512Vector extends ByteVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Byte512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -743,9 +774,9 @@ final class Byte512Vector extends ByteVector {
public Byte512Mask and(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte512Mask m = (Byte512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -753,9 +784,9 @@ final class Byte512Vector extends ByteVector {
public Byte512Mask or(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte512Mask m = (Byte512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -763,9 +794,9 @@ final class Byte512Vector extends ByteVector {
Byte512Mask xor(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte512Mask m = (Byte512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -773,22 +804,32 @@ final class Byte512Vector extends ByteVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(((Byte512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(((Byte512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(((Byte512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte512Mask.class, byte.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -899,6 +940,14 @@ final class Byte512Vector extends ByteVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize
}
@ForceInline
@Override
@ -907,6 +956,13 @@ final class Byte512Vector extends ByteVector {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
return super.fromBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -914,6 +970,13 @@ final class Byte512Vector extends ByteVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -921,6 +984,13 @@ final class Byte512Vector extends ByteVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
return super.fromByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -928,6 +998,21 @@ final class Byte512Vector extends ByteVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);
}
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
super.intoBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m);
}
@ForceInline
@Override
final
@ -935,6 +1020,21 @@ final class Byte512Vector extends ByteVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
super.intoByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Byte64Vector extends ByteVector {
@ForceInline
final @Override
byte rOp(byte v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Byte64Vector extends ByteVector {
return (Byte64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Byte64Vector lanewise(Unary op, VectorMask<Byte> m) {
return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialize
}
@Override
@ForceInline
public Byte64Vector lanewise(Binary op, Vector<Byte> v) {
return (Byte64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Byte64Vector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v, (Byte64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Byte64Vector
@ -286,15 +298,30 @@ final class Byte64Vector extends ByteVector {
return (Byte64Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Byte64Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
return (Byte64Vector) super.lanewiseShiftTemplate(op, Byte64Mask.class, e, (Byte64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Byte64Vector
lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
return (Byte64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Byte64Vector
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v1, v2, (Byte64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Byte64Vector extends ByteVector {
@ForceInline
public final byte reduceLanes(VectorOperators.Associative op,
VectorMask<Byte> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Byte64Vector extends ByteVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Byte> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Byte64Vector extends ByteVector {
return super.compareTemplate(Byte64Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Byte64Mask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
return super.compareTemplate(Byte64Mask.class, op, v, (Byte64Mask) m);
}
@Override
@ForceInline
public Byte64Vector blend(Vector<Byte> v, VectorMask<Byte> m) {
@ -419,6 +453,7 @@ final class Byte64Vector extends ByteVector {
VectorMask<Byte> m) {
return (Byte64Vector)
super.rearrangeTemplate(Byte64Shuffle.class,
Byte64Mask.class,
(Byte64Shuffle) shuffle,
(Byte64Mask) m); // specialize
}
@ -596,16 +631,12 @@ final class Byte64Vector extends ByteVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Byte64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -631,9 +662,9 @@ final class Byte64Vector extends ByteVector {
public Byte64Mask and(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte64Mask m = (Byte64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -641,9 +672,9 @@ final class Byte64Vector extends ByteVector {
public Byte64Mask or(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte64Mask m = (Byte64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -651,9 +682,9 @@ final class Byte64Vector extends ByteVector {
Byte64Mask xor(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte64Mask m = (Byte64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -661,22 +692,32 @@ final class Byte64Vector extends ByteVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(((Byte64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(((Byte64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(((Byte64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte64Mask.class, byte.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -787,6 +828,14 @@ final class Byte64Vector extends ByteVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize
}
@ForceInline
@Override
@ -795,6 +844,13 @@ final class Byte64Vector extends ByteVector {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
return super.fromBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -802,6 +858,13 @@ final class Byte64Vector extends ByteVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -809,6 +872,13 @@ final class Byte64Vector extends ByteVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
return super.fromByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -816,6 +886,21 @@ final class Byte64Vector extends ByteVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);
}
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
super.intoBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m);
}
@ForceInline
@Override
final
@ -823,6 +908,21 @@ final class Byte64Vector extends ByteVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
super.intoByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class ByteMaxVector extends ByteVector {
@ForceInline
final @Override
byte rOp(byte v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
byte rOp(byte v, VectorMask<Byte> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class ByteMaxVector extends ByteVector {
return (ByteMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public ByteMaxVector lanewise(Unary op, VectorMask<Byte> m) {
return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialize
}
@Override
@ForceInline
public ByteMaxVector lanewise(Binary op, Vector<Byte> v) {
return (ByteMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public ByteMaxVector lanewise(Binary op, Vector<Byte> v, VectorMask<Byte> m) {
return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v, (ByteMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline ByteMaxVector
@ -286,15 +298,30 @@ final class ByteMaxVector extends ByteVector {
return (ByteMaxVector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline ByteMaxVector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Byte> m) {
return (ByteMaxVector) super.lanewiseShiftTemplate(op, ByteMaxMask.class, e, (ByteMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
ByteMaxVector
lanewise(VectorOperators.Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2) {
return (ByteMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
ByteMaxVector
lanewise(Ternary op, Vector<Byte> v1, Vector<Byte> v2, VectorMask<Byte> m) {
return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v1, v2, (ByteMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class ByteMaxVector extends ByteVector {
@ForceInline
public final byte reduceLanes(VectorOperators.Associative op,
VectorMask<Byte> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class ByteMaxVector extends ByteVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Byte> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class ByteMaxVector extends ByteVector {
return super.compareTemplate(ByteMaxMask.class, op, s); // specialize
}
@Override
@ForceInline
public final ByteMaxMask compare(Comparison op, Vector<Byte> v, VectorMask<Byte> m) {
return super.compareTemplate(ByteMaxMask.class, op, v, (ByteMaxMask) m);
}
@Override
@ForceInline
public ByteMaxVector blend(Vector<Byte> v, VectorMask<Byte> m) {
@ -419,6 +453,7 @@ final class ByteMaxVector extends ByteVector {
VectorMask<Byte> m) {
return (ByteMaxVector)
super.rearrangeTemplate(ByteMaxShuffle.class,
ByteMaxMask.class,
(ByteMaxShuffle) shuffle,
(ByteMaxMask) m); // specialize
}
@ -582,16 +617,12 @@ final class ByteMaxVector extends ByteVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
ByteMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -617,9 +648,9 @@ final class ByteMaxVector extends ByteVector {
public ByteMaxMask and(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
ByteMaxMask m = (ByteMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -627,9 +658,9 @@ final class ByteMaxVector extends ByteVector {
public ByteMaxMask or(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
ByteMaxMask m = (ByteMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -637,9 +668,9 @@ final class ByteMaxVector extends ByteVector {
ByteMaxMask xor(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
ByteMaxMask m = (ByteMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaxMask.class, byte.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaxMask.class, null, byte.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -647,22 +678,32 @@ final class ByteMaxVector extends ByteVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(((ByteMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(((ByteMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(((ByteMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMaxMask.class, byte.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -773,6 +814,14 @@ final class ByteMaxVector extends ByteVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
}
@ForceInline
@Override
@ -781,6 +830,13 @@ final class ByteMaxVector extends ByteVector {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
return super.fromBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -788,6 +844,13 @@ final class ByteMaxVector extends ByteVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
return super.fromByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -795,6 +858,13 @@ final class ByteMaxVector extends ByteVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
return super.fromByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -802,6 +872,21 @@ final class ByteMaxVector extends ByteVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
}
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<Byte> m) {
super.intoBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m);
}
@ForceInline
@Override
final
@ -809,6 +894,21 @@ final class ByteMaxVector extends ByteVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Byte> m) {
super.intoByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Byte> m) {
super.intoByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Double128Vector extends DoubleVector {
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
double rOp(double v, VectorMask<Double> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Double128Vector extends DoubleVector {
return (Double128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Double128Vector lanewise(Unary op, VectorMask<Double> m) {
return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, (Double128Mask) m); // specialize
}
@Override
@ForceInline
public Double128Vector lanewise(Binary op, Vector<Double> v) {
return (Double128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Double128Vector lanewise(Binary op, Vector<Double> v, VectorMask<Double> m) {
return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v, (Double128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Double128Vector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (Double128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Double128Vector
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2, VectorMask<Double> m) {
return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v1, v2, (Double128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Double128Vector extends DoubleVector {
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Double128Vector extends DoubleVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Double128Vector extends DoubleVector {
return super.compareTemplate(Double128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Double128Mask compare(Comparison op, Vector<Double> v, VectorMask<Double> m) {
return super.compareTemplate(Double128Mask.class, op, v, (Double128Mask) m);
}
@Override
@ForceInline
public Double128Vector blend(Vector<Double> v, VectorMask<Double> m) {
@ -413,6 +440,7 @@ final class Double128Vector extends DoubleVector {
VectorMask<Double> m) {
return (Double128Vector)
super.rearrangeTemplate(Double128Shuffle.class,
Double128Mask.class,
(Double128Shuffle) shuffle,
(Double128Mask) m); // specialize
}
@ -580,16 +608,12 @@ final class Double128Vector extends DoubleVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Double128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -615,9 +639,9 @@ final class Double128Vector extends DoubleVector {
public Double128Mask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -625,9 +649,9 @@ final class Double128Vector extends DoubleVector {
public Double128Mask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -635,9 +659,9 @@ final class Double128Vector extends DoubleVector {
Double128Mask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -645,22 +669,32 @@ final class Double128Vector extends DoubleVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double128Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Double128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double128Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double128Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Double128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double128Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double128Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Double128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double128Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double128Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -771,6 +805,20 @@ final class Double128Vector extends DoubleVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, VectorMask<Double> m) {
return super.fromArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
return super.fromArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m);
}
@ForceInline
@ -780,6 +828,13 @@ final class Double128Vector extends DoubleVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset, VectorMask<Double> m) {
return super.fromByteArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -787,6 +842,13 @@ final class Double128Vector extends DoubleVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
return super.fromByteBuffer0Template(Double128Mask.class, bb, offset, (Double128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -794,6 +856,21 @@ final class Double128Vector extends DoubleVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, VectorMask<Double> m) {
super.intoArray0Template(Double128Mask.class, a, offset, (Double128Mask) m);
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
super.intoArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m);
}
@ForceInline
@Override
final
@ -801,6 +878,21 @@ final class Double128Vector extends DoubleVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Double> m) {
super.intoByteArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
super.intoByteBuffer0Template(Double128Mask.class, bb, offset, (Double128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Double256Vector extends DoubleVector {
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
double rOp(double v, VectorMask<Double> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Double256Vector extends DoubleVector {
return (Double256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Double256Vector lanewise(Unary op, VectorMask<Double> m) {
return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, (Double256Mask) m); // specialize
}
@Override
@ForceInline
public Double256Vector lanewise(Binary op, Vector<Double> v) {
return (Double256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Double256Vector lanewise(Binary op, Vector<Double> v, VectorMask<Double> m) {
return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v, (Double256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Double256Vector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (Double256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Double256Vector
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2, VectorMask<Double> m) {
return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v1, v2, (Double256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Double256Vector extends DoubleVector {
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Double256Vector extends DoubleVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Double256Vector extends DoubleVector {
return super.compareTemplate(Double256Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Double256Mask compare(Comparison op, Vector<Double> v, VectorMask<Double> m) {
return super.compareTemplate(Double256Mask.class, op, v, (Double256Mask) m);
}
@Override
@ForceInline
public Double256Vector blend(Vector<Double> v, VectorMask<Double> m) {
@ -413,6 +440,7 @@ final class Double256Vector extends DoubleVector {
VectorMask<Double> m) {
return (Double256Vector)
super.rearrangeTemplate(Double256Shuffle.class,
Double256Mask.class,
(Double256Shuffle) shuffle,
(Double256Mask) m); // specialize
}
@ -584,16 +612,12 @@ final class Double256Vector extends DoubleVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Double256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -619,9 +643,9 @@ final class Double256Vector extends DoubleVector {
public Double256Mask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double256Mask m = (Double256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Double256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Double256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -629,9 +653,9 @@ final class Double256Vector extends DoubleVector {
public Double256Mask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double256Mask m = (Double256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Double256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Double256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -639,9 +663,9 @@ final class Double256Vector extends DoubleVector {
Double256Mask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double256Mask m = (Double256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -649,22 +673,32 @@ final class Double256Vector extends DoubleVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double256Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Double256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double256Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double256Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Double256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double256Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double256Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Double256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double256Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double256Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -775,6 +809,20 @@ final class Double256Vector extends DoubleVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, VectorMask<Double> m) {
return super.fromArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
return super.fromArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m);
}
@ForceInline
@ -784,6 +832,13 @@ final class Double256Vector extends DoubleVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset, VectorMask<Double> m) {
return super.fromByteArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -791,6 +846,13 @@ final class Double256Vector extends DoubleVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
return super.fromByteBuffer0Template(Double256Mask.class, bb, offset, (Double256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -798,6 +860,21 @@ final class Double256Vector extends DoubleVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, VectorMask<Double> m) {
super.intoArray0Template(Double256Mask.class, a, offset, (Double256Mask) m);
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
super.intoArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m);
}
@ForceInline
@Override
final
@ -805,6 +882,21 @@ final class Double256Vector extends DoubleVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Double> m) {
super.intoByteArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
super.intoByteBuffer0Template(Double256Mask.class, bb, offset, (Double256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Double512Vector extends DoubleVector {
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
double rOp(double v, VectorMask<Double> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Double512Vector extends DoubleVector {
return (Double512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Double512Vector lanewise(Unary op, VectorMask<Double> m) {
return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, (Double512Mask) m); // specialize
}
@Override
@ForceInline
public Double512Vector lanewise(Binary op, Vector<Double> v) {
return (Double512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Double512Vector lanewise(Binary op, Vector<Double> v, VectorMask<Double> m) {
return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v, (Double512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Double512Vector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (Double512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Double512Vector
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2, VectorMask<Double> m) {
return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v1, v2, (Double512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Double512Vector extends DoubleVector {
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Double512Vector extends DoubleVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Double512Vector extends DoubleVector {
return super.compareTemplate(Double512Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Double512Mask compare(Comparison op, Vector<Double> v, VectorMask<Double> m) {
return super.compareTemplate(Double512Mask.class, op, v, (Double512Mask) m);
}
@Override
@ForceInline
public Double512Vector blend(Vector<Double> v, VectorMask<Double> m) {
@ -413,6 +440,7 @@ final class Double512Vector extends DoubleVector {
VectorMask<Double> m) {
return (Double512Vector)
super.rearrangeTemplate(Double512Shuffle.class,
Double512Mask.class,
(Double512Shuffle) shuffle,
(Double512Mask) m); // specialize
}
@ -592,16 +620,12 @@ final class Double512Vector extends DoubleVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Double512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -627,9 +651,9 @@ final class Double512Vector extends DoubleVector {
public Double512Mask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double512Mask m = (Double512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Double512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Double512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -637,9 +661,9 @@ final class Double512Vector extends DoubleVector {
public Double512Mask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double512Mask m = (Double512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Double512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Double512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -647,9 +671,9 @@ final class Double512Vector extends DoubleVector {
Double512Mask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double512Mask m = (Double512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -657,22 +681,32 @@ final class Double512Vector extends DoubleVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double512Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Double512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double512Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double512Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Double512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double512Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double512Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Double512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double512Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double512Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -783,6 +817,20 @@ final class Double512Vector extends DoubleVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, VectorMask<Double> m) {
return super.fromArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
return super.fromArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m);
}
@ForceInline
@ -792,6 +840,13 @@ final class Double512Vector extends DoubleVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset, VectorMask<Double> m) {
return super.fromByteArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -799,6 +854,13 @@ final class Double512Vector extends DoubleVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
return super.fromByteBuffer0Template(Double512Mask.class, bb, offset, (Double512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -806,6 +868,21 @@ final class Double512Vector extends DoubleVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, VectorMask<Double> m) {
super.intoArray0Template(Double512Mask.class, a, offset, (Double512Mask) m);
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
super.intoArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m);
}
@ForceInline
@Override
final
@ -813,6 +890,21 @@ final class Double512Vector extends DoubleVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Double> m) {
super.intoByteArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
super.intoByteBuffer0Template(Double512Mask.class, bb, offset, (Double512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Double64Vector extends DoubleVector {
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
double rOp(double v, VectorMask<Double> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Double64Vector extends DoubleVector {
return (Double64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Double64Vector lanewise(Unary op, VectorMask<Double> m) {
return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, (Double64Mask) m); // specialize
}
@Override
@ForceInline
public Double64Vector lanewise(Binary op, Vector<Double> v) {
return (Double64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Double64Vector lanewise(Binary op, Vector<Double> v, VectorMask<Double> m) {
return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v, (Double64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Double64Vector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (Double64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Double64Vector
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2, VectorMask<Double> m) {
return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v1, v2, (Double64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Double64Vector extends DoubleVector {
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Double64Vector extends DoubleVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Double64Vector extends DoubleVector {
return super.compareTemplate(Double64Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Double64Mask compare(Comparison op, Vector<Double> v, VectorMask<Double> m) {
return super.compareTemplate(Double64Mask.class, op, v, (Double64Mask) m);
}
@Override
@ForceInline
public Double64Vector blend(Vector<Double> v, VectorMask<Double> m) {
@ -413,6 +440,7 @@ final class Double64Vector extends DoubleVector {
VectorMask<Double> m) {
return (Double64Vector)
super.rearrangeTemplate(Double64Shuffle.class,
Double64Mask.class,
(Double64Shuffle) shuffle,
(Double64Mask) m); // specialize
}
@ -578,16 +606,12 @@ final class Double64Vector extends DoubleVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Double64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -613,9 +637,9 @@ final class Double64Vector extends DoubleVector {
public Double64Mask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double64Mask m = (Double64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Double64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Double64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -623,9 +647,9 @@ final class Double64Vector extends DoubleVector {
public Double64Mask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double64Mask m = (Double64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Double64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Double64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -633,9 +657,9 @@ final class Double64Vector extends DoubleVector {
Double64Mask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double64Mask m = (Double64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Double64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -643,22 +667,32 @@ final class Double64Vector extends DoubleVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double64Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Double64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double64Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double64Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Double64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double64Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double64Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Double64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double64Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double64Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -769,6 +803,20 @@ final class Double64Vector extends DoubleVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, VectorMask<Double> m) {
return super.fromArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
return super.fromArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m);
}
@ForceInline
@ -778,6 +826,13 @@ final class Double64Vector extends DoubleVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset, VectorMask<Double> m) {
return super.fromByteArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -785,6 +840,13 @@ final class Double64Vector extends DoubleVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
return super.fromByteBuffer0Template(Double64Mask.class, bb, offset, (Double64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -792,6 +854,21 @@ final class Double64Vector extends DoubleVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, VectorMask<Double> m) {
super.intoArray0Template(Double64Mask.class, a, offset, (Double64Mask) m);
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
super.intoArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m);
}
@ForceInline
@Override
final
@ -799,6 +876,21 @@ final class Double64Vector extends DoubleVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Double> m) {
super.intoByteArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
super.intoByteBuffer0Template(Double64Mask.class, bb, offset, (Double64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class DoubleMaxVector extends DoubleVector {
@ForceInline
final @Override
double rOp(double v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
double rOp(double v, VectorMask<Double> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class DoubleMaxVector extends DoubleVector {
return (DoubleMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public DoubleMaxVector lanewise(Unary op, VectorMask<Double> m) {
return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialize
}
@Override
@ForceInline
public DoubleMaxVector lanewise(Binary op, Vector<Double> v) {
return (DoubleMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public DoubleMaxVector lanewise(Binary op, Vector<Double> v, VectorMask<Double> m) {
return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v, (DoubleMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
DoubleMaxVector
lanewise(VectorOperators.Ternary op, Vector<Double> v1, Vector<Double> v2) {
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2) {
return (DoubleMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
DoubleMaxVector
lanewise(Ternary op, Vector<Double> v1, Vector<Double> v2, VectorMask<Double> m) {
return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v1, v2, (DoubleMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class DoubleMaxVector extends DoubleVector {
@ForceInline
public final double reduceLanes(VectorOperators.Associative op,
VectorMask<Double> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class DoubleMaxVector extends DoubleVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Double> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class DoubleMaxVector extends DoubleVector {
return super.compareTemplate(DoubleMaxMask.class, op, s); // specialize
}
@Override
@ForceInline
public final DoubleMaxMask compare(Comparison op, Vector<Double> v, VectorMask<Double> m) {
return super.compareTemplate(DoubleMaxMask.class, op, v, (DoubleMaxMask) m);
}
@Override
@ForceInline
public DoubleMaxVector blend(Vector<Double> v, VectorMask<Double> m) {
@ -413,6 +440,7 @@ final class DoubleMaxVector extends DoubleVector {
VectorMask<Double> m) {
return (DoubleMaxVector)
super.rearrangeTemplate(DoubleMaxShuffle.class,
DoubleMaxMask.class,
(DoubleMaxShuffle) shuffle,
(DoubleMaxMask) m); // specialize
}
@ -577,16 +605,12 @@ final class DoubleMaxVector extends DoubleVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
DoubleMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -612,9 +636,9 @@ final class DoubleMaxVector extends DoubleVector {
public DoubleMaxMask and(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
DoubleMaxMask m = (DoubleMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -622,9 +646,9 @@ final class DoubleMaxVector extends DoubleVector {
public DoubleMaxMask or(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
DoubleMaxMask m = (DoubleMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -632,9 +656,9 @@ final class DoubleMaxVector extends DoubleVector {
DoubleMaxMask xor(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
DoubleMaxMask m = (DoubleMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -642,22 +666,32 @@ final class DoubleMaxVector extends DoubleVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((DoubleMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((DoubleMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((DoubleMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMaxMask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -768,6 +802,20 @@ final class DoubleMaxVector extends DoubleVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, VectorMask<Double> m) {
return super.fromArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize
}
@ForceInline
@Override
final
DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
return super.fromArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m);
}
@ForceInline
@ -777,6 +825,13 @@ final class DoubleMaxVector extends DoubleVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteArray0(byte[] a, int offset, VectorMask<Double> m) {
return super.fromByteArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -784,6 +839,13 @@ final class DoubleMaxVector extends DoubleVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
return super.fromByteBuffer0Template(DoubleMaxMask.class, bb, offset, (DoubleMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -791,6 +853,21 @@ final class DoubleMaxVector extends DoubleVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, VectorMask<Double> m) {
super.intoArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m);
}
@ForceInline
@Override
final
void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Double> m) {
super.intoArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m);
}
@ForceInline
@Override
final
@ -798,6 +875,21 @@ final class DoubleMaxVector extends DoubleVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Double> m) {
super.intoByteArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Double> m) {
super.intoByteBuffer0Template(DoubleMaxMask.class, bb, offset, (DoubleMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Float128Vector extends FloatVector {
@ForceInline
final @Override
float rOp(float v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
float rOp(float v, VectorMask<Float> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Float128Vector extends FloatVector {
return (Float128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Float128Vector lanewise(Unary op, VectorMask<Float> m) {
return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, (Float128Mask) m); // specialize
}
@Override
@ForceInline
public Float128Vector lanewise(Binary op, Vector<Float> v) {
return (Float128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Float128Vector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v, (Float128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Float128Vector
lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
return (Float128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Float128Vector
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v1, v2, (Float128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Float128Vector extends FloatVector {
@ForceInline
public final float reduceLanes(VectorOperators.Associative op,
VectorMask<Float> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Float128Vector extends FloatVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Float> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Float128Vector extends FloatVector {
return super.compareTemplate(Float128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Float128Mask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
return super.compareTemplate(Float128Mask.class, op, v, (Float128Mask) m);
}
@Override
@ForceInline
public Float128Vector blend(Vector<Float> v, VectorMask<Float> m) {
@ -413,6 +440,7 @@ final class Float128Vector extends FloatVector {
VectorMask<Float> m) {
return (Float128Vector)
super.rearrangeTemplate(Float128Shuffle.class,
Float128Mask.class,
(Float128Shuffle) shuffle,
(Float128Mask) m); // specialize
}
@ -584,16 +612,12 @@ final class Float128Vector extends FloatVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Float128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -619,9 +643,9 @@ final class Float128Vector extends FloatVector {
public Float128Mask and(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float128Mask m = (Float128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Float128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Float128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -629,9 +653,9 @@ final class Float128Vector extends FloatVector {
public Float128Mask or(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float128Mask m = (Float128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Float128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Float128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -639,9 +663,9 @@ final class Float128Vector extends FloatVector {
Float128Mask xor(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float128Mask m = (Float128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -649,22 +673,32 @@ final class Float128Vector extends FloatVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float128Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Float128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float128Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float128Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Float128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float128Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float128Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Float128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float128Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float128Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -775,6 +809,20 @@ final class Float128Vector extends FloatVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
return super.fromArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
return super.fromArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m);
}
@ForceInline
@ -784,6 +832,13 @@ final class Float128Vector extends FloatVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
return super.fromByteArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -791,6 +846,13 @@ final class Float128Vector extends FloatVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
return super.fromByteBuffer0Template(Float128Mask.class, bb, offset, (Float128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -798,6 +860,21 @@ final class Float128Vector extends FloatVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, VectorMask<Float> m) {
super.intoArray0Template(Float128Mask.class, a, offset, (Float128Mask) m);
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
super.intoArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m);
}
@ForceInline
@Override
final
@ -805,6 +882,21 @@ final class Float128Vector extends FloatVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m) {
super.intoByteArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
super.intoByteBuffer0Template(Float128Mask.class, bb, offset, (Float128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Float256Vector extends FloatVector {
@ForceInline
final @Override
float rOp(float v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
float rOp(float v, VectorMask<Float> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Float256Vector extends FloatVector {
return (Float256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Float256Vector lanewise(Unary op, VectorMask<Float> m) {
return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, (Float256Mask) m); // specialize
}
@Override
@ForceInline
public Float256Vector lanewise(Binary op, Vector<Float> v) {
return (Float256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Float256Vector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v, (Float256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Float256Vector
lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
return (Float256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Float256Vector
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v1, v2, (Float256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Float256Vector extends FloatVector {
@ForceInline
public final float reduceLanes(VectorOperators.Associative op,
VectorMask<Float> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Float256Vector extends FloatVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Float> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Float256Vector extends FloatVector {
return super.compareTemplate(Float256Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Float256Mask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
return super.compareTemplate(Float256Mask.class, op, v, (Float256Mask) m);
}
@Override
@ForceInline
public Float256Vector blend(Vector<Float> v, VectorMask<Float> m) {
@ -413,6 +440,7 @@ final class Float256Vector extends FloatVector {
VectorMask<Float> m) {
return (Float256Vector)
super.rearrangeTemplate(Float256Shuffle.class,
Float256Mask.class,
(Float256Shuffle) shuffle,
(Float256Mask) m); // specialize
}
@ -592,16 +620,12 @@ final class Float256Vector extends FloatVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Float256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -627,9 +651,9 @@ final class Float256Vector extends FloatVector {
public Float256Mask and(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float256Mask m = (Float256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Float256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Float256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -637,9 +661,9 @@ final class Float256Vector extends FloatVector {
public Float256Mask or(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float256Mask m = (Float256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Float256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Float256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -647,9 +671,9 @@ final class Float256Vector extends FloatVector {
Float256Mask xor(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float256Mask m = (Float256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -657,22 +681,32 @@ final class Float256Vector extends FloatVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float256Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Float256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float256Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float256Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Float256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float256Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float256Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Float256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float256Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float256Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -783,6 +817,20 @@ final class Float256Vector extends FloatVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
return super.fromArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
return super.fromArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m);
}
@ForceInline
@ -792,6 +840,13 @@ final class Float256Vector extends FloatVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
return super.fromByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -799,6 +854,13 @@ final class Float256Vector extends FloatVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
return super.fromByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -806,6 +868,21 @@ final class Float256Vector extends FloatVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, VectorMask<Float> m) {
super.intoArray0Template(Float256Mask.class, a, offset, (Float256Mask) m);
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
super.intoArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m);
}
@ForceInline
@Override
final
@ -813,6 +890,21 @@ final class Float256Vector extends FloatVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m) {
super.intoByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
super.intoByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Float512Vector extends FloatVector {
@ForceInline
final @Override
float rOp(float v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
float rOp(float v, VectorMask<Float> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Float512Vector extends FloatVector {
return (Float512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Float512Vector lanewise(Unary op, VectorMask<Float> m) {
return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, (Float512Mask) m); // specialize
}
@Override
@ForceInline
public Float512Vector lanewise(Binary op, Vector<Float> v) {
return (Float512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Float512Vector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v, (Float512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Float512Vector
lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
return (Float512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Float512Vector
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v1, v2, (Float512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Float512Vector extends FloatVector {
@ForceInline
public final float reduceLanes(VectorOperators.Associative op,
VectorMask<Float> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Float512Vector extends FloatVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Float> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Float512Vector extends FloatVector {
return super.compareTemplate(Float512Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Float512Mask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
return super.compareTemplate(Float512Mask.class, op, v, (Float512Mask) m);
}
@Override
@ForceInline
public Float512Vector blend(Vector<Float> v, VectorMask<Float> m) {
@ -413,6 +440,7 @@ final class Float512Vector extends FloatVector {
VectorMask<Float> m) {
return (Float512Vector)
super.rearrangeTemplate(Float512Shuffle.class,
Float512Mask.class,
(Float512Shuffle) shuffle,
(Float512Mask) m); // specialize
}
@ -608,16 +636,12 @@ final class Float512Vector extends FloatVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Float512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -643,9 +667,9 @@ final class Float512Vector extends FloatVector {
public Float512Mask and(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float512Mask m = (Float512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Float512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Float512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -653,9 +677,9 @@ final class Float512Vector extends FloatVector {
public Float512Mask or(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float512Mask m = (Float512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Float512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Float512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -663,9 +687,9 @@ final class Float512Vector extends FloatVector {
Float512Mask xor(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float512Mask m = (Float512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -673,22 +697,32 @@ final class Float512Vector extends FloatVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float512Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Float512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float512Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float512Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Float512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float512Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float512Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Float512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float512Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float512Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -799,6 +833,20 @@ final class Float512Vector extends FloatVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
return super.fromArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
return super.fromArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m);
}
@ForceInline
@ -808,6 +856,13 @@ final class Float512Vector extends FloatVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
return super.fromByteArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -815,6 +870,13 @@ final class Float512Vector extends FloatVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
return super.fromByteBuffer0Template(Float512Mask.class, bb, offset, (Float512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -822,6 +884,21 @@ final class Float512Vector extends FloatVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, VectorMask<Float> m) {
super.intoArray0Template(Float512Mask.class, a, offset, (Float512Mask) m);
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
super.intoArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m);
}
@ForceInline
@Override
final
@ -829,6 +906,21 @@ final class Float512Vector extends FloatVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m) {
super.intoByteArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
super.intoByteBuffer0Template(Float512Mask.class, bb, offset, (Float512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Float64Vector extends FloatVector {
@ForceInline
final @Override
float rOp(float v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
float rOp(float v, VectorMask<Float> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class Float64Vector extends FloatVector {
return (Float64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Float64Vector lanewise(Unary op, VectorMask<Float> m) {
return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, (Float64Mask) m); // specialize
}
@Override
@ForceInline
public Float64Vector lanewise(Binary op, Vector<Float> v) {
return (Float64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Float64Vector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v, (Float64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Float64Vector
lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
return (Float64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Float64Vector
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v1, v2, (Float64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class Float64Vector extends FloatVector {
@ForceInline
public final float reduceLanes(VectorOperators.Associative op,
VectorMask<Float> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class Float64Vector extends FloatVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Float> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class Float64Vector extends FloatVector {
return super.compareTemplate(Float64Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Float64Mask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
return super.compareTemplate(Float64Mask.class, op, v, (Float64Mask) m);
}
@Override
@ForceInline
public Float64Vector blend(Vector<Float> v, VectorMask<Float> m) {
@ -413,6 +440,7 @@ final class Float64Vector extends FloatVector {
VectorMask<Float> m) {
return (Float64Vector)
super.rearrangeTemplate(Float64Shuffle.class,
Float64Mask.class,
(Float64Shuffle) shuffle,
(Float64Mask) m); // specialize
}
@ -580,16 +608,12 @@ final class Float64Vector extends FloatVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Float64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -615,9 +639,9 @@ final class Float64Vector extends FloatVector {
public Float64Mask and(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float64Mask m = (Float64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Float64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Float64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -625,9 +649,9 @@ final class Float64Vector extends FloatVector {
public Float64Mask or(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float64Mask m = (Float64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Float64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Float64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -635,9 +659,9 @@ final class Float64Vector extends FloatVector {
Float64Mask xor(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float64Mask m = (Float64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Float64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -645,22 +669,32 @@ final class Float64Vector extends FloatVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float64Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Float64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float64Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float64Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Float64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float64Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float64Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Float64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float64Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float64Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -771,6 +805,20 @@ final class Float64Vector extends FloatVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
return super.fromArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
return super.fromArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m);
}
@ForceInline
@ -780,6 +828,13 @@ final class Float64Vector extends FloatVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
return super.fromByteArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -787,6 +842,13 @@ final class Float64Vector extends FloatVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
return super.fromByteBuffer0Template(Float64Mask.class, bb, offset, (Float64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -794,6 +856,21 @@ final class Float64Vector extends FloatVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, VectorMask<Float> m) {
super.intoArray0Template(Float64Mask.class, a, offset, (Float64Mask) m);
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
super.intoArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m);
}
@ForceInline
@Override
final
@ -801,6 +878,21 @@ final class Float64Vector extends FloatVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m) {
super.intoByteArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
super.intoByteBuffer0Template(Float64Mask.class, bb, offset, (Float64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class FloatMaxVector extends FloatVector {
@ForceInline
final @Override
float rOp(float v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
float rOp(float v, VectorMask<Float> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,22 +273,42 @@ final class FloatMaxVector extends FloatVector {
return (FloatMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public FloatMaxVector lanewise(Unary op, VectorMask<Float> m) {
return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialize
}
@Override
@ForceInline
public FloatMaxVector lanewise(Binary op, Vector<Float> v) {
return (FloatMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public FloatMaxVector lanewise(Binary op, Vector<Float> v, VectorMask<Float> m) {
return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v, (FloatMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
FloatMaxVector
lanewise(VectorOperators.Ternary op, Vector<Float> v1, Vector<Float> v2) {
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2) {
return (FloatMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
FloatMaxVector
lanewise(Ternary op, Vector<Float> v1, Vector<Float> v2, VectorMask<Float> m) {
return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v1, v2, (FloatMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -308,7 +328,7 @@ final class FloatMaxVector extends FloatVector {
@ForceInline
public final float reduceLanes(VectorOperators.Associative op,
VectorMask<Float> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized
}
@Override
@ -321,7 +341,7 @@ final class FloatMaxVector extends FloatVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Float> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized
}
@ForceInline
@ -357,6 +377,13 @@ final class FloatMaxVector extends FloatVector {
return super.compareTemplate(FloatMaxMask.class, op, s); // specialize
}
@Override
@ForceInline
public final FloatMaxMask compare(Comparison op, Vector<Float> v, VectorMask<Float> m) {
return super.compareTemplate(FloatMaxMask.class, op, v, (FloatMaxMask) m);
}
@Override
@ForceInline
public FloatMaxVector blend(Vector<Float> v, VectorMask<Float> m) {
@ -413,6 +440,7 @@ final class FloatMaxVector extends FloatVector {
VectorMask<Float> m) {
return (FloatMaxVector)
super.rearrangeTemplate(FloatMaxShuffle.class,
FloatMaxMask.class,
(FloatMaxShuffle) shuffle,
(FloatMaxMask) m); // specialize
}
@ -577,16 +605,12 @@ final class FloatMaxVector extends FloatVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
FloatMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -612,9 +636,9 @@ final class FloatMaxVector extends FloatVector {
public FloatMaxMask and(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
FloatMaxMask m = (FloatMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -622,9 +646,9 @@ final class FloatMaxVector extends FloatVector {
public FloatMaxMask or(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
FloatMaxMask m = (FloatMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -632,9 +656,9 @@ final class FloatMaxVector extends FloatVector {
FloatMaxMask xor(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
FloatMaxMask m = (FloatMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -642,22 +666,32 @@ final class FloatMaxVector extends FloatVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((FloatMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((FloatMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((FloatMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMaxMask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -768,6 +802,20 @@ final class FloatMaxVector extends FloatVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m) {
return super.fromArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize
}
@ForceInline
@Override
final
FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
return super.fromArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m);
}
@ForceInline
@ -777,6 +825,13 @@ final class FloatMaxVector extends FloatVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m) {
return super.fromByteArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -784,6 +839,13 @@ final class FloatMaxVector extends FloatVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
return super.fromByteBuffer0Template(FloatMaxMask.class, bb, offset, (FloatMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -791,6 +853,21 @@ final class FloatMaxVector extends FloatVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, VectorMask<Float> m) {
super.intoArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m);
}
@ForceInline
@Override
final
void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Float> m) {
super.intoArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m);
}
@ForceInline
@Override
final
@ -798,6 +875,21 @@ final class FloatMaxVector extends FloatVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m) {
super.intoByteArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m) {
super.intoByteBuffer0Template(FloatMaxMask.class, bb, offset, (FloatMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -29,7 +29,6 @@ import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.UnaryOperator;
@ -173,6 +172,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
final
FloatVector uOpTemplate(VectorMask<Float> m,
FUnOp f) {
if (m == null) {
return uOpTemplate(f);
}
float[] vec = vec();
float[] res = new float[length()];
boolean[] mbits = ((AbstractMask<Float>)m).getBits();
@ -216,6 +218,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
FloatVector bOpTemplate(Vector<Float> o,
VectorMask<Float> m,
FBinOp f) {
if (m == null) {
return bOpTemplate(o, f);
}
float[] res = new float[length()];
float[] vec1 = this.vec();
float[] vec2 = ((FloatVector)o).vec();
@ -265,6 +270,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
Vector<Float> o2,
VectorMask<Float> m,
FTriOp f) {
if (m == null) {
return tOpTemplate(o1, o2, f);
}
float[] res = new float[length()];
float[] vec1 = this.vec();
float[] vec2 = ((FloatVector)o1).vec();
@ -280,7 +288,22 @@ public abstract class FloatVector extends AbstractVector<Float> {
/*package-private*/
abstract
float rOp(float v, FBinOp f);
float rOp(float v, VectorMask<Float> m, FBinOp f);
@ForceInline
final
float rOpTemplate(float v, VectorMask<Float> m, FBinOp f) {
if (m == null) {
return rOpTemplate(v, f);
}
float[] vec = vec();
boolean[] mbits = ((AbstractMask<Float>)m).getBits();
for (int i = 0; i < vec.length; i++) {
v = mbits[i] ? f.apply(i, v, vec[i]) : v;
}
return v;
}
@ForceInline
final
float rOpTemplate(float v, FBinOp f) {
@ -540,61 +563,80 @@ public abstract class FloatVector extends AbstractVector<Float> {
}
int opc = opCode(op);
return VectorSupport.unaryOp(
opc, getClass(), float.class, length(),
this,
UN_IMPL.find(op, opc, (opc_) -> {
switch (opc_) {
case VECTOR_OP_NEG: return v0 ->
v0.uOp((i, a) -> (float) -a);
case VECTOR_OP_ABS: return v0 ->
v0.uOp((i, a) -> (float) Math.abs(a));
case VECTOR_OP_SIN: return v0 ->
v0.uOp((i, a) -> (float) Math.sin(a));
case VECTOR_OP_COS: return v0 ->
v0.uOp((i, a) -> (float) Math.cos(a));
case VECTOR_OP_TAN: return v0 ->
v0.uOp((i, a) -> (float) Math.tan(a));
case VECTOR_OP_ASIN: return v0 ->
v0.uOp((i, a) -> (float) Math.asin(a));
case VECTOR_OP_ACOS: return v0 ->
v0.uOp((i, a) -> (float) Math.acos(a));
case VECTOR_OP_ATAN: return v0 ->
v0.uOp((i, a) -> (float) Math.atan(a));
case VECTOR_OP_EXP: return v0 ->
v0.uOp((i, a) -> (float) Math.exp(a));
case VECTOR_OP_LOG: return v0 ->
v0.uOp((i, a) -> (float) Math.log(a));
case VECTOR_OP_LOG10: return v0 ->
v0.uOp((i, a) -> (float) Math.log10(a));
case VECTOR_OP_SQRT: return v0 ->
v0.uOp((i, a) -> (float) Math.sqrt(a));
case VECTOR_OP_CBRT: return v0 ->
v0.uOp((i, a) -> (float) Math.cbrt(a));
case VECTOR_OP_SINH: return v0 ->
v0.uOp((i, a) -> (float) Math.sinh(a));
case VECTOR_OP_COSH: return v0 ->
v0.uOp((i, a) -> (float) Math.cosh(a));
case VECTOR_OP_TANH: return v0 ->
v0.uOp((i, a) -> (float) Math.tanh(a));
case VECTOR_OP_EXPM1: return v0 ->
v0.uOp((i, a) -> (float) Math.expm1(a));
case VECTOR_OP_LOG1P: return v0 ->
v0.uOp((i, a) -> (float) Math.log1p(a));
default: return null;
}}));
opc, getClass(), null, float.class, length(),
this, null,
UN_IMPL.find(op, opc, FloatVector::unaryOperations));
}
private static final
ImplCache<Unary,UnaryOperator<FloatVector>> UN_IMPL
= new ImplCache<>(Unary.class, FloatVector.class);
/**
* {@inheritDoc} <!--workaround-->
*/
@ForceInline
public final
@Override
public abstract
FloatVector lanewise(VectorOperators.Unary op,
VectorMask<Float> m) {
return blend(lanewise(op), m);
VectorMask<Float> m);
@ForceInline
final
FloatVector lanewiseTemplate(VectorOperators.Unary op,
Class<? extends VectorMask<Float>> maskClass,
VectorMask<Float> m) {
m.check(maskClass, this);
if (opKind(op, VO_SPECIAL)) {
if (op == ZOMO) {
return blend(broadcast(-1), compare(NE, 0, m));
}
}
int opc = opCode(op);
return VectorSupport.unaryOp(
opc, getClass(), maskClass, float.class, length(),
this, m,
UN_IMPL.find(op, opc, FloatVector::unaryOperations));
}
private static final
ImplCache<Unary, UnaryOperation<FloatVector, VectorMask<Float>>>
UN_IMPL = new ImplCache<>(Unary.class, FloatVector.class);
private static UnaryOperation<FloatVector, VectorMask<Float>> unaryOperations(int opc_) {
switch (opc_) {
case VECTOR_OP_NEG: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) -a);
case VECTOR_OP_ABS: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.abs(a));
case VECTOR_OP_SIN: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.sin(a));
case VECTOR_OP_COS: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.cos(a));
case VECTOR_OP_TAN: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.tan(a));
case VECTOR_OP_ASIN: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.asin(a));
case VECTOR_OP_ACOS: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.acos(a));
case VECTOR_OP_ATAN: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.atan(a));
case VECTOR_OP_EXP: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.exp(a));
case VECTOR_OP_LOG: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.log(a));
case VECTOR_OP_LOG10: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.log10(a));
case VECTOR_OP_SQRT: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.sqrt(a));
case VECTOR_OP_CBRT: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.cbrt(a));
case VECTOR_OP_SINH: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.sinh(a));
case VECTOR_OP_COSH: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.cosh(a));
case VECTOR_OP_TANH: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.tanh(a));
case VECTOR_OP_EXPM1: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.expm1(a));
case VECTOR_OP_LOG1P: return (v0, m) ->
v0.uOp(m, (i, a) -> (float) Math.log1p(a));
default: return null;
}
}
// Binary lanewise support
@ -614,6 +656,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
Vector<Float> v) {
FloatVector that = (FloatVector) v;
that.check(this);
if (opKind(op, VO_SPECIAL )) {
if (op == FIRST_NONZERO) {
// FIXME: Support this in the JIT.
@ -627,48 +670,75 @@ public abstract class FloatVector extends AbstractVector<Float> {
.viewAsFloatingLanes();
}
}
int opc = opCode(op);
return VectorSupport.binaryOp(
opc, getClass(), float.class, length(),
this, that,
BIN_IMPL.find(op, opc, (opc_) -> {
switch (opc_) {
case VECTOR_OP_ADD: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)(a + b));
case VECTOR_OP_SUB: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)(a - b));
case VECTOR_OP_MUL: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)(a * b));
case VECTOR_OP_DIV: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)(a / b));
case VECTOR_OP_MAX: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)Math.max(a, b));
case VECTOR_OP_MIN: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float)Math.min(a, b));
case VECTOR_OP_ATAN2: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.atan2(a, b));
case VECTOR_OP_POW: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.pow(a, b));
case VECTOR_OP_HYPOT: return (v0, v1) ->
v0.bOp(v1, (i, a, b) -> (float) Math.hypot(a, b));
default: return null;
}}));
opc, getClass(), null, float.class, length(),
this, that, null,
BIN_IMPL.find(op, opc, FloatVector::binaryOperations));
}
private static final
ImplCache<Binary,BinaryOperator<FloatVector>> BIN_IMPL
= new ImplCache<>(Binary.class, FloatVector.class);
/**
* {@inheritDoc} <!--workaround-->
* @see #lanewise(VectorOperators.Binary,float,VectorMask)
*/
@ForceInline
public final
@Override
public abstract
FloatVector lanewise(VectorOperators.Binary op,
Vector<Float> v,
VectorMask<Float> m) {
return blend(lanewise(op, v), m);
VectorMask<Float> m);
@ForceInline
final
FloatVector lanewiseTemplate(VectorOperators.Binary op,
Class<? extends VectorMask<Float>> maskClass,
Vector<Float> v, VectorMask<Float> m) {
FloatVector that = (FloatVector) v;
that.check(this);
m.check(maskClass, this);
if (opKind(op, VO_SPECIAL )) {
if (op == FIRST_NONZERO) {
return blend(lanewise(op, v), m);
}
}
int opc = opCode(op);
return VectorSupport.binaryOp(
opc, getClass(), maskClass, float.class, length(),
this, that, m,
BIN_IMPL.find(op, opc, FloatVector::binaryOperations));
}
private static final
ImplCache<Binary, BinaryOperation<FloatVector, VectorMask<Float>>>
BIN_IMPL = new ImplCache<>(Binary.class, FloatVector.class);
private static BinaryOperation<FloatVector, VectorMask<Float>> binaryOperations(int opc_) {
switch (opc_) {
case VECTOR_OP_ADD: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)(a + b));
case VECTOR_OP_SUB: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)(a - b));
case VECTOR_OP_MUL: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)(a * b));
case VECTOR_OP_DIV: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)(a / b));
case VECTOR_OP_MAX: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)Math.max(a, b));
case VECTOR_OP_MIN: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float)Math.min(a, b));
case VECTOR_OP_OR: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> fromBits(toBits(a) | toBits(b)));
case VECTOR_OP_ATAN2: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float) Math.atan2(a, b));
case VECTOR_OP_POW: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float) Math.pow(a, b));
case VECTOR_OP_HYPOT: return (v0, v1, vm) ->
v0.bOp(v1, vm, (i, a, b) -> (float) Math.hypot(a, b));
default: return null;
}
}
// FIXME: Maybe all of the public final methods in this file (the
// simple ones that just call lanewise) should be pushed down to
// the X-VectorBits template. They can't optimize properly at
@ -725,7 +795,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
FloatVector lanewise(VectorOperators.Binary op,
float e,
VectorMask<Float> m) {
return blend(lanewise(op, e), m);
return lanewise(op, broadcast(e), m);
}
/**
@ -743,8 +813,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
FloatVector lanewise(VectorOperators.Binary op,
long e) {
float e1 = (float) e;
if ((long)e1 != e
) {
if ((long)e1 != e) {
vspecies().checkValue(e); // for exception
}
return lanewise(op, e1);
@ -764,7 +833,11 @@ public abstract class FloatVector extends AbstractVector<Float> {
public final
FloatVector lanewise(VectorOperators.Binary op,
long e, VectorMask<Float> m) {
return blend(lanewise(op, e), m);
float e1 = (float) e;
if ((long)e1 != e) {
vspecies().checkValue(e); // for exception
}
return lanewise(op, e1, m);
}
@ -806,18 +879,10 @@ public abstract class FloatVector extends AbstractVector<Float> {
tother.check(this);
int opc = opCode(op);
return VectorSupport.ternaryOp(
opc, getClass(), float.class, length(),
this, that, tother,
TERN_IMPL.find(op, opc, (opc_) -> {
switch (opc_) {
case VECTOR_OP_FMA: return (v0, v1_, v2_) ->
v0.tOp(v1_, v2_, (i, a, b, c) -> Math.fma(a, b, c));
default: return null;
}}));
opc, getClass(), null, float.class, length(),
this, that, tother, null,
TERN_IMPL.find(op, opc, FloatVector::ternaryOperations));
}
private static final
ImplCache<Ternary,TernaryOperation<FloatVector>> TERN_IMPL
= new ImplCache<>(Ternary.class, FloatVector.class);
/**
* {@inheritDoc} <!--workaround-->
@ -825,13 +890,45 @@ public abstract class FloatVector extends AbstractVector<Float> {
* @see #lanewise(VectorOperators.Ternary,Vector,float,VectorMask)
* @see #lanewise(VectorOperators.Ternary,float,Vector,VectorMask)
*/
@ForceInline
public final
@Override
public abstract
FloatVector lanewise(VectorOperators.Ternary op,
Vector<Float> v1,
Vector<Float> v2,
VectorMask<Float> m) {
return blend(lanewise(op, v1, v2), m);
VectorMask<Float> m);
@ForceInline
final
FloatVector lanewiseTemplate(VectorOperators.Ternary op,
Class<? extends VectorMask<Float>> maskClass,
Vector<Float> v1,
Vector<Float> v2,
VectorMask<Float> m) {
FloatVector that = (FloatVector) v1;
FloatVector tother = (FloatVector) v2;
// It's a word: https://www.dictionary.com/browse/tother
// See also Chapter 11 of Dickens, Our Mutual Friend:
// "Totherest Governor," replied Mr Riderhood...
that.check(this);
tother.check(this);
m.check(maskClass, this);
int opc = opCode(op);
return VectorSupport.ternaryOp(
opc, getClass(), maskClass, float.class, length(),
this, that, tother, m,
TERN_IMPL.find(op, opc, FloatVector::ternaryOperations));
}
private static final
ImplCache<Ternary, TernaryOperation<FloatVector, VectorMask<Float>>>
TERN_IMPL = new ImplCache<>(Ternary.class, FloatVector.class);
private static TernaryOperation<FloatVector, VectorMask<Float>> ternaryOperations(int opc_) {
switch (opc_) {
case VECTOR_OP_FMA: return (v0, v1_, v2_, m) ->
v0.tOp(v1_, v2_, m, (i, a, b, c) -> Math.fma(a, b, c));
default: return null;
}
}
/**
@ -888,7 +985,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
float e1,
float e2,
VectorMask<Float> m) {
return blend(lanewise(op, e1, e2), m);
return lanewise(op, broadcast(e1), broadcast(e2), m);
}
/**
@ -946,7 +1043,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
Vector<Float> v1,
float e2,
VectorMask<Float> m) {
return blend(lanewise(op, v1, e2), m);
return lanewise(op, v1, broadcast(e2), m);
}
/**
@ -1003,7 +1100,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
float e1,
Vector<Float> v2,
VectorMask<Float> m) {
return blend(lanewise(op, e1, v2), m);
return lanewise(op, broadcast(e1), v2, m);
}
// (Thus endeth the Great and Mighty Ternary Ogdoad.)
@ -1659,15 +1756,13 @@ public abstract class FloatVector extends AbstractVector<Float> {
final
<M extends VectorMask<Float>>
M compareTemplate(Class<M> maskType, Comparison op, Vector<Float> v) {
Objects.requireNonNull(v);
FloatSpecies vsp = vspecies();
FloatVector that = (FloatVector) v;
that.check(this);
int opc = opCode(op);
return VectorSupport.compare(
opc, getClass(), maskType, float.class, length(),
this, that,
(cond, v0, v1) -> {
this, that, null,
(cond, v0, v1, m1) -> {
AbstractMask<Float> m
= v0.bTest(cond, v1, (cond_, i, a, b)
-> compareWithOp(cond, a, b));
@ -1677,6 +1772,28 @@ public abstract class FloatVector extends AbstractVector<Float> {
});
}
/*package-private*/
@ForceInline
final
<M extends VectorMask<Float>>
M compareTemplate(Class<M> maskType, Comparison op, Vector<Float> v, M m) {
FloatVector that = (FloatVector) v;
that.check(this);
m.check(maskType, this);
int opc = opCode(op);
return VectorSupport.compare(
opc, getClass(), maskType, float.class, length(),
this, that, m,
(cond, v0, v1, m1) -> {
AbstractMask<Float> cmpM
= v0.bTest(cond, v1, (cond_, i, a, b)
-> compareWithOp(cond, a, b));
@SuppressWarnings("unchecked")
M m2 = (M) cmpM.and(m1);
return m2;
});
}
@ForceInline
private static boolean compareWithOp(int cond, float a, float b) {
return switch (cond) {
@ -1690,18 +1807,6 @@ public abstract class FloatVector extends AbstractVector<Float> {
};
}
/**
* {@inheritDoc} <!--workaround-->
*/
@Override
@ForceInline
public final
VectorMask<Float> compare(VectorOperators.Comparison op,
Vector<Float> v,
VectorMask<Float> m) {
return compare(op, v).and(m);
}
/**
* Tests this vector by comparing it with an input scalar,
* according to the given comparison operation.
@ -1760,7 +1865,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
public final VectorMask<Float> compare(VectorOperators.Comparison op,
float e,
VectorMask<Float> m) {
return compare(op, e).and(m);
return compare(op, broadcast(e), m);
}
/**
@ -2011,9 +2116,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
FloatVector rearrangeTemplate(Class<S> shuffletype, S shuffle) {
shuffle.checkIndexes();
return VectorSupport.rearrangeOp(
getClass(), shuffletype, float.class, length(),
this, shuffle,
(v1, s_) -> v1.uOp((i, a) -> {
getClass(), shuffletype, null, float.class, length(),
this, shuffle, null,
(v1, s_, m_) -> v1.uOp((i, a) -> {
int ei = s_.laneSource(i);
return v1.lane(ei);
}));
@ -2030,24 +2135,25 @@ public abstract class FloatVector extends AbstractVector<Float> {
/*package-private*/
@ForceInline
final
<S extends VectorShuffle<Float>>
<S extends VectorShuffle<Float>, M extends VectorMask<Float>>
FloatVector rearrangeTemplate(Class<S> shuffletype,
Class<M> masktype,
S shuffle,
VectorMask<Float> m) {
FloatVector unmasked =
VectorSupport.rearrangeOp(
getClass(), shuffletype, float.class, length(),
this, shuffle,
(v1, s_) -> v1.uOp((i, a) -> {
int ei = s_.laneSource(i);
return ei < 0 ? 0 : v1.lane(ei);
}));
M m) {
m.check(masktype, this);
VectorMask<Float> valid = shuffle.laneIsValid();
if (m.andNot(valid).anyTrue()) {
shuffle.checkIndexes();
throw new AssertionError();
}
return broadcast((float)0).blend(unmasked, m);
return VectorSupport.rearrangeOp(
getClass(), shuffletype, masktype, float.class, length(),
this, shuffle, m,
(v1, s_, m_) -> v1.uOp((i, a) -> {
int ei = s_.laneSource(i);
return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei);
}));
}
/**
@ -2070,17 +2176,17 @@ public abstract class FloatVector extends AbstractVector<Float> {
S ws = (S) shuffle.wrapIndexes();
FloatVector r0 =
VectorSupport.rearrangeOp(
getClass(), shuffletype, float.class, length(),
this, ws,
(v0, s_) -> v0.uOp((i, a) -> {
getClass(), shuffletype, null, float.class, length(),
this, ws, null,
(v0, s_, m_) -> v0.uOp((i, a) -> {
int ei = s_.laneSource(i);
return v0.lane(ei);
}));
FloatVector r1 =
VectorSupport.rearrangeOp(
getClass(), shuffletype, float.class, length(),
v, ws,
(v1, s_) -> v1.uOp((i, a) -> {
getClass(), shuffletype, null, float.class, length(),
v, ws, null,
(v1, s_, m_) -> v1.uOp((i, a) -> {
int ei = s_.laneSource(i);
return v1.lane(ei);
}));
@ -2329,9 +2435,18 @@ public abstract class FloatVector extends AbstractVector<Float> {
@ForceInline
final
float reduceLanesTemplate(VectorOperators.Associative op,
Class<? extends VectorMask<Float>> maskClass,
VectorMask<Float> m) {
FloatVector v = reduceIdentityVector(op).blend(this, m);
return v.reduceLanesTemplate(op);
m.check(maskClass, this);
if (op == FIRST_NONZERO) {
FloatVector v = reduceIdentityVector(op).blend(this, m);
return v.reduceLanesTemplate(op);
}
int opc = opCode(op);
return fromBits(VectorSupport.reductionCoerced(
opc, getClass(), maskClass, float.class, length(),
this, m,
REDUCE_IMPL.find(op, opc, FloatVector::reductionOperations)));
}
/*package-private*/
@ -2346,24 +2461,28 @@ public abstract class FloatVector extends AbstractVector<Float> {
}
int opc = opCode(op);
return fromBits(VectorSupport.reductionCoerced(
opc, getClass(), float.class, length(),
this,
REDUCE_IMPL.find(op, opc, (opc_) -> {
switch (opc_) {
case VECTOR_OP_ADD: return v ->
toBits(v.rOp((float)0, (i, a, b) -> (float)(a + b)));
case VECTOR_OP_MUL: return v ->
toBits(v.rOp((float)1, (i, a, b) -> (float)(a * b)));
case VECTOR_OP_MIN: return v ->
toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (float) Math.min(a, b)));
case VECTOR_OP_MAX: return v ->
toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (float) Math.max(a, b)));
default: return null;
}})));
opc, getClass(), null, float.class, length(),
this, null,
REDUCE_IMPL.find(op, opc, FloatVector::reductionOperations)));
}
private static final
ImplCache<Associative,Function<FloatVector,Long>> REDUCE_IMPL
= new ImplCache<>(Associative.class, FloatVector.class);
ImplCache<Associative, ReductionOperation<FloatVector, VectorMask<Float>>>
REDUCE_IMPL = new ImplCache<>(Associative.class, FloatVector.class);
private static ReductionOperation<FloatVector, VectorMask<Float>> reductionOperations(int opc_) {
switch (opc_) {
case VECTOR_OP_ADD: return (v, m) ->
toBits(v.rOp((float)0, m, (i, a, b) -> (float)(a + b)));
case VECTOR_OP_MUL: return (v, m) ->
toBits(v.rOp((float)1, m, (i, a, b) -> (float)(a * b)));
case VECTOR_OP_MIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (float) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (float) Math.max(a, b)));
default: return null;
}
}
private
@ForceInline
@ -2573,9 +2692,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
VectorMask<Float> m) {
FloatSpecies vsp = (FloatSpecies) species;
if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) {
FloatVector zero = vsp.zero();
FloatVector v = zero.fromByteArray0(a, offset);
return zero.blend(v.maybeSwap(bo), m);
return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo);
}
// FIXME: optimize
@ -2637,8 +2754,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
VectorMask<Float> m) {
FloatSpecies vsp = (FloatSpecies) species;
if (offset >= 0 && offset <= (a.length - species.length())) {
FloatVector zero = vsp.zero();
return zero.blend(zero.fromArray0(a, offset), m);
return vsp.dummyVector().fromArray0(a, offset, m);
}
// FIXME: optimize
@ -2696,13 +2812,13 @@ public abstract class FloatVector extends AbstractVector<Float> {
vix = VectorIntrinsics.checkIndex(vix, a.length);
return VectorSupport.loadWithMap(
vectorType, float.class, vsp.laneCount(),
IntVector.species(vsp.indexShape()).vectorType(),
a, ARRAY_BASE, vix,
vectorType, null, float.class, vsp.laneCount(),
isp.vectorType(),
a, ARRAY_BASE, vix, null,
a, offset, indexMap, mapOffset, vsp,
(float[] c, int idx, int[] iMap, int idy, FloatSpecies s) ->
(c, idx, iMap, idy, s, vm) ->
s.vOp(n -> c[idx + iMap[idy+n]]));
}
}
/**
* Gathers a new vector composed of elements from an array of type
@ -2750,9 +2866,8 @@ public abstract class FloatVector extends AbstractVector<Float> {
return fromArray(species, a, offset, indexMap, mapOffset);
}
else {
// FIXME: Cannot vectorize yet, if there's a mask.
FloatSpecies vsp = (FloatSpecies) species;
return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]);
return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m);
}
}
@ -2846,9 +2961,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
VectorMask<Float> m) {
FloatSpecies vsp = (FloatSpecies) species;
if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) {
FloatVector zero = vsp.zero();
FloatVector v = zero.fromByteBuffer0(bb, offset);
return zero.blend(v.maybeSwap(bo), m);
return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo);
}
// FIXME: optimize
@ -2920,10 +3033,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
if (m.allTrue()) {
intoArray(a, offset);
} else {
// FIXME: optimize
FloatSpecies vsp = vspecies();
checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v);
intoArray0(a, offset, m);
}
}
@ -2967,12 +3079,12 @@ public abstract class FloatVector extends AbstractVector<Float> {
vix = VectorIntrinsics.checkIndex(vix, a.length);
VectorSupport.storeWithMap(
vsp.vectorType(), vsp.elementType(), vsp.laneCount(),
vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(),
isp.vectorType(),
a, arrayAddress(a, 0), vix,
this,
this, null,
a, offset, indexMap, mapOffset,
(arr, off, v, map, mo)
(arr, off, v, map, mo, vm)
-> v.stOp(arr, off,
(arr_, off_, i, e) -> {
int j = map[mo + i];
@ -3019,12 +3131,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
intoArray(a, offset, indexMap, mapOffset);
}
else {
// FIXME: Cannot vectorize yet, if there's a mask.
stOp(a, offset, m,
(arr, off, i, e) -> {
int j = indexMap[mapOffset + i];
arr[off + j] = e;
});
intoArray0(a, offset, indexMap, mapOffset, m);
}
}
@ -3054,12 +3161,9 @@ public abstract class FloatVector extends AbstractVector<Float> {
if (m.allTrue()) {
intoByteArray(a, offset, bo);
} else {
// FIXME: optimize
FloatSpecies vsp = vspecies();
checkMaskFromIndexSize(offset, vsp, m, 4, a.length);
ByteBuffer wb = wrapper(a, bo);
this.stOp(wb, offset, m,
(wb_, o, i, e) -> wb_.putFloat(o + i * 4, e));
maybeSwap(bo).intoByteArray0(a, offset, m);
}
}
@ -3071,7 +3175,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
public final
void intoByteBuffer(ByteBuffer bb, int offset,
ByteOrder bo) {
if (bb.isReadOnly()) {
if (ScopedMemoryAccess.isReadOnly(bb)) {
throw new ReadOnlyBufferException();
}
offset = checkFromIndexSize(offset, byteSize(), bb.limit());
@ -3090,15 +3194,12 @@ public abstract class FloatVector extends AbstractVector<Float> {
if (m.allTrue()) {
intoByteBuffer(bb, offset, bo);
} else {
// FIXME: optimize
if (bb.isReadOnly()) {
throw new ReadOnlyBufferException();
}
FloatSpecies vsp = vspecies();
checkMaskFromIndexSize(offset, vsp, m, 4, bb.limit());
ByteBuffer wb = wrapper(bb, bo);
this.stOp(wb, offset, m,
(wb_, o, i, e) -> wb_.putFloat(o + i * 4, e));
maybeSwap(bo).intoByteBuffer0(bb, offset, m);
}
}
@ -3136,6 +3237,57 @@ public abstract class FloatVector extends AbstractVector<Float> {
(arr_, off_, i) -> arr_[off_ + i]));
}
/*package-private*/
abstract
FloatVector fromArray0(float[] a, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
FloatVector fromArray0Template(Class<M> maskClass, float[] a, int offset, M m) {
m.check(species());
FloatSpecies vsp = vspecies();
return VectorSupport.loadMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
a, arrayAddress(a, offset), m,
a, offset, vsp,
(arr, off, s, vm) -> s.ldOp(arr, off, vm,
(arr_, off_, i) -> arr_[off_ + i]));
}
/*package-private*/
abstract
FloatVector fromArray0(float[] a, int offset,
int[] indexMap, int mapOffset,
VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
FloatVector fromArray0Template(Class<M> maskClass, float[] a, int offset,
int[] indexMap, int mapOffset, M m) {
FloatSpecies vsp = vspecies();
IntVector.IntSpecies isp = IntVector.species(vsp.indexShape());
Objects.requireNonNull(a);
Objects.requireNonNull(indexMap);
m.check(vsp);
Class<? extends FloatVector> vectorType = vsp.vectorType();
// Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k]
IntVector vix = IntVector
.fromArray(isp, indexMap, mapOffset)
.add(offset);
// FIXME: Check index under mask controlling.
vix = VectorIntrinsics.checkIndex(vix, a.length);
return VectorSupport.loadWithMap(
vectorType, maskClass, float.class, vsp.laneCount(),
isp.vectorType(),
a, ARRAY_BASE, vix, m,
a, offset, indexMap, mapOffset, vsp,
(c, idx, iMap, idy, s, vm) ->
s.vOp(vm, n -> c[idx + iMap[idy+n]]));
}
@Override
@ -3156,6 +3308,25 @@ public abstract class FloatVector extends AbstractVector<Float> {
});
}
abstract
FloatVector fromByteArray0(byte[] a, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
FloatVector fromByteArray0Template(Class<M> maskClass, byte[] a, int offset, M m) {
FloatSpecies vsp = vspecies();
m.check(vsp);
return VectorSupport.loadMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
a, byteArrayAddress(a, offset), m,
a, offset, vsp,
(arr, off, s, vm) -> {
ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN);
return s.ldOp(wb, off, vm,
(wb_, o, i) -> wb_.getFloat(o + i * 4));
});
}
abstract
FloatVector fromByteBuffer0(ByteBuffer bb, int offset);
@ForceInline
@ -3172,6 +3343,24 @@ public abstract class FloatVector extends AbstractVector<Float> {
});
}
abstract
FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
FloatVector fromByteBuffer0Template(Class<M> maskClass, ByteBuffer bb, int offset, M m) {
FloatSpecies vsp = vspecies();
m.check(vsp);
return ScopedMemoryAccess.loadFromByteBufferMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
bb, offset, m, vsp,
(buf, off, s, vm) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
return s.ldOp(wb, off, vm,
(wb_, o, i) -> wb_.getFloat(o + i * 4));
});
}
// Unchecked storing operations in native byte order.
// Caller is responsible for applying index checks, masking, and
// byte swapping.
@ -3191,6 +3380,58 @@ public abstract class FloatVector extends AbstractVector<Float> {
(arr_, off_, i, e) -> arr_[off_+i] = e));
}
abstract
void intoArray0(float[] a, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
void intoArray0Template(Class<M> maskClass, float[] a, int offset, M m) {
m.check(species());
FloatSpecies vsp = vspecies();
VectorSupport.storeMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
a, arrayAddress(a, offset),
this, m, a, offset,
(arr, off, v, vm)
-> v.stOp(arr, off, vm,
(arr_, off_, i, e) -> arr_[off_ + i] = e));
}
abstract
void intoArray0(float[] a, int offset,
int[] indexMap, int mapOffset,
VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
void intoArray0Template(Class<M> maskClass, float[] a, int offset,
int[] indexMap, int mapOffset, M m) {
m.check(species());
FloatSpecies vsp = vspecies();
IntVector.IntSpecies isp = IntVector.species(vsp.indexShape());
// Index vector: vix[0:n] = i -> offset + indexMap[mo + i]
IntVector vix = IntVector
.fromArray(isp, indexMap, mapOffset)
.add(offset);
// FIXME: Check index under mask controlling.
vix = VectorIntrinsics.checkIndex(vix, a.length);
VectorSupport.storeWithMap(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
isp.vectorType(),
a, arrayAddress(a, 0), vix,
this, m,
a, offset, indexMap, mapOffset,
(arr, off, v, map, mo, vm)
-> v.stOp(arr, off, vm,
(arr_, off_, i, e) -> {
int j = map[mo + i];
arr[off + j] = e;
}));
}
abstract
void intoByteArray0(byte[] a, int offset);
@ForceInline
@ -3208,6 +3449,25 @@ public abstract class FloatVector extends AbstractVector<Float> {
});
}
abstract
void intoByteArray0(byte[] a, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
void intoByteArray0Template(Class<M> maskClass, byte[] a, int offset, M m) {
FloatSpecies vsp = vspecies();
m.check(vsp);
VectorSupport.storeMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
a, byteArrayAddress(a, offset),
this, m, a, offset,
(arr, off, v, vm) -> {
ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN);
v.stOp(wb, off, vm,
(tb_, o, i, e) -> tb_.putFloat(o + i * 4, e));
});
}
@ForceInline
final
void intoByteBuffer0(ByteBuffer bb, int offset) {
@ -3222,6 +3482,25 @@ public abstract class FloatVector extends AbstractVector<Float> {
});
}
abstract
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Float> m);
@ForceInline
final
<M extends VectorMask<Float>>
void intoByteBuffer0Template(Class<M> maskClass, ByteBuffer bb, int offset, M m) {
FloatSpecies vsp = vspecies();
m.check(vsp);
ScopedMemoryAccess.storeIntoByteBufferMasked(
vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(),
this, m, bb, offset,
(buf, off, v, vm) -> {
ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN);
v.stOp(wb, off, vm,
(wb_, o, i, e) -> wb_.putFloat(o + i * 4, e));
});
}
// End of low-level memory operations.
private static
@ -3539,7 +3818,7 @@ public abstract class FloatVector extends AbstractVector<Float> {
/*package-private*/
@ForceInline
<M> FloatVector ldOp(M memory, int offset,
AbstractMask<Float> m,
VectorMask<Float> m,
FLdOp<M> f) {
return dummyVector().ldOp(memory, offset, m, f);
}

View file

@ -236,8 +236,8 @@ final class Int128Vector extends IntVector {
@ForceInline
final @Override
int rOp(int v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
int rOp(int v, VectorMask<Integer> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Int128Vector extends IntVector {
return (Int128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Int128Vector lanewise(Unary op, VectorMask<Integer> m) {
return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, (Int128Mask) m); // specialize
}
@Override
@ForceInline
public Int128Vector lanewise(Binary op, Vector<Integer> v) {
return (Int128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Int128Vector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v, (Int128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Int128Vector
@ -286,15 +298,30 @@ final class Int128Vector extends IntVector {
return (Int128Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Int128Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
return (Int128Vector) super.lanewiseShiftTemplate(op, Int128Mask.class, e, (Int128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Int128Vector
lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
return (Int128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Int128Vector
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v1, v2, (Int128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Int128Vector extends IntVector {
@ForceInline
public final int reduceLanes(VectorOperators.Associative op,
VectorMask<Integer> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Int128Vector extends IntVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Integer> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Int128Vector extends IntVector {
return super.compareTemplate(Int128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Int128Mask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
return super.compareTemplate(Int128Mask.class, op, v, (Int128Mask) m);
}
@Override
@ForceInline
public Int128Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
@ -419,6 +453,7 @@ final class Int128Vector extends IntVector {
VectorMask<Integer> m) {
return (Int128Vector)
super.rearrangeTemplate(Int128Shuffle.class,
Int128Mask.class,
(Int128Shuffle) shuffle,
(Int128Mask) m); // specialize
}
@ -588,16 +623,12 @@ final class Int128Vector extends IntVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Int128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -623,9 +654,9 @@ final class Int128Vector extends IntVector {
public Int128Mask and(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int128Mask m = (Int128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -633,9 +664,9 @@ final class Int128Vector extends IntVector {
public Int128Mask or(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int128Mask m = (Int128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -643,9 +674,9 @@ final class Int128Vector extends IntVector {
Int128Mask xor(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int128Mask m = (Int128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -653,22 +684,32 @@ final class Int128Vector extends IntVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Int128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Int128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Int128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int128Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -779,6 +820,20 @@ final class Int128Vector extends IntVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
return super.fromArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
return super.fromArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m);
}
@ForceInline
@ -788,6 +843,13 @@ final class Int128Vector extends IntVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
return super.fromByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -795,6 +857,13 @@ final class Int128Vector extends IntVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
return super.fromByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -802,6 +871,21 @@ final class Int128Vector extends IntVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
super.intoArray0Template(Int128Mask.class, a, offset, (Int128Mask) m);
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
super.intoArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m);
}
@ForceInline
@Override
final
@ -809,6 +893,21 @@ final class Int128Vector extends IntVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
super.intoByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
super.intoByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Int256Vector extends IntVector {
@ForceInline
final @Override
int rOp(int v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
int rOp(int v, VectorMask<Integer> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Int256Vector extends IntVector {
return (Int256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Int256Vector lanewise(Unary op, VectorMask<Integer> m) {
return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, (Int256Mask) m); // specialize
}
@Override
@ForceInline
public Int256Vector lanewise(Binary op, Vector<Integer> v) {
return (Int256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Int256Vector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v, (Int256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Int256Vector
@ -286,15 +298,30 @@ final class Int256Vector extends IntVector {
return (Int256Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Int256Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
return (Int256Vector) super.lanewiseShiftTemplate(op, Int256Mask.class, e, (Int256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Int256Vector
lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
return (Int256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Int256Vector
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v1, v2, (Int256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Int256Vector extends IntVector {
@ForceInline
public final int reduceLanes(VectorOperators.Associative op,
VectorMask<Integer> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Int256Vector extends IntVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Integer> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Int256Vector extends IntVector {
return super.compareTemplate(Int256Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Int256Mask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
return super.compareTemplate(Int256Mask.class, op, v, (Int256Mask) m);
}
@Override
@ForceInline
public Int256Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
@ -419,6 +453,7 @@ final class Int256Vector extends IntVector {
VectorMask<Integer> m) {
return (Int256Vector)
super.rearrangeTemplate(Int256Shuffle.class,
Int256Mask.class,
(Int256Shuffle) shuffle,
(Int256Mask) m); // specialize
}
@ -596,16 +631,12 @@ final class Int256Vector extends IntVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Int256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -631,9 +662,9 @@ final class Int256Vector extends IntVector {
public Int256Mask and(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int256Mask m = (Int256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Int256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Int256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -641,9 +672,9 @@ final class Int256Vector extends IntVector {
public Int256Mask or(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int256Mask m = (Int256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Int256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Int256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -651,9 +682,9 @@ final class Int256Vector extends IntVector {
Int256Mask xor(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int256Mask m = (Int256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int256Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int256Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -661,22 +692,32 @@ final class Int256Vector extends IntVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int256Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Int256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int256Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int256Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Int256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int256Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int256Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Int256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int256Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int256Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -787,6 +828,20 @@ final class Int256Vector extends IntVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
return super.fromArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
return super.fromArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m);
}
@ForceInline
@ -796,6 +851,13 @@ final class Int256Vector extends IntVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
return super.fromByteArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -803,6 +865,13 @@ final class Int256Vector extends IntVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
return super.fromByteBuffer0Template(Int256Mask.class, bb, offset, (Int256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -810,6 +879,21 @@ final class Int256Vector extends IntVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
super.intoArray0Template(Int256Mask.class, a, offset, (Int256Mask) m);
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
super.intoArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m);
}
@ForceInline
@Override
final
@ -817,6 +901,21 @@ final class Int256Vector extends IntVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
super.intoByteArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
super.intoByteBuffer0Template(Int256Mask.class, bb, offset, (Int256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Int512Vector extends IntVector {
@ForceInline
final @Override
int rOp(int v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
int rOp(int v, VectorMask<Integer> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Int512Vector extends IntVector {
return (Int512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Int512Vector lanewise(Unary op, VectorMask<Integer> m) {
return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, (Int512Mask) m); // specialize
}
@Override
@ForceInline
public Int512Vector lanewise(Binary op, Vector<Integer> v) {
return (Int512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Int512Vector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v, (Int512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Int512Vector
@ -286,15 +298,30 @@ final class Int512Vector extends IntVector {
return (Int512Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Int512Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
return (Int512Vector) super.lanewiseShiftTemplate(op, Int512Mask.class, e, (Int512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Int512Vector
lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
return (Int512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Int512Vector
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v1, v2, (Int512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Int512Vector extends IntVector {
@ForceInline
public final int reduceLanes(VectorOperators.Associative op,
VectorMask<Integer> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Int512Vector extends IntVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Integer> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Int512Vector extends IntVector {
return super.compareTemplate(Int512Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Int512Mask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
return super.compareTemplate(Int512Mask.class, op, v, (Int512Mask) m);
}
@Override
@ForceInline
public Int512Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
@ -419,6 +453,7 @@ final class Int512Vector extends IntVector {
VectorMask<Integer> m) {
return (Int512Vector)
super.rearrangeTemplate(Int512Shuffle.class,
Int512Mask.class,
(Int512Shuffle) shuffle,
(Int512Mask) m); // specialize
}
@ -612,16 +647,12 @@ final class Int512Vector extends IntVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Int512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -647,9 +678,9 @@ final class Int512Vector extends IntVector {
public Int512Mask and(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int512Mask m = (Int512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Int512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Int512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -657,9 +688,9 @@ final class Int512Vector extends IntVector {
public Int512Mask or(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int512Mask m = (Int512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Int512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Int512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -667,9 +698,9 @@ final class Int512Vector extends IntVector {
Int512Mask xor(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int512Mask m = (Int512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int512Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int512Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -677,22 +708,32 @@ final class Int512Vector extends IntVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int512Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Int512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int512Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int512Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Int512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int512Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int512Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Int512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int512Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int512Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -803,6 +844,20 @@ final class Int512Vector extends IntVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
return super.fromArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
return super.fromArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m);
}
@ForceInline
@ -812,6 +867,13 @@ final class Int512Vector extends IntVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
return super.fromByteArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -819,6 +881,13 @@ final class Int512Vector extends IntVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
return super.fromByteBuffer0Template(Int512Mask.class, bb, offset, (Int512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -826,6 +895,21 @@ final class Int512Vector extends IntVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
super.intoArray0Template(Int512Mask.class, a, offset, (Int512Mask) m);
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
super.intoArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m);
}
@ForceInline
@Override
final
@ -833,6 +917,21 @@ final class Int512Vector extends IntVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
super.intoByteArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
super.intoByteBuffer0Template(Int512Mask.class, bb, offset, (Int512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Int64Vector extends IntVector {
@ForceInline
final @Override
int rOp(int v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
int rOp(int v, VectorMask<Integer> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Int64Vector extends IntVector {
return (Int64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Int64Vector lanewise(Unary op, VectorMask<Integer> m) {
return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, (Int64Mask) m); // specialize
}
@Override
@ForceInline
public Int64Vector lanewise(Binary op, Vector<Integer> v) {
return (Int64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Int64Vector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v, (Int64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Int64Vector
@ -286,15 +298,30 @@ final class Int64Vector extends IntVector {
return (Int64Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Int64Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
return (Int64Vector) super.lanewiseShiftTemplate(op, Int64Mask.class, e, (Int64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Int64Vector
lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
return (Int64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Int64Vector
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v1, v2, (Int64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Int64Vector extends IntVector {
@ForceInline
public final int reduceLanes(VectorOperators.Associative op,
VectorMask<Integer> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Int64Vector extends IntVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Integer> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Int64Vector extends IntVector {
return super.compareTemplate(Int64Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Int64Mask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
return super.compareTemplate(Int64Mask.class, op, v, (Int64Mask) m);
}
@Override
@ForceInline
public Int64Vector blend(Vector<Integer> v, VectorMask<Integer> m) {
@ -419,6 +453,7 @@ final class Int64Vector extends IntVector {
VectorMask<Integer> m) {
return (Int64Vector)
super.rearrangeTemplate(Int64Shuffle.class,
Int64Mask.class,
(Int64Shuffle) shuffle,
(Int64Mask) m); // specialize
}
@ -584,16 +619,12 @@ final class Int64Vector extends IntVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Int64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -619,9 +650,9 @@ final class Int64Vector extends IntVector {
public Int64Mask and(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int64Mask m = (Int64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Int64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Int64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -629,9 +660,9 @@ final class Int64Vector extends IntVector {
public Int64Mask or(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int64Mask m = (Int64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Int64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Int64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -639,9 +670,9 @@ final class Int64Vector extends IntVector {
Int64Mask xor(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int64Mask m = (Int64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int64Mask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Int64Mask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -649,22 +680,32 @@ final class Int64Vector extends IntVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int64Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((Int64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int64Mask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int64Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((Int64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int64Mask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int64Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((Int64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int64Mask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int64Mask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -775,6 +816,20 @@ final class Int64Vector extends IntVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
return super.fromArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
return super.fromArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m);
}
@ForceInline
@ -784,6 +839,13 @@ final class Int64Vector extends IntVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
return super.fromByteArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -791,6 +853,13 @@ final class Int64Vector extends IntVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
return super.fromByteBuffer0Template(Int64Mask.class, bb, offset, (Int64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -798,6 +867,21 @@ final class Int64Vector extends IntVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
super.intoArray0Template(Int64Mask.class, a, offset, (Int64Mask) m);
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
super.intoArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m);
}
@ForceInline
@Override
final
@ -805,6 +889,21 @@ final class Int64Vector extends IntVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
super.intoByteArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
super.intoByteBuffer0Template(Int64Mask.class, bb, offset, (Int64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class IntMaxVector extends IntVector {
@ForceInline
final @Override
int rOp(int v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
int rOp(int v, VectorMask<Integer> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class IntMaxVector extends IntVector {
return (IntMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public IntMaxVector lanewise(Unary op, VectorMask<Integer> m) {
return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialize
}
@Override
@ForceInline
public IntMaxVector lanewise(Binary op, Vector<Integer> v) {
return (IntMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public IntMaxVector lanewise(Binary op, Vector<Integer> v, VectorMask<Integer> m) {
return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v, (IntMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline IntMaxVector
@ -286,15 +298,30 @@ final class IntMaxVector extends IntVector {
return (IntMaxVector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline IntMaxVector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Integer> m) {
return (IntMaxVector) super.lanewiseShiftTemplate(op, IntMaxMask.class, e, (IntMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
IntMaxVector
lanewise(VectorOperators.Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2) {
return (IntMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
IntMaxVector
lanewise(Ternary op, Vector<Integer> v1, Vector<Integer> v2, VectorMask<Integer> m) {
return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v1, v2, (IntMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class IntMaxVector extends IntVector {
@ForceInline
public final int reduceLanes(VectorOperators.Associative op,
VectorMask<Integer> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class IntMaxVector extends IntVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Integer> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class IntMaxVector extends IntVector {
return super.compareTemplate(IntMaxMask.class, op, s); // specialize
}
@Override
@ForceInline
public final IntMaxMask compare(Comparison op, Vector<Integer> v, VectorMask<Integer> m) {
return super.compareTemplate(IntMaxMask.class, op, v, (IntMaxMask) m);
}
@Override
@ForceInline
public IntMaxVector blend(Vector<Integer> v, VectorMask<Integer> m) {
@ -419,6 +453,7 @@ final class IntMaxVector extends IntVector {
VectorMask<Integer> m) {
return (IntMaxVector)
super.rearrangeTemplate(IntMaxShuffle.class,
IntMaxMask.class,
(IntMaxShuffle) shuffle,
(IntMaxMask) m); // specialize
}
@ -582,16 +617,12 @@ final class IntMaxVector extends IntVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
IntMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -617,9 +648,9 @@ final class IntMaxVector extends IntVector {
public IntMaxMask and(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
IntMaxMask m = (IntMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -627,9 +658,9 @@ final class IntMaxVector extends IntVector {
public IntMaxMask or(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
IntMaxMask m = (IntMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -637,9 +668,9 @@ final class IntMaxVector extends IntVector {
IntMaxMask xor(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
IntMaxMask m = (IntMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaxMask.class, int.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaxMask.class, null, int.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -647,22 +678,32 @@ final class IntMaxVector extends IntVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(((IntMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(((IntMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(((IntMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMaxMask.class, int.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -784,6 +825,20 @@ final class IntMaxVector extends IntVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, VectorMask<Integer> m) {
return super.fromArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize
}
@ForceInline
@Override
final
IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
return super.fromArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m);
}
@ForceInline
@ -793,6 +848,13 @@ final class IntMaxVector extends IntVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
return super.fromByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -800,6 +862,13 @@ final class IntMaxVector extends IntVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
return super.fromByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -807,6 +876,21 @@ final class IntMaxVector extends IntVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, VectorMask<Integer> m) {
super.intoArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m);
}
@ForceInline
@Override
final
void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Integer> m) {
super.intoArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m);
}
@ForceInline
@Override
final
@ -814,6 +898,21 @@ final class IntMaxVector extends IntVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Integer> m) {
super.intoByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Integer> m) {
super.intoByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -231,8 +231,8 @@ final class Long128Vector extends LongVector {
@ForceInline
final @Override
long rOp(long v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
long rOp(long v, VectorMask<Long> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -268,12 +268,24 @@ final class Long128Vector extends LongVector {
return (Long128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Long128Vector lanewise(Unary op, VectorMask<Long> m) {
return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, (Long128Mask) m); // specialize
}
@Override
@ForceInline
public Long128Vector lanewise(Binary op, Vector<Long> v) {
return (Long128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Long128Vector lanewise(Binary op, Vector<Long> v, VectorMask<Long> m) {
return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v, (Long128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Long128Vector
@ -281,15 +293,30 @@ final class Long128Vector extends LongVector {
return (Long128Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Long128Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Long> m) {
return (Long128Vector) super.lanewiseShiftTemplate(op, Long128Mask.class, e, (Long128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Long128Vector
lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2) {
return (Long128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Long128Vector
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) {
return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v1, v2, (Long128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -309,7 +336,7 @@ final class Long128Vector extends LongVector {
@ForceInline
public final long reduceLanes(VectorOperators.Associative op,
VectorMask<Long> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized
}
@Override
@ -322,7 +349,7 @@ final class Long128Vector extends LongVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Long> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized
}
@ForceInline
@ -353,6 +380,13 @@ final class Long128Vector extends LongVector {
}
@Override
@ForceInline
public final Long128Mask compare(Comparison op, Vector<Long> v, VectorMask<Long> m) {
return super.compareTemplate(Long128Mask.class, op, v, (Long128Mask) m);
}
@Override
@ForceInline
public Long128Vector blend(Vector<Long> v, VectorMask<Long> m) {
@ -409,6 +443,7 @@ final class Long128Vector extends LongVector {
VectorMask<Long> m) {
return (Long128Vector)
super.rearrangeTemplate(Long128Shuffle.class,
Long128Mask.class,
(Long128Shuffle) shuffle,
(Long128Mask) m); // specialize
}
@ -574,16 +609,12 @@ final class Long128Vector extends LongVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Long128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -609,9 +640,9 @@ final class Long128Vector extends LongVector {
public Long128Mask and(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long128Mask m = (Long128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Long128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Long128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -619,9 +650,9 @@ final class Long128Vector extends LongVector {
public Long128Mask or(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long128Mask m = (Long128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Long128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Long128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -629,9 +660,9 @@ final class Long128Vector extends LongVector {
Long128Mask xor(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long128Mask m = (Long128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long128Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long128Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -639,22 +670,32 @@ final class Long128Vector extends LongVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long128Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Long128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long128Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long128Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Long128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long128Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long128Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Long128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long128Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long128Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -765,6 +806,20 @@ final class Long128Vector extends LongVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
return super.fromArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
return super.fromArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m);
}
@ForceInline
@ -774,6 +829,13 @@ final class Long128Vector extends LongVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
return super.fromByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -781,6 +843,13 @@ final class Long128Vector extends LongVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
return super.fromByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -788,6 +857,21 @@ final class Long128Vector extends LongVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, VectorMask<Long> m) {
super.intoArray0Template(Long128Mask.class, a, offset, (Long128Mask) m);
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
super.intoArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m);
}
@ForceInline
@Override
final
@ -795,6 +879,21 @@ final class Long128Vector extends LongVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
super.intoByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
super.intoByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -231,8 +231,8 @@ final class Long256Vector extends LongVector {
@ForceInline
final @Override
long rOp(long v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
long rOp(long v, VectorMask<Long> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -268,12 +268,24 @@ final class Long256Vector extends LongVector {
return (Long256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Long256Vector lanewise(Unary op, VectorMask<Long> m) {
return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, (Long256Mask) m); // specialize
}
@Override
@ForceInline
public Long256Vector lanewise(Binary op, Vector<Long> v) {
return (Long256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Long256Vector lanewise(Binary op, Vector<Long> v, VectorMask<Long> m) {
return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v, (Long256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Long256Vector
@ -281,15 +293,30 @@ final class Long256Vector extends LongVector {
return (Long256Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Long256Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Long> m) {
return (Long256Vector) super.lanewiseShiftTemplate(op, Long256Mask.class, e, (Long256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Long256Vector
lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2) {
return (Long256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Long256Vector
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) {
return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v1, v2, (Long256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -309,7 +336,7 @@ final class Long256Vector extends LongVector {
@ForceInline
public final long reduceLanes(VectorOperators.Associative op,
VectorMask<Long> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized
}
@Override
@ -322,7 +349,7 @@ final class Long256Vector extends LongVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Long> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized
}
@ForceInline
@ -353,6 +380,13 @@ final class Long256Vector extends LongVector {
}
@Override
@ForceInline
public final Long256Mask compare(Comparison op, Vector<Long> v, VectorMask<Long> m) {
return super.compareTemplate(Long256Mask.class, op, v, (Long256Mask) m);
}
@Override
@ForceInline
public Long256Vector blend(Vector<Long> v, VectorMask<Long> m) {
@ -409,6 +443,7 @@ final class Long256Vector extends LongVector {
VectorMask<Long> m) {
return (Long256Vector)
super.rearrangeTemplate(Long256Shuffle.class,
Long256Mask.class,
(Long256Shuffle) shuffle,
(Long256Mask) m); // specialize
}
@ -578,16 +613,12 @@ final class Long256Vector extends LongVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Long256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -613,9 +644,9 @@ final class Long256Vector extends LongVector {
public Long256Mask and(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long256Mask m = (Long256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Long256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Long256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -623,9 +654,9 @@ final class Long256Vector extends LongVector {
public Long256Mask or(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long256Mask m = (Long256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Long256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Long256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -633,9 +664,9 @@ final class Long256Vector extends LongVector {
Long256Mask xor(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long256Mask m = (Long256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long256Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long256Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -643,22 +674,32 @@ final class Long256Vector extends LongVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long256Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Long256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long256Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long256Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Long256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long256Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long256Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Long256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long256Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long256Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -769,6 +810,20 @@ final class Long256Vector extends LongVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
return super.fromArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
return super.fromArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m);
}
@ForceInline
@ -778,6 +833,13 @@ final class Long256Vector extends LongVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
return super.fromByteArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -785,6 +847,13 @@ final class Long256Vector extends LongVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
return super.fromByteBuffer0Template(Long256Mask.class, bb, offset, (Long256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -792,6 +861,21 @@ final class Long256Vector extends LongVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, VectorMask<Long> m) {
super.intoArray0Template(Long256Mask.class, a, offset, (Long256Mask) m);
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
super.intoArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m);
}
@ForceInline
@Override
final
@ -799,6 +883,21 @@ final class Long256Vector extends LongVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
super.intoByteArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
super.intoByteBuffer0Template(Long256Mask.class, bb, offset, (Long256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -231,8 +231,8 @@ final class Long512Vector extends LongVector {
@ForceInline
final @Override
long rOp(long v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
long rOp(long v, VectorMask<Long> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -268,12 +268,24 @@ final class Long512Vector extends LongVector {
return (Long512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Long512Vector lanewise(Unary op, VectorMask<Long> m) {
return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, (Long512Mask) m); // specialize
}
@Override
@ForceInline
public Long512Vector lanewise(Binary op, Vector<Long> v) {
return (Long512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Long512Vector lanewise(Binary op, Vector<Long> v, VectorMask<Long> m) {
return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v, (Long512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Long512Vector
@ -281,15 +293,30 @@ final class Long512Vector extends LongVector {
return (Long512Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Long512Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Long> m) {
return (Long512Vector) super.lanewiseShiftTemplate(op, Long512Mask.class, e, (Long512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Long512Vector
lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2) {
return (Long512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Long512Vector
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) {
return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v1, v2, (Long512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -309,7 +336,7 @@ final class Long512Vector extends LongVector {
@ForceInline
public final long reduceLanes(VectorOperators.Associative op,
VectorMask<Long> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized
}
@Override
@ -322,7 +349,7 @@ final class Long512Vector extends LongVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Long> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized
}
@ForceInline
@ -353,6 +380,13 @@ final class Long512Vector extends LongVector {
}
@Override
@ForceInline
public final Long512Mask compare(Comparison op, Vector<Long> v, VectorMask<Long> m) {
return super.compareTemplate(Long512Mask.class, op, v, (Long512Mask) m);
}
@Override
@ForceInline
public Long512Vector blend(Vector<Long> v, VectorMask<Long> m) {
@ -409,6 +443,7 @@ final class Long512Vector extends LongVector {
VectorMask<Long> m) {
return (Long512Vector)
super.rearrangeTemplate(Long512Shuffle.class,
Long512Mask.class,
(Long512Shuffle) shuffle,
(Long512Mask) m); // specialize
}
@ -586,16 +621,12 @@ final class Long512Vector extends LongVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Long512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -621,9 +652,9 @@ final class Long512Vector extends LongVector {
public Long512Mask and(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long512Mask m = (Long512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Long512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Long512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -631,9 +662,9 @@ final class Long512Vector extends LongVector {
public Long512Mask or(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long512Mask m = (Long512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Long512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Long512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -641,9 +672,9 @@ final class Long512Vector extends LongVector {
Long512Mask xor(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long512Mask m = (Long512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long512Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long512Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -651,22 +682,32 @@ final class Long512Vector extends LongVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long512Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Long512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long512Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long512Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Long512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long512Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long512Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Long512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long512Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long512Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -777,6 +818,20 @@ final class Long512Vector extends LongVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
return super.fromArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
return super.fromArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m);
}
@ForceInline
@ -786,6 +841,13 @@ final class Long512Vector extends LongVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
return super.fromByteArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -793,6 +855,13 @@ final class Long512Vector extends LongVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
return super.fromByteBuffer0Template(Long512Mask.class, bb, offset, (Long512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -800,6 +869,21 @@ final class Long512Vector extends LongVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, VectorMask<Long> m) {
super.intoArray0Template(Long512Mask.class, a, offset, (Long512Mask) m);
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
super.intoArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m);
}
@ForceInline
@Override
final
@ -807,6 +891,21 @@ final class Long512Vector extends LongVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
super.intoByteArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
super.intoByteBuffer0Template(Long512Mask.class, bb, offset, (Long512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -231,8 +231,8 @@ final class Long64Vector extends LongVector {
@ForceInline
final @Override
long rOp(long v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
long rOp(long v, VectorMask<Long> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -268,12 +268,24 @@ final class Long64Vector extends LongVector {
return (Long64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Long64Vector lanewise(Unary op, VectorMask<Long> m) {
return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, (Long64Mask) m); // specialize
}
@Override
@ForceInline
public Long64Vector lanewise(Binary op, Vector<Long> v) {
return (Long64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Long64Vector lanewise(Binary op, Vector<Long> v, VectorMask<Long> m) {
return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v, (Long64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Long64Vector
@ -281,15 +293,30 @@ final class Long64Vector extends LongVector {
return (Long64Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Long64Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Long> m) {
return (Long64Vector) super.lanewiseShiftTemplate(op, Long64Mask.class, e, (Long64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Long64Vector
lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2) {
return (Long64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Long64Vector
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) {
return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v1, v2, (Long64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -309,7 +336,7 @@ final class Long64Vector extends LongVector {
@ForceInline
public final long reduceLanes(VectorOperators.Associative op,
VectorMask<Long> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized
}
@Override
@ -322,7 +349,7 @@ final class Long64Vector extends LongVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Long> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized
}
@ForceInline
@ -353,6 +380,13 @@ final class Long64Vector extends LongVector {
}
@Override
@ForceInline
public final Long64Mask compare(Comparison op, Vector<Long> v, VectorMask<Long> m) {
return super.compareTemplate(Long64Mask.class, op, v, (Long64Mask) m);
}
@Override
@ForceInline
public Long64Vector blend(Vector<Long> v, VectorMask<Long> m) {
@ -409,6 +443,7 @@ final class Long64Vector extends LongVector {
VectorMask<Long> m) {
return (Long64Vector)
super.rearrangeTemplate(Long64Shuffle.class,
Long64Mask.class,
(Long64Shuffle) shuffle,
(Long64Mask) m); // specialize
}
@ -572,16 +607,12 @@ final class Long64Vector extends LongVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Long64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -607,9 +638,9 @@ final class Long64Vector extends LongVector {
public Long64Mask and(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long64Mask m = (Long64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Long64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Long64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -617,9 +648,9 @@ final class Long64Vector extends LongVector {
public Long64Mask or(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long64Mask m = (Long64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Long64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Long64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -627,9 +658,9 @@ final class Long64Vector extends LongVector {
Long64Mask xor(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long64Mask m = (Long64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long64Mask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Long64Mask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -637,22 +668,32 @@ final class Long64Vector extends LongVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long64Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((Long64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long64Mask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long64Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((Long64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long64Mask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long64Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((Long64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long64Mask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long64Mask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -763,6 +804,20 @@ final class Long64Vector extends LongVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
return super.fromArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
return super.fromArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m);
}
@ForceInline
@ -772,6 +827,13 @@ final class Long64Vector extends LongVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
return super.fromByteArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -779,6 +841,13 @@ final class Long64Vector extends LongVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
return super.fromByteBuffer0Template(Long64Mask.class, bb, offset, (Long64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -786,6 +855,21 @@ final class Long64Vector extends LongVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, VectorMask<Long> m) {
super.intoArray0Template(Long64Mask.class, a, offset, (Long64Mask) m);
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
super.intoArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m);
}
@ForceInline
@Override
final
@ -793,6 +877,21 @@ final class Long64Vector extends LongVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
super.intoByteArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
super.intoByteBuffer0Template(Long64Mask.class, bb, offset, (Long64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -231,8 +231,8 @@ final class LongMaxVector extends LongVector {
@ForceInline
final @Override
long rOp(long v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
long rOp(long v, VectorMask<Long> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -268,12 +268,24 @@ final class LongMaxVector extends LongVector {
return (LongMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public LongMaxVector lanewise(Unary op, VectorMask<Long> m) {
return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialize
}
@Override
@ForceInline
public LongMaxVector lanewise(Binary op, Vector<Long> v) {
return (LongMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public LongMaxVector lanewise(Binary op, Vector<Long> v, VectorMask<Long> m) {
return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v, (LongMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline LongMaxVector
@ -281,15 +293,30 @@ final class LongMaxVector extends LongVector {
return (LongMaxVector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline LongMaxVector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Long> m) {
return (LongMaxVector) super.lanewiseShiftTemplate(op, LongMaxMask.class, e, (LongMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
LongMaxVector
lanewise(VectorOperators.Ternary op, Vector<Long> v1, Vector<Long> v2) {
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2) {
return (LongMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
LongMaxVector
lanewise(Ternary op, Vector<Long> v1, Vector<Long> v2, VectorMask<Long> m) {
return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v1, v2, (LongMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -309,7 +336,7 @@ final class LongMaxVector extends LongVector {
@ForceInline
public final long reduceLanes(VectorOperators.Associative op,
VectorMask<Long> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized
}
@Override
@ -322,7 +349,7 @@ final class LongMaxVector extends LongVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Long> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized
}
@ForceInline
@ -353,6 +380,13 @@ final class LongMaxVector extends LongVector {
}
@Override
@ForceInline
public final LongMaxMask compare(Comparison op, Vector<Long> v, VectorMask<Long> m) {
return super.compareTemplate(LongMaxMask.class, op, v, (LongMaxMask) m);
}
@Override
@ForceInline
public LongMaxVector blend(Vector<Long> v, VectorMask<Long> m) {
@ -409,6 +443,7 @@ final class LongMaxVector extends LongVector {
VectorMask<Long> m) {
return (LongMaxVector)
super.rearrangeTemplate(LongMaxShuffle.class,
LongMaxMask.class,
(LongMaxShuffle) shuffle,
(LongMaxMask) m); // specialize
}
@ -572,16 +607,12 @@ final class LongMaxVector extends LongVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
LongMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -607,9 +638,9 @@ final class LongMaxVector extends LongVector {
public LongMaxMask and(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
LongMaxMask m = (LongMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -617,9 +648,9 @@ final class LongMaxVector extends LongVector {
public LongMaxMask or(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
LongMaxMask m = (LongMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -627,9 +658,9 @@ final class LongMaxVector extends LongVector {
LongMaxMask xor(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
LongMaxMask m = (LongMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaxMask.class, long.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaxMask.class, null, long.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -637,22 +668,32 @@ final class LongMaxVector extends LongVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(((LongMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(((LongMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(((LongMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMaxMask.class, long.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -763,6 +804,20 @@ final class LongMaxVector extends LongVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, VectorMask<Long> m) {
return super.fromArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize
}
@ForceInline
@Override
final
LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
return super.fromArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m);
}
@ForceInline
@ -772,6 +827,13 @@ final class LongMaxVector extends LongVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteArray0(byte[] a, int offset, VectorMask<Long> m) {
return super.fromByteArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -779,6 +841,13 @@ final class LongMaxVector extends LongVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
return super.fromByteBuffer0Template(LongMaxMask.class, bb, offset, (LongMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -786,6 +855,21 @@ final class LongMaxVector extends LongVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, VectorMask<Long> m) {
super.intoArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m);
}
@ForceInline
@Override
final
void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask<Long> m) {
super.intoArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m);
}
@ForceInline
@Override
final
@ -793,6 +877,21 @@ final class LongMaxVector extends LongVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Long> m) {
super.intoByteArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Long> m) {
super.intoByteBuffer0Template(LongMaxMask.class, bb, offset, (LongMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Short128Vector extends ShortVector {
@ForceInline
final @Override
short rOp(short v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
short rOp(short v, VectorMask<Short> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Short128Vector extends ShortVector {
return (Short128Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Short128Vector lanewise(Unary op, VectorMask<Short> m) {
return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, (Short128Mask) m); // specialize
}
@Override
@ForceInline
public Short128Vector lanewise(Binary op, Vector<Short> v) {
return (Short128Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Short128Vector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v, (Short128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Short128Vector
@ -286,15 +298,30 @@ final class Short128Vector extends ShortVector {
return (Short128Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Short128Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
return (Short128Vector) super.lanewiseShiftTemplate(op, Short128Mask.class, e, (Short128Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Short128Vector
lanewise(VectorOperators.Ternary op, Vector<Short> v1, Vector<Short> v2) {
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
return (Short128Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Short128Vector
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v1, v2, (Short128Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Short128Vector extends ShortVector {
@ForceInline
public final short reduceLanes(VectorOperators.Associative op,
VectorMask<Short> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Short128Vector extends ShortVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Short> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Short128Vector extends ShortVector {
return super.compareTemplate(Short128Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Short128Mask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
return super.compareTemplate(Short128Mask.class, op, v, (Short128Mask) m);
}
@Override
@ForceInline
public Short128Vector blend(Vector<Short> v, VectorMask<Short> m) {
@ -419,6 +453,7 @@ final class Short128Vector extends ShortVector {
VectorMask<Short> m) {
return (Short128Vector)
super.rearrangeTemplate(Short128Shuffle.class,
Short128Mask.class,
(Short128Shuffle) shuffle,
(Short128Mask) m); // specialize
}
@ -596,16 +631,12 @@ final class Short128Vector extends ShortVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Short128Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -631,9 +662,9 @@ final class Short128Vector extends ShortVector {
public Short128Mask and(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short128Mask m = (Short128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -641,9 +672,9 @@ final class Short128Vector extends ShortVector {
public Short128Mask or(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short128Mask m = (Short128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -651,9 +682,9 @@ final class Short128Vector extends ShortVector {
Short128Mask xor(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short128Mask m = (Short128Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short128Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short128Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -661,22 +692,32 @@ final class Short128Vector extends ShortVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short128Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(((Short128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short128Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short128Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(((Short128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short128Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short128Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(((Short128Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short128Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short128Mask.class, short.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -787,6 +828,14 @@ final class Short128Vector extends ShortVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
return super.fromArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -794,6 +843,13 @@ final class Short128Vector extends ShortVector {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
return super.fromCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize
}
@ForceInline
@Override
@ -802,6 +858,13 @@ final class Short128Vector extends ShortVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
return super.fromByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -809,6 +872,13 @@ final class Short128Vector extends ShortVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
return super.fromByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m); // specialize
}
@ForceInline
@Override
final
@ -816,6 +886,15 @@ final class Short128Vector extends ShortVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(short[] a, int offset, VectorMask<Short> m) {
super.intoArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
}
@ForceInline
@Override
final
@ -823,6 +902,27 @@ final class Short128Vector extends ShortVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
super.intoByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
super.intoByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m);
}
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
super.intoCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Short256Vector extends ShortVector {
@ForceInline
final @Override
short rOp(short v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
short rOp(short v, VectorMask<Short> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Short256Vector extends ShortVector {
return (Short256Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Short256Vector lanewise(Unary op, VectorMask<Short> m) {
return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, (Short256Mask) m); // specialize
}
@Override
@ForceInline
public Short256Vector lanewise(Binary op, Vector<Short> v) {
return (Short256Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Short256Vector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v, (Short256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Short256Vector
@ -286,15 +298,30 @@ final class Short256Vector extends ShortVector {
return (Short256Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Short256Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
return (Short256Vector) super.lanewiseShiftTemplate(op, Short256Mask.class, e, (Short256Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Short256Vector
lanewise(VectorOperators.Ternary op, Vector<Short> v1, Vector<Short> v2) {
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
return (Short256Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Short256Vector
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v1, v2, (Short256Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Short256Vector extends ShortVector {
@ForceInline
public final short reduceLanes(VectorOperators.Associative op,
VectorMask<Short> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Short256Vector extends ShortVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Short> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Short256Vector extends ShortVector {
return super.compareTemplate(Short256Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Short256Mask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
return super.compareTemplate(Short256Mask.class, op, v, (Short256Mask) m);
}
@Override
@ForceInline
public Short256Vector blend(Vector<Short> v, VectorMask<Short> m) {
@ -419,6 +453,7 @@ final class Short256Vector extends ShortVector {
VectorMask<Short> m) {
return (Short256Vector)
super.rearrangeTemplate(Short256Shuffle.class,
Short256Mask.class,
(Short256Shuffle) shuffle,
(Short256Mask) m); // specialize
}
@ -612,16 +647,12 @@ final class Short256Vector extends ShortVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Short256Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -647,9 +678,9 @@ final class Short256Vector extends ShortVector {
public Short256Mask and(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short256Mask m = (Short256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Short256Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Short256Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -657,9 +688,9 @@ final class Short256Vector extends ShortVector {
public Short256Mask or(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short256Mask m = (Short256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Short256Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Short256Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -667,9 +698,9 @@ final class Short256Vector extends ShortVector {
Short256Mask xor(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short256Mask m = (Short256Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short256Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short256Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -677,22 +708,32 @@ final class Short256Vector extends ShortVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short256Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(((Short256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short256Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short256Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(((Short256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short256Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short256Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(((Short256Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short256Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short256Mask.class, short.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -803,6 +844,14 @@ final class Short256Vector extends ShortVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
return super.fromArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -810,6 +859,13 @@ final class Short256Vector extends ShortVector {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
return super.fromCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize
}
@ForceInline
@Override
@ -818,6 +874,13 @@ final class Short256Vector extends ShortVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
return super.fromByteArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -825,6 +888,13 @@ final class Short256Vector extends ShortVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
return super.fromByteBuffer0Template(Short256Mask.class, bb, offset, (Short256Mask) m); // specialize
}
@ForceInline
@Override
final
@ -832,6 +902,15 @@ final class Short256Vector extends ShortVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(short[] a, int offset, VectorMask<Short> m) {
super.intoArray0Template(Short256Mask.class, a, offset, (Short256Mask) m);
}
@ForceInline
@Override
final
@ -839,6 +918,27 @@ final class Short256Vector extends ShortVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
super.intoByteArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
super.intoByteBuffer0Template(Short256Mask.class, bb, offset, (Short256Mask) m);
}
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
super.intoCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Short512Vector extends ShortVector {
@ForceInline
final @Override
short rOp(short v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
short rOp(short v, VectorMask<Short> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Short512Vector extends ShortVector {
return (Short512Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Short512Vector lanewise(Unary op, VectorMask<Short> m) {
return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, (Short512Mask) m); // specialize
}
@Override
@ForceInline
public Short512Vector lanewise(Binary op, Vector<Short> v) {
return (Short512Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Short512Vector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v, (Short512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Short512Vector
@ -286,15 +298,30 @@ final class Short512Vector extends ShortVector {
return (Short512Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Short512Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
return (Short512Vector) super.lanewiseShiftTemplate(op, Short512Mask.class, e, (Short512Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Short512Vector
lanewise(VectorOperators.Ternary op, Vector<Short> v1, Vector<Short> v2) {
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
return (Short512Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Short512Vector
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v1, v2, (Short512Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Short512Vector extends ShortVector {
@ForceInline
public final short reduceLanes(VectorOperators.Associative op,
VectorMask<Short> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Short512Vector extends ShortVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Short> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Short512Vector extends ShortVector {
return super.compareTemplate(Short512Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Short512Mask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
return super.compareTemplate(Short512Mask.class, op, v, (Short512Mask) m);
}
@Override
@ForceInline
public Short512Vector blend(Vector<Short> v, VectorMask<Short> m) {
@ -419,6 +453,7 @@ final class Short512Vector extends ShortVector {
VectorMask<Short> m) {
return (Short512Vector)
super.rearrangeTemplate(Short512Shuffle.class,
Short512Mask.class,
(Short512Shuffle) shuffle,
(Short512Mask) m); // specialize
}
@ -644,16 +679,12 @@ final class Short512Vector extends ShortVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Short512Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -679,9 +710,9 @@ final class Short512Vector extends ShortVector {
public Short512Mask and(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short512Mask m = (Short512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -689,9 +720,9 @@ final class Short512Vector extends ShortVector {
public Short512Mask or(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short512Mask m = (Short512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -699,9 +730,9 @@ final class Short512Vector extends ShortVector {
Short512Mask xor(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short512Mask m = (Short512Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -709,22 +740,32 @@ final class Short512Vector extends ShortVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(((Short512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(((Short512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(((Short512Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short512Mask.class, short.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -835,6 +876,14 @@ final class Short512Vector extends ShortVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
return super.fromArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -842,6 +891,13 @@ final class Short512Vector extends ShortVector {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
return super.fromCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize
}
@ForceInline
@Override
@ -850,6 +906,13 @@ final class Short512Vector extends ShortVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
return super.fromByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -857,6 +920,13 @@ final class Short512Vector extends ShortVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
return super.fromByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m); // specialize
}
@ForceInline
@Override
final
@ -864,6 +934,15 @@ final class Short512Vector extends ShortVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(short[] a, int offset, VectorMask<Short> m) {
super.intoArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);
}
@ForceInline
@Override
final
@ -871,6 +950,27 @@ final class Short512Vector extends ShortVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
super.intoByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
super.intoByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m);
}
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
super.intoCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class Short64Vector extends ShortVector {
@ForceInline
final @Override
short rOp(short v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
short rOp(short v, VectorMask<Short> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class Short64Vector extends ShortVector {
return (Short64Vector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public Short64Vector lanewise(Unary op, VectorMask<Short> m) {
return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, (Short64Mask) m); // specialize
}
@Override
@ForceInline
public Short64Vector lanewise(Binary op, Vector<Short> v) {
return (Short64Vector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public Short64Vector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v, (Short64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline Short64Vector
@ -286,15 +298,30 @@ final class Short64Vector extends ShortVector {
return (Short64Vector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline Short64Vector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
return (Short64Vector) super.lanewiseShiftTemplate(op, Short64Mask.class, e, (Short64Mask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
Short64Vector
lanewise(VectorOperators.Ternary op, Vector<Short> v1, Vector<Short> v2) {
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
return (Short64Vector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
Short64Vector
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v1, v2, (Short64Mask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class Short64Vector extends ShortVector {
@ForceInline
public final short reduceLanes(VectorOperators.Associative op,
VectorMask<Short> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class Short64Vector extends ShortVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Short> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class Short64Vector extends ShortVector {
return super.compareTemplate(Short64Mask.class, op, s); // specialize
}
@Override
@ForceInline
public final Short64Mask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
return super.compareTemplate(Short64Mask.class, op, v, (Short64Mask) m);
}
@Override
@ForceInline
public Short64Vector blend(Vector<Short> v, VectorMask<Short> m) {
@ -419,6 +453,7 @@ final class Short64Vector extends ShortVector {
VectorMask<Short> m) {
return (Short64Vector)
super.rearrangeTemplate(Short64Shuffle.class,
Short64Mask.class,
(Short64Shuffle) shuffle,
(Short64Mask) m); // specialize
}
@ -588,16 +623,12 @@ final class Short64Vector extends ShortVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
Short64Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -623,9 +654,9 @@ final class Short64Vector extends ShortVector {
public Short64Mask and(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short64Mask m = (Short64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -633,9 +664,9 @@ final class Short64Vector extends ShortVector {
public Short64Mask or(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short64Mask m = (Short64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -643,9 +674,9 @@ final class Short64Vector extends ShortVector {
Short64Mask xor(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short64Mask m = (Short64Mask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -653,22 +684,32 @@ final class Short64Vector extends ShortVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short64Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(((Short64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short64Mask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(((Short64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(((Short64Mask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short64Mask.class, short.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -779,6 +820,14 @@ final class Short64Vector extends ShortVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
return super.fromArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -786,6 +835,13 @@ final class Short64Vector extends ShortVector {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
return super.fromCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize
}
@ForceInline
@Override
@ -794,6 +850,13 @@ final class Short64Vector extends ShortVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
return super.fromByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -801,6 +864,13 @@ final class Short64Vector extends ShortVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
return super.fromByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m); // specialize
}
@ForceInline
@Override
final
@ -808,6 +878,15 @@ final class Short64Vector extends ShortVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(short[] a, int offset, VectorMask<Short> m) {
super.intoArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);
}
@ForceInline
@Override
final
@ -815,6 +894,27 @@ final class Short64Vector extends ShortVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
super.intoByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
super.intoByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m);
}
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
super.intoCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -236,8 +236,8 @@ final class ShortMaxVector extends ShortVector {
@ForceInline
final @Override
short rOp(short v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
short rOp(short v, VectorMask<Short> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -273,12 +273,24 @@ final class ShortMaxVector extends ShortVector {
return (ShortMaxVector) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public ShortMaxVector lanewise(Unary op, VectorMask<Short> m) {
return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialize
}
@Override
@ForceInline
public ShortMaxVector lanewise(Binary op, Vector<Short> v) {
return (ShortMaxVector) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public ShortMaxVector lanewise(Binary op, Vector<Short> v, VectorMask<Short> m) {
return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v, (ShortMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline ShortMaxVector
@ -286,15 +298,30 @@ final class ShortMaxVector extends ShortVector {
return (ShortMaxVector) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline ShortMaxVector
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<Short> m) {
return (ShortMaxVector) super.lanewiseShiftTemplate(op, ShortMaxMask.class, e, (ShortMaxMask) m); // specialize
}
/*package-private*/
@Override
@ForceInline
public final
ShortMaxVector
lanewise(VectorOperators.Ternary op, Vector<Short> v1, Vector<Short> v2) {
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2) {
return (ShortMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
ShortMaxVector
lanewise(Ternary op, Vector<Short> v1, Vector<Short> v2, VectorMask<Short> m) {
return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v1, v2, (ShortMaxMask) m); // specialize
}
@Override
@ForceInline
public final
@ -314,7 +341,7 @@ final class ShortMaxVector extends ShortVector {
@ForceInline
public final short reduceLanes(VectorOperators.Associative op,
VectorMask<Short> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized
}
@Override
@ -327,7 +354,7 @@ final class ShortMaxVector extends ShortVector {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<Short> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized
}
@ForceInline
@ -363,6 +390,13 @@ final class ShortMaxVector extends ShortVector {
return super.compareTemplate(ShortMaxMask.class, op, s); // specialize
}
@Override
@ForceInline
public final ShortMaxMask compare(Comparison op, Vector<Short> v, VectorMask<Short> m) {
return super.compareTemplate(ShortMaxMask.class, op, v, (ShortMaxMask) m);
}
@Override
@ForceInline
public ShortMaxVector blend(Vector<Short> v, VectorMask<Short> m) {
@ -419,6 +453,7 @@ final class ShortMaxVector extends ShortVector {
VectorMask<Short> m) {
return (ShortMaxVector)
super.rearrangeTemplate(ShortMaxShuffle.class,
ShortMaxMask.class,
(ShortMaxShuffle) shuffle,
(ShortMaxMask) m); // specialize
}
@ -582,16 +617,12 @@ final class ShortMaxVector extends ShortVector {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
ShortMaxMask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -617,9 +648,9 @@ final class ShortMaxVector extends ShortVector {
public ShortMaxMask and(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
ShortMaxMask m = (ShortMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -627,9 +658,9 @@ final class ShortMaxVector extends ShortVector {
public ShortMaxMask or(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
ShortMaxMask m = (ShortMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -637,9 +668,9 @@ final class ShortMaxVector extends ShortVector {
ShortMaxMask xor(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
ShortMaxMask m = (ShortMaxMask)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaxMask.class, short.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaxMask.class, null, short.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -647,22 +678,32 @@ final class ShortMaxVector extends ShortVector {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(((ShortMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(((ShortMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(((ShortMaxMask)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMaxMask.class, short.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -773,6 +814,14 @@ final class ShortMaxVector extends ShortVector {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromArray0(short[] a, int offset, VectorMask<Short> m) {
return super.fromArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -780,6 +829,13 @@ final class ShortMaxVector extends ShortVector {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromCharArray0(char[] a, int offset, VectorMask<Short> m) {
return super.fromCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize
}
@ForceInline
@Override
@ -788,6 +844,13 @@ final class ShortMaxVector extends ShortVector {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteArray0(byte[] a, int offset, VectorMask<Short> m) {
return super.fromByteArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -795,6 +858,13 @@ final class ShortMaxVector extends ShortVector {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
return super.fromByteBuffer0Template(ShortMaxMask.class, bb, offset, (ShortMaxMask) m); // specialize
}
@ForceInline
@Override
final
@ -802,6 +872,15 @@ final class ShortMaxVector extends ShortVector {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0(short[] a, int offset, VectorMask<Short> m) {
super.intoArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m);
}
@ForceInline
@Override
final
@ -809,6 +888,27 @@ final class ShortMaxVector extends ShortVector {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<Short> m) {
super.intoByteArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<Short> m) {
super.intoByteBuffer0Template(ShortMaxMask.class, bb, offset, (ShortMaxMask) m);
}
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<Short> m) {
super.intoCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m);
}
// End of specialized low-level memory operations.
// ================================================

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -516,6 +516,8 @@ public abstract class VectorMask<E> extends jdk.internal.vm.vector.VectorSupport
* @param i the lane index
*
* @return true if the lane at index {@code i} is set, otherwise false
* @throws IndexOutOfBoundsException if the index is out of range
* ({@code < 0 || >= length()})
*/
public abstract boolean laneIsSet(int i);
@ -553,6 +555,24 @@ public abstract class VectorMask<E> extends jdk.internal.vm.vector.VectorSupport
*/
public abstract <F> VectorMask<F> check(VectorSpecies<F> species);
/**
* Checks that this mask has the same class with the given mask class,
* and it has the same species with given vector's species,
* and returns this mask unchanged.
* The effect is similar to this pseudocode:
* {@code getClass() == maskClass &&
* vectorSpecies() == vector.species()
* ? this
* : throw new ClassCastException()}.
*
* @param maskClass the class required for this mask
* @param vector its species required for this mask
* @param <F> the boxed element type of the required species
* @return the same mask
* @throws ClassCastException if the species is wrong
*/
abstract <F> VectorMask<F> check(Class<? extends VectorMask<F>> maskClass, Vector<F> vector);
/**
* Returns a string representation of this mask, of the form
* {@code "Mask[T.TT...]"}, reporting the mask bit

View file

@ -238,8 +238,8 @@ final class $vectortype$ extends $abstractvectortype$ {
@ForceInline
final @Override
$type$ rOp($type$ v, FBinOp f) {
return super.rOpTemplate(v, f); // specialize
$type$ rOp($type$ v, VectorMask<$Boxtype$> m, FBinOp f) {
return super.rOpTemplate(v, m, f); // specialize
}
@Override
@ -275,12 +275,24 @@ final class $vectortype$ extends $abstractvectortype$ {
return ($vectortype$) super.lanewiseTemplate(op); // specialize
}
@Override
@ForceInline
public $vectortype$ lanewise(Unary op, VectorMask<$Boxtype$> m) {
return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, ($masktype$) m); // specialize
}
@Override
@ForceInline
public $vectortype$ lanewise(Binary op, Vector<$Boxtype$> v) {
return ($vectortype$) super.lanewiseTemplate(op, v); // specialize
}
@Override
@ForceInline
public $vectortype$ lanewise(Binary op, Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) {
return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, v, ($masktype$) m); // specialize
}
#if[!FP]
/*package-private*/
@Override
@ -288,6 +300,13 @@ final class $vectortype$ extends $abstractvectortype$ {
lanewiseShift(VectorOperators.Binary op, int e) {
return ($vectortype$) super.lanewiseShiftTemplate(op, e); // specialize
}
/*package-private*/
@Override
@ForceInline $vectortype$
lanewiseShift(VectorOperators.Binary op, int e, VectorMask<$Boxtype$> m) {
return ($vectortype$) super.lanewiseShiftTemplate(op, $masktype$.class, e, ($masktype$) m); // specialize
}
#end[!FP]
/*package-private*/
@ -295,10 +314,18 @@ final class $vectortype$ extends $abstractvectortype$ {
@ForceInline
public final
$vectortype$
lanewise(VectorOperators.Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2) {
lanewise(Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2) {
return ($vectortype$) super.lanewiseTemplate(op, v1, v2); // specialize
}
@Override
@ForceInline
public final
$vectortype$
lanewise(Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2, VectorMask<$Boxtype$> m) {
return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, v1, v2, ($masktype$) m); // specialize
}
@Override
@ForceInline
public final
@ -318,7 +345,7 @@ final class $vectortype$ extends $abstractvectortype$ {
@ForceInline
public final $type$ reduceLanes(VectorOperators.Associative op,
VectorMask<$Boxtype$> m) {
return super.reduceLanesTemplate(op, m); // specialized
return super.reduceLanesTemplate(op, $masktype$.class, ($masktype$) m); // specialized
}
@Override
@ -331,7 +358,7 @@ final class $vectortype$ extends $abstractvectortype$ {
@ForceInline
public final long reduceLanesToLong(VectorOperators.Associative op,
VectorMask<$Boxtype$> m) {
return (long) super.reduceLanesTemplate(op, m); // specialized
return (long) super.reduceLanesTemplate(op, $masktype$.class, ($masktype$) m); // specialized
}
@ForceInline
@ -369,6 +396,13 @@ final class $vectortype$ extends $abstractvectortype$ {
}
#end[!long]
@Override
@ForceInline
public final $masktype$ compare(Comparison op, Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) {
return super.compareTemplate($masktype$.class, op, v, ($masktype$) m);
}
@Override
@ForceInline
public $vectortype$ blend(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) {
@ -425,6 +459,7 @@ final class $vectortype$ extends $abstractvectortype$ {
VectorMask<$Boxtype$> m) {
return ($vectortype$)
super.rearrangeTemplate($shuffletype$.class,
$masktype$.class,
($shuffletype$) shuffle,
($masktype$) m); // specialize
}
@ -855,16 +890,12 @@ final class $vectortype$ extends $abstractvectortype$ {
AbstractSpecies<E> species = (AbstractSpecies<E>) dsp;
if (length() != species.laneCount())
throw new IllegalArgumentException("VectorMask length and species length differ");
if (VSIZE == species.vectorBitSize()) {
Class<?> dtype = species.elementType();
Class<?> dmtype = species.maskType();
return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET,
this.getClass(), ETYPE, VLENGTH,
dmtype, dtype, VLENGTH,
this, species,
$Type$$bits$Mask::defaultMaskCast);
}
return this.defaultMaskCast(species);
return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST,
this.getClass(), ETYPE, VLENGTH,
species.maskType(), species.elementType(), VLENGTH,
this, species,
(m, s) -> s.maskFactory(m.toArray()).check(s));
}
@Override
@ -890,9 +921,9 @@ final class $vectortype$ extends $abstractvectortype$ {
public $masktype$ and(VectorMask<$Boxtype$> mask) {
Objects.requireNonNull(mask);
$masktype$ m = ($masktype$)mask;
return VectorSupport.binaryOp(VECTOR_OP_AND, $masktype$.class, $bitstype$.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b));
return VectorSupport.binaryOp(VECTOR_OP_AND, $masktype$.class, null, $bitstype$.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b));
}
@Override
@ -900,9 +931,9 @@ final class $vectortype$ extends $abstractvectortype$ {
public $masktype$ or(VectorMask<$Boxtype$> mask) {
Objects.requireNonNull(mask);
$masktype$ m = ($masktype$)mask;
return VectorSupport.binaryOp(VECTOR_OP_OR, $masktype$.class, $bitstype$.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b));
return VectorSupport.binaryOp(VECTOR_OP_OR, $masktype$.class, null, $bitstype$.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b));
}
@ForceInline
@ -910,9 +941,9 @@ final class $vectortype$ extends $abstractvectortype$ {
$masktype$ xor(VectorMask<$Boxtype$> mask) {
Objects.requireNonNull(mask);
$masktype$ m = ($masktype$)mask;
return VectorSupport.binaryOp(VECTOR_OP_XOR, $masktype$.class, $bitstype$.class, VLENGTH,
this, m,
(m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b));
return VectorSupport.binaryOp(VECTOR_OP_XOR, $masktype$.class, null, $bitstype$.class, VLENGTH,
this, m, null,
(m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b));
}
// Mask Query operations
@ -920,22 +951,32 @@ final class $vectortype$ extends $abstractvectortype$ {
@Override
@ForceInline
public int trueCount() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> trueCountHelper((($masktype$)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> trueCountHelper(m.getBits()));
}
@Override
@ForceInline
public int firstTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> firstTrueHelper((($masktype$)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> firstTrueHelper(m.getBits()));
}
@Override
@ForceInline
public int lastTrue() {
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> lastTrueHelper((($masktype$)m).getBits()));
return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> lastTrueHelper(m.getBits()));
}
@Override
@ForceInline
public long toLong() {
if (length() > Long.SIZE) {
throw new UnsupportedOperationException("too many lanes for one long");
}
return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, $masktype$.class, $bitstype$.class, VLENGTH, this,
(m) -> toLongHelper(m.getBits()));
}
// Reductions
@ -1061,6 +1102,22 @@ final class $vectortype$ extends $abstractvectortype$ {
return super.fromArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
$abstractvectortype$ fromArray0($type$[] a, int offset, VectorMask<$Boxtype$> m) {
return super.fromArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize
}
#if[!byteOrShort]
@ForceInline
@Override
final
$abstractvectortype$ fromArray0($type$[] a, int offset, int[] indexMap, int mapOffset, VectorMask<$Boxtype$> m) {
return super.fromArray0Template($masktype$.class, a, offset, indexMap, mapOffset, ($masktype$) m);
}
#end[!byteOrShort]
#if[short]
@ForceInline
@Override
@ -1068,6 +1125,13 @@ final class $vectortype$ extends $abstractvectortype$ {
$abstractvectortype$ fromCharArray0(char[] a, int offset) {
return super.fromCharArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
$abstractvectortype$ fromCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m) {
return super.fromCharArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize
}
#end[short]
#if[byte]
@ -1077,6 +1141,13 @@ final class $vectortype$ extends $abstractvectortype$ {
$abstractvectortype$ fromBooleanArray0(boolean[] a, int offset) {
return super.fromBooleanArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
$abstractvectortype$ fromBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m) {
return super.fromBooleanArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize
}
#end[byte]
@ForceInline
@ -1086,6 +1157,13 @@ final class $vectortype$ extends $abstractvectortype$ {
return super.fromByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
$abstractvectortype$ fromByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) {
return super.fromByteArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize
}
@ForceInline
@Override
final
@ -1093,6 +1171,13 @@ final class $vectortype$ extends $abstractvectortype$ {
return super.fromByteBuffer0Template(bb, offset); // specialize
}
@ForceInline
@Override
final
$abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) {
return super.fromByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m); // specialize
}
@ForceInline
@Override
final
@ -1100,6 +1185,31 @@ final class $vectortype$ extends $abstractvectortype$ {
super.intoArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoArray0($type$[] a, int offset, VectorMask<$Boxtype$> m) {
super.intoArray0Template($masktype$.class, a, offset, ($masktype$) m);
}
#if[!byteOrShort]
@ForceInline
@Override
final
void intoArray0($type$[] a, int offset, int[] indexMap, int mapOffset, VectorMask<$Boxtype$> m) {
super.intoArray0Template($masktype$.class, a, offset, indexMap, mapOffset, ($masktype$) m);
}
#end[!byteOrShort]
#if[byte]
@ForceInline
@Override
final
void intoBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m) {
super.intoBooleanArray0Template($masktype$.class, a, offset, ($masktype$) m);
}
#end[byte]
@ForceInline
@Override
final
@ -1107,6 +1217,29 @@ final class $vectortype$ extends $abstractvectortype$ {
super.intoByteArray0Template(a, offset); // specialize
}
@ForceInline
@Override
final
void intoByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) {
super.intoByteArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize
}
@ForceInline
@Override
final
void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) {
super.intoByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m);
}
#if[short]
@ForceInline
@Override
final
void intoCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m) {
super.intoCharArray0Template($masktype$.class, a, offset, ($masktype$) m);
}
#end[short]
// End of specialized low-level memory operations.
// ================================================

View file

@ -19,9 +19,6 @@
; or visit www.oracle.com if you need additional information or have any
; questions.
; This file contains duplicate entries as globalDefinitions_vecApi.hpp
; It is intended for inclusion in .s files compiled with masm
; Used to check whether building on x86_64 architecture. Equivalent to checking in regular hpp file for #ifdef _WIN64
IFDEF RAX