Skip to content

Commit 9341046

Browse files
jkrishmyslaboger
authored andcommitted
cmd/compile: adding rule to eliminate ANDCCconst
For example, the Slicemask rule in PPC64 generates a sequence wherein there is andi operation, after an sradi, which can be replaced by srdi. This new rule eliminates ANDCCconst. Change-Id: I27aaadf76b9c749a60bcdc5e87b1ebb8167d2fd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/539055 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
1 parent f8c5d04 commit 9341046

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/cmd/compile/internal/ssa/_gen/PPC64.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@
800800
(AtomicOr(8|32) ...) => (LoweredAtomicOr(8|32) ...)
801801

802802
(Slicemask <t> x) => (SRADconst (NEG <t> x) [63])
803+
(Select0 (ANDCCconst [1] z:(SRADconst [63] x))) && z.Uses == 1 => (SRDconst [63] x)
803804

804805
// Note that MOV??reg returns a 64-bit int, x is not necessarily that wide
805806
// This may interact with other patterns in the future. (Compare with arm64)

src/cmd/compile/internal/ssa/rewritePPC64.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)