diff options
| author | ruinan <ruinan.sun@arm.com> | 2022-08-08 04:17:19 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-09-02 17:44:29 +0000 |
| commit | 54c7bc9cff748e6554e53fbbbf823fdd214d0482 (patch) | |
| tree | 8520677a7dc976ac69c6c28b213f57c831be27d5 /test/codegen/mathbits.go | |
| parent | 5befb24bb5cbd8ae6210b4d6a88a4437eec6fb0b (diff) | |
| download | go-54c7bc9cff748e6554e53fbbbf823fdd214d0482.tar.xz | |
cmd/compile: optimize shift ops on arm64 when the shift value is v&63
For the following code case:
var x uint64
x >> (shift & 63)
We can directly genereta `x >> shift` on arm64, since the hardware will
only use the bottom 6 bits of the shift amount.
Benchmark old time/op new time/op delta
ShiftArithmeticRight-8 0.40ns 0.31ns -21.7%
Change-Id: Id58c8a5b2f6dd5c30c3876f4a36e11b4d81e2dc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/425294
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'test/codegen/mathbits.go')
0 files changed, 0 insertions, 0 deletions
