[dev.simd] simd: add emulations for bitwise ops and for mask/merge methods

This CL adds the emulations under a "wrong name"; subsequent CLs
will move the AVX512 versions of these operations out of the way,
and then will rename these to their better names.

Change-Id: I49e7a73e4fea74fb7bd26cb8062014568d7999ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/692217
Reviewed-by: Junyang Shao <shaojunyang@google.com>
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-07-30 17:42:10 -04:00
parent 8eb5f6020e
commit 94d72355f6
3 changed files with 488 additions and 16 deletions

View file

@ -382,3 +382,17 @@ func TestBitMaskToBits(t *testing.T) {
t.Errorf("Want 0b101, got %b", v)
}
}
func TestMergeFloat(t *testing.T) {
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[float64](t, s, []float64{4, 2, 3, 4})
}