[dev.simd] cmd/compile, simd: add value conversion ToBits for mask

This CL is generated by CL 693598.

Change-Id: I949d3b3b4e5670cb30f0fb9dc779f7359409b54c
Reviewed-on: https://go-review.googlesource.com/c/go/+/693755
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Junyang Shao 2025-08-06 19:03:52 +00:00
parent 5b0ef7fcdc
commit b226bcc4a9
10 changed files with 630 additions and 113 deletions

View file

@ -391,3 +391,13 @@ func TestBitMaskFromBits(t *testing.T) {
}
}
}
func TestBitMaskToBits(t *testing.T) {
if !simd.HasAVX512() {
t.Skip("Test requires HasAVX512, not available on this hardware")
return
}
if v := simd.LoadInt16x8Slice([]int16{-1, 0, -1, 0, 0, 0, 0, 0}).AsMask16x8().ToBits(); v != 0b101 {
t.Errorf("Want 0b101, got %b", v)
}
}