Skip to content

Commit

Permalink
8267969: Add vectorized implementation for VectorMask.eq()
Browse files Browse the repository at this point in the history
Reviewed-by: psandoz, neliasso
  • Loading branch information
Xiaohong Gong authored and Nils Eliasson committed Jun 2, 2021
1 parent 1cea6ca commit 496fb90
Show file tree
Hide file tree
Showing 32 changed files with 248 additions and 6 deletions.
Expand Up @@ -114,12 +114,6 @@ <F> VectorMask<F> check(VectorSpecies<F> species) {
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());
Expand Down
Expand Up @@ -638,6 +638,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -670,6 +670,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -734,6 +734,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -622,6 +622,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -608,6 +608,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -606,6 +606,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -610,6 +610,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -618,6 +618,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -604,6 +604,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -603,6 +603,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -610,6 +610,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -618,6 +618,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -634,6 +634,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -606,6 +606,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -603,6 +603,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -614,6 +614,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -622,6 +622,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -638,6 +638,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -610,6 +610,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -608,6 +608,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -600,6 +600,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -604,6 +604,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -612,6 +612,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -598,6 +598,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down
Expand Up @@ -598,6 +598,14 @@ public <E> VectorMask<E> cast(VectorSpecies<E> dsp) {
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
Expand Down

1 comment on commit 496fb90

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.