Skip to content

Commit

Permalink
[Backport] 8267969: Add vectorized implementation for VectorMask.eq()
Browse files Browse the repository at this point in the history
Summary: [Backport] 8267969: Add vectorized implementation for VectorMask.eq()

Test Plan: ci jtreg

Reviewed-by: JoshuaZhuwj

Issue: dragonwell-project#587
  • Loading branch information
JinZhonghui committed Nov 7, 2023
1 parent 4ffa632 commit 9299f2a
Show file tree
Hide file tree
Showing 32 changed files with 248 additions and 6 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,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
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,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
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,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
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,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
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,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
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,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
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,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
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,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
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,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
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,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
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,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
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,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
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,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
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,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
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,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
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,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
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,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
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,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
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,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
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,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
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,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
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,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
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,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
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,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
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,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
Loading

0 comments on commit 9299f2a

Please sign in to comment.