8267969: Add vectorized implementation for VectorMask.eq()

Reviewed-by: psandoz, neliasso
This commit is contained in:
Xiaohong Gong 2021-06-02 07:50:46 +00:00 committed by Nils Eliasson
parent 1cea6cac12
commit 496fb90b3a
32 changed files with 248 additions and 6 deletions

View File

@ -114,12 +114,6 @@ abstract class AbstractMask<E> extends VectorMask<E> {
return (VectorMask<F>) this;
}
@Override
public VectorMask<E> eq(VectorMask<E> m) {
// FIXME: Generate good code here.
return bOp(m, (i, a, b) -> a == b);
}
@Override
public VectorMask<E> andNot(VectorMask<E> m) {
return and(m.not());

View File

@ -638,6 +638,14 @@ final class Byte128Vector extends ByteVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Byte128Mask eq(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte128Mask m = (Byte128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -670,6 +670,14 @@ final class Byte256Vector extends ByteVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Byte256Mask eq(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte256Mask m = (Byte256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -734,6 +734,14 @@ final class Byte512Vector extends ByteVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Byte512Mask eq(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte512Mask m = (Byte512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -622,6 +622,14 @@ final class Byte64Vector extends ByteVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Byte64Mask eq(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
Byte64Mask m = (Byte64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -608,6 +608,14 @@ final class ByteMaxVector extends ByteVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public ByteMaxMask eq(VectorMask<Byte> mask) {
Objects.requireNonNull(mask);
ByteMaxMask m = (ByteMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -606,6 +606,14 @@ final class Double128Vector extends DoubleVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Double128Mask eq(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double128Mask m = (Double128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -610,6 +610,14 @@ final class Double256Vector extends DoubleVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Double256Mask eq(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double256Mask m = (Double256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -618,6 +618,14 @@ final class Double512Vector extends DoubleVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Double512Mask eq(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double512Mask m = (Double512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -604,6 +604,14 @@ final class Double64Vector extends DoubleVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Double64Mask eq(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
Double64Mask m = (Double64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -603,6 +603,14 @@ final class DoubleMaxVector extends DoubleVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public DoubleMaxMask eq(VectorMask<Double> mask) {
Objects.requireNonNull(mask);
DoubleMaxMask m = (DoubleMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -610,6 +610,14 @@ final class Float128Vector extends FloatVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Float128Mask eq(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float128Mask m = (Float128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -618,6 +618,14 @@ final class Float256Vector extends FloatVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Float256Mask eq(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float256Mask m = (Float256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -634,6 +634,14 @@ final class Float512Vector extends FloatVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Float512Mask eq(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float512Mask m = (Float512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -606,6 +606,14 @@ final class Float64Vector extends FloatVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Float64Mask eq(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
Float64Mask m = (Float64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -603,6 +603,14 @@ final class FloatMaxVector extends FloatVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public FloatMaxMask eq(VectorMask<Float> mask) {
Objects.requireNonNull(mask);
FloatMaxMask m = (FloatMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -614,6 +614,14 @@ final class Int128Vector extends IntVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Int128Mask eq(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int128Mask m = (Int128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -622,6 +622,14 @@ final class Int256Vector extends IntVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Int256Mask eq(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int256Mask m = (Int256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -638,6 +638,14 @@ final class Int512Vector extends IntVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Int512Mask eq(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int512Mask m = (Int512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -610,6 +610,14 @@ final class Int64Vector extends IntVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Int64Mask eq(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
Int64Mask m = (Int64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -608,6 +608,14 @@ final class IntMaxVector extends IntVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public IntMaxMask eq(VectorMask<Integer> mask) {
Objects.requireNonNull(mask);
IntMaxMask m = (IntMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -600,6 +600,14 @@ final class Long128Vector extends LongVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Long128Mask eq(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long128Mask m = (Long128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -604,6 +604,14 @@ final class Long256Vector extends LongVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Long256Mask eq(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long256Mask m = (Long256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -612,6 +612,14 @@ final class Long512Vector extends LongVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Long512Mask eq(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long512Mask m = (Long512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -598,6 +598,14 @@ final class Long64Vector extends LongVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Long64Mask eq(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
Long64Mask m = (Long64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -598,6 +598,14 @@ final class LongMaxVector extends LongVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public LongMaxMask eq(VectorMask<Long> mask) {
Objects.requireNonNull(mask);
LongMaxMask m = (LongMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -622,6 +622,14 @@ final class Short128Vector extends ShortVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Short128Mask eq(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short128Mask m = (Short128Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -638,6 +638,14 @@ final class Short256Vector extends ShortVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Short256Mask eq(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short256Mask m = (Short256Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -670,6 +670,14 @@ final class Short512Vector extends ShortVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Short512Mask eq(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short512Mask m = (Short512Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -614,6 +614,14 @@ final class Short64Vector extends ShortVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public Short64Mask eq(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
Short64Mask m = (Short64Mask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -608,6 +608,14 @@ final class ShortMaxVector extends ShortVector {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public ShortMaxMask eq(VectorMask<Short> mask) {
Objects.requireNonNull(mask);
ShortMaxMask m = (ShortMaxMask)mask;
return xor(m.not());
}
// Unary operations
@Override

View File

@ -881,6 +881,14 @@ final class $vectortype$ extends $abstractvectortype$ {
return this.defaultMaskCast(species);
}
@Override
@ForceInline
public $masktype$ eq(VectorMask<$Boxtype$> mask) {
Objects.requireNonNull(mask);
$masktype$ m = ($masktype$)mask;
return xor(m.not());
}
// Unary operations
@Override