]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: rewrite upper-bit-clear idiom to use shift-rotate
authorDavid Chase <drchase@google.com>
Mon, 3 Apr 2017 15:50:54 +0000 (11:50 -0400)
committerDavid Chase <drchase@google.com>
Mon, 3 Apr 2017 17:16:23 +0000 (17:16 +0000)
commit9d5987d79f42b018ce8c57ac2d90ce0d81f0d646
tree264e23f93509d23940a528e137673a8f079d311c
parentd6b999436a5ad7f303c20c018867e1e118572fa0
cmd/compile: rewrite upper-bit-clear idiom to use shift-rotate

Old buggy hardware incorrectly executes the shift-left-K
then shift-right-K idiom for clearing K leftmost bits.
Use a right rotate instead of shift to avoid triggering the
bug.

Fixes #19809.

Change-Id: I6dc646b183c29e9d01aef944729f34388dcc687d
Reviewed-on: https://go-review.googlesource.com/39310
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/ssa/gen/ARM64.rules
src/cmd/compile/internal/ssa/rewriteARM64.go