[dev.simd] simd: tweaks to improve test disassembly

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>
This commit is contained in:
David Chase 2025-08-17 10:46:39 -04:00
parent 4fce49b86c
commit 728ac3e050

View file

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