[dev.simd] simd, cmd/compile: mark BLEND instructions as not-zero-mask

Change-Id: Ida9f29423d62a25be41dcf637ffb9275b7cae642
Reviewed-on: https://go-review.googlesource.com/c/go/+/697055
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
David Chase 2025-08-18 15:04:45 -04:00
parent 9a934d5080
commit 8ccd6c2034
3 changed files with 24 additions and 4 deletions

View file

@ -1654,10 +1654,6 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPXORQMasked128,
ssa.OpAMD64VPXORQMasked256,
ssa.OpAMD64VPXORQMasked512,
ssa.OpAMD64VPBLENDMBMasked512,
ssa.OpAMD64VPBLENDMWMasked512,
ssa.OpAMD64VPBLENDMDMasked512,
ssa.OpAMD64VPBLENDMQMasked512,
ssa.OpAMD64VPSLLWMasked128const,
ssa.OpAMD64VPSLLWMasked256const,
ssa.OpAMD64VPSLLWMasked512const,

View file

@ -253,6 +253,7 @@
# That means the signature is wrong.
- go: blend
asm: VPBLENDVB
zeroing: false
in:
- &v
go: $t
@ -269,6 +270,7 @@
# For AVX512
- go: blend
asm: VPBLENDM[BWDQ]
zeroing: false
in:
- &v
go: $t

View file

@ -397,6 +397,28 @@ func TestMergeFloat(t *testing.T) {
checkSlices[float64](t, s, []float64{4, 2, 3, 4})
}
func TestMergeFloat512(t *testing.T) {
if !simd.HasAVX512() {
t.Skip("Test requires HasAVX512, not available on this hardware")
return
}
a := simd.LoadFloat64x8Slice([]float64{1, 2, 3, 4, 5, 6, 7, 8})
b := simd.LoadFloat64x8Slice([]float64{8, 7, 6, 5, 4, 2, 3, 1})
g := a.Greater(b)
k := make([]int64, 8, 8)
g.AsInt64x8().StoreSlice(k)
checkSlices[int64](t, k, []int64{0, 0, 0, 0, -1, -1, -1, -1})
c := a.Merge(b, g)
d := a.Masked(g)
s := make([]float64, 8, 8)
c.StoreSlice(s)
checkSlices[float64](t, s, []float64{8, 7, 6, 5, 5, 6, 7, 8})
d.StoreSlice(s)
checkSlices[float64](t, s, []float64{0, 0, 0, 0, 5, 6, 7, 8})
}
var ro uint8 = 2
func TestRotateAllVariable(t *testing.T) {