Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Keith Randall <[email protected]> Run-TryBot: Keith Randall <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
- Loading branch information