Skip to content

Commit 882dd1c

Browse files
committed
cmd/compile: enable rewritings that are blocked by old backends
Old backends did not implement them, but SSA do. Change-Id: I543b2281dcf4bab0da37c9b1f26a5ef55a0ea11b Reviewed-on: https://go-review.googlesource.com/29278 Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 8607bed commit 882dd1c

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/cmd/compile/internal/gc/walk.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,8 +3387,7 @@ func samecheap(a *Node, b *Node) bool {
33873387
// The result of walkrotate MUST be assigned back to n, e.g.
33883388
// n.Left = walkrotate(n.Left)
33893389
func walkrotate(n *Node) *Node {
3390-
//TODO: enable LROT on ARM64 once the old backend is gone
3391-
if Thearch.LinkArch.InFamily(sys.MIPS64, sys.ARM64, sys.PPC64) {
3390+
if Thearch.LinkArch.InFamily(sys.MIPS64, sys.PPC64) {
33923391
return n
33933392
}
33943393

@@ -3647,11 +3646,6 @@ ret:
36473646
func walkdiv(n *Node, init *Nodes) *Node {
36483647
// if >= 0, nr is 1<<pow // 1 if nr is negative.
36493648

3650-
// TODO(minux)
3651-
if Thearch.LinkArch.InFamily(sys.MIPS64, sys.PPC64) {
3652-
return n
3653-
}
3654-
36553649
if n.Right.Op != OLITERAL {
36563650
return n
36573651
}

src/cmd/compile/internal/ppc64/prog.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ var progtable = [ppc64.ALAST & obj.AMask]obj.ProgInfo{
5454
ppc64.AEQV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
5555
ppc64.AMULLD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
5656
ppc64.AMULLW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
57-
ppc64.AMULHD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
58-
ppc64.AMULHDU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
57+
ppc64.AMULHD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
58+
ppc64.AMULHDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
59+
ppc64.AMULHW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
60+
ppc64.AMULHWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
5961
ppc64.ADIVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
6062
ppc64.ADIVDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
6163
ppc64.ADIVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},

0 commit comments

Comments
 (0)