Skip to content

Commit 81afd3a

Browse files
Jorropogopherbot
authored andcommitted
cmd/compile: extend ppc64 MADDLD to match const ADDconst & MULLDconst
Fixes #76084 I was focused on restoring the old behavior and fixing the failing test/codegen/arithmetic.go:MergeMuls2 test. It is probable this same bug hides elsewhere in this file. Change-Id: I17f2ee6b97a1e33b8132648d9d750749d006f7e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/715560 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Paul Murphy <paumurph@redhat.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com>
1 parent ea50d61 commit 81afd3a

File tree

2 files changed

+79
-5
lines changed

2 files changed

+79
-5
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
(Max(32|64)F x y) && buildcfg.GOPPC64 >= 9 => (XSMAXJDP x y)
1919

2020
// Combine 64 bit integer multiply and adds
21-
(ADD l:(MULLD x y) z) && buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) => (MADDLD x y z)
21+
(ADD z l:(MULLD x y)) && buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) => (MADDLD x y z )
22+
(ADD z l:(MULLDconst <mt> [x] y)) && buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) => (MADDLD (MOVDconst <mt> [int64(x)]) y z )
23+
(ADDconst <at> [z] l:(MULLD x y)) && buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) => (MADDLD x y (MOVDconst <at> [int64(z)]))
24+
(ADDconst <at> [z] l:(MULLDconst <mt> [x] y)) && buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l) => (MADDLD (MOVDconst <mt> [int64(x)]) y (MOVDconst <at> [int64(z)]))
2225

2326
(Mod16 x y) => (Mod32 (SignExt16to32 x) (SignExt16to32 y))
2427
(Mod16u x y) => (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))

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

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

0 commit comments

Comments
 (0)