]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.simd] simd: tweaks to improve test disassembly
authorDavid Chase <drchase@google.com>
Sun, 17 Aug 2025 14:46:39 +0000 (10:46 -0400)
committerDavid Chase <drchase@google.com>
Wed, 20 Aug 2025 19:42:19 +0000 (12:42 -0700)
Change-Id: Ic50dd82c05a398d947a38bf20bc8dd22c2f8b935
Reviewed-on: https://go-review.googlesource.com/c/go/+/697156
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/simd/simd_test.go

index c88fe4b9fef58e6ffc42d42e833bdd1d8be47d7b..8f6142203e41a1e9334009b8aea7138806945d3c 100644 (file)
@@ -378,16 +378,18 @@ func TestBitMaskToBits(t *testing.T) {
 }
 
 func TestMergeFloat(t *testing.T) {
+       k := make([]int64, 4, 4)
+       s := make([]float64, 4, 4)
+
        a := simd.LoadFloat64x4Slice([]float64{1, 2, 3, 4})
        b := simd.LoadFloat64x4Slice([]float64{4, 2, 3, 1})
        g := a.Greater(b)
-       k := make([]int64, 4, 4)
        g.AsInt64x4().StoreSlice(k)
-       checkSlices[int64](t, k, []int64{0, 0, 0, -1})
        c := a.Merge(b, g)
 
-       s := make([]float64, 4, 4)
        c.StoreSlice(s)
+
+       checkSlices[int64](t, k, []int64{0, 0, 0, -1})
        checkSlices[float64](t, s, []float64{4, 2, 3, 4})
 }
 
@@ -396,16 +398,19 @@ func TestMergeFloat512(t *testing.T) {
                t.Skip("Test requires HasAVX512, not available on this hardware")
                return
        }
+
+       k := make([]int64, 8, 8)
+       s := make([]float64, 8, 8)
+
        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)
+       checkSlices[int64](t, k, []int64{0, 0, 0, 0, -1, -1, -1, -1})
+
        c.StoreSlice(s)
        checkSlices[float64](t, s, []float64{8, 7, 6, 5, 5, 6, 7, 8})