cmd/compile: remove duplicate ppc64 rules

Const64 gets lowered to MOVDconst.
Change rules using interior Const64 to use MOVDconst instead,
to be less dependent on rule application order.

As a result of doing this, some of the rules end up being
exact duplicates; remove those.

We had those exact duplicates because of the order dependency;
ppc64 had no way to optimize away shifts by a constant
if the initial lowering didn't catch it.

Add those optimizations as well.
The outcome is the same, but this makes the overall rules more robust.

Change-Id: Iadd97a9fe73d52358d571d022ace145e506d160b
Reviewed-on: https://go-review.googlesource.com/c/go/+/220877
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
This commit is contained in:
Josh Bleecher Snyder 2020-02-06 10:36:29 -08:00
parent 63f1bc5992
commit 37fc092be1
5 changed files with 303 additions and 496 deletions

View file

@ -1881,6 +1881,8 @@ const (
OpPPC64FlagEQ
OpPPC64FlagLT
OpPPC64FlagGT
OpPPC64FlagCarrySet
OpPPC64FlagCarryClear
OpRISCV64ADD
OpRISCV64ADDI
@ -24995,6 +24997,16 @@ var opcodeTable = [...]opInfo{
argLen: 0,
reg: regInfo{},
},
{
name: "FlagCarrySet",
argLen: 0,
reg: regInfo{},
},
{
name: "FlagCarryClear",
argLen: 0,
reg: regInfo{},
},
{
name: "ADD",