]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] simd, cmd/compile: mark BLEND instructions as not-zero-mask
authorDavid Chase <drchase@google.com>
Mon, 18 Aug 2025 19:04:45 +0000 (15:04 -0400)
committerDavid Chase <drchase@google.com>
Mon, 18 Aug 2025 20:12:38 +0000 (13:12 -0700)
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>

src/cmd/compile/internal/amd64/simdssa.go
src/simd/_gen/simdgen/ops/Moves/go.yaml
src/simd/simd_test.go

index 466e6c9cc74ff0b35088f4076326496c726e4b7d..1ab4c88cba78704c5d5e969ae7c9b9ac6f03ee27 100644 (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,
index 0e5997deebbc354bd1034495384654051edf59f4..d4d1b4b9bd34454ff4473f65a233abf926afd423 100644 (file)
 # That means the signature is wrong.
 - go: blend
   asm: VPBLENDVB
+  zeroing: false
   in:
   - &v
     go: $t
 # For AVX512
 - go: blend
   asm: VPBLENDM[BWDQ]
+  zeroing: false
   in:
   - &v
     go: $t
index 831dc4f268bdfbe3b5b75943efac69ce9997b6ce..ce982409ea9fba8dd3495d4597dd14be708da358 100644 (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) {