diff options
| author | Wayne Zuo <wdvxdr@golangcn.org> | 2022-04-09 14:40:40 +0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2022-04-13 17:48:36 +0000 |
| commit | 66f03f79dadc6005d30a6edf4419b8f6c0fa6398 (patch) | |
| tree | 6c387047a15b43ee0c978610bb08c5206bae037f /test/codegen | |
| parent | 517781b39181e26cff880b656787fac65a63092c (diff) | |
| download | go-66f03f79dadc6005d30a6edf4419b8f6c0fa6398.tar.xz | |
cmd/compile: add SHLX&SHRX without load
Change-Id: I79eb5e7d6bcb23f26d3a100e915efff6dae70391
Reviewed-on: https://go-review.googlesource.com/c/go/+/399061
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/bmi.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/codegen/bmi.go b/test/codegen/bmi.go index 1641d5ddd0..3b125a1b59 100644 --- a/test/codegen/bmi.go +++ b/test/codegen/bmi.go @@ -72,7 +72,23 @@ func sarx32_load(x []int32, i int) int32 { return s } -func shlrx64(x []uint64, i int, s uint64) uint64 { +func shlrx64(x, y uint64) uint64 { + // amd64/v3:"SHRXQ" + s := x >> y + // amd64/v3:"SHLXQ" + s = s << y + return s +} + +func shlrx32(x, y uint32) uint32 { + // amd64/v3:"SHRXL" + s := x >> y + // amd64/v3:"SHLXL" + s = s << y + return s +} + +func shlrx64_load(x []uint64, i int, s uint64) uint64 { // amd64/v3: `SHRXQ\t[A-Z]+[0-9]*, \([A-Z]+[0-9]*\)\([A-Z]+[0-9]*\*8\), [A-Z]+[0-9]*` s = x[i] >> i // amd64/v3: `SHLXQ\t[A-Z]+[0-9]*, 8\([A-Z]+[0-9]*\)\([A-Z]+[0-9]*\*8\), [A-Z]+[0-9]*` @@ -80,7 +96,7 @@ func shlrx64(x []uint64, i int, s uint64) uint64 { return s } -func shlrx32(x []uint32, i int, s uint32) uint32 { +func shlrx32_load(x []uint32, i int, s uint32) uint32 { // amd64/v3: `SHRXL\t[A-Z]+[0-9]*, \([A-Z]+[0-9]*\)\([A-Z]+[0-9]*\*4\), [A-Z]+[0-9]*` s = x[i] >> i // amd64/v3: `SHLXL\t[A-Z]+[0-9]*, 4\([A-Z]+[0-9]*\)\([A-Z]+[0-9]*\*4\), [A-Z]+[0-9]*` |
