mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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:
parent
4fce49b86c
commit
728ac3e050
1 changed files with 11 additions and 6 deletions
|
|
@ -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})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue