]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: enable rewritings that are blocked by old backends
authorCherry Zhang <cherryyz@google.com>
Fri, 16 Sep 2016 13:27:06 +0000 (09:27 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 16 Sep 2016 14:53:12 +0000 (14:53 +0000)
Old backends did not implement them, but SSA do.

Change-Id: I543b2281dcf4bab0da37c9b1f26a5ef55a0ea11b
Reviewed-on: https://go-review.googlesource.com/29278
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/ppc64/prog.go

index 8fa335a300e1f54fddc0c516f882b22b31cda346..5d5022fea74eee0eee834389d0495cdca04b6b10 100644 (file)
@@ -3387,8 +3387,7 @@ func samecheap(a *Node, b *Node) bool {
 // The result of walkrotate MUST be assigned back to n, e.g.
 //     n.Left = walkrotate(n.Left)
 func walkrotate(n *Node) *Node {
-       //TODO: enable LROT on ARM64 once the old backend is gone
-       if Thearch.LinkArch.InFamily(sys.MIPS64, sys.ARM64, sys.PPC64) {
+       if Thearch.LinkArch.InFamily(sys.MIPS64, sys.PPC64) {
                return n
        }
 
@@ -3647,11 +3646,6 @@ ret:
 func walkdiv(n *Node, init *Nodes) *Node {
        // if >= 0, nr is 1<<pow // 1 if nr is negative.
 
-       // TODO(minux)
-       if Thearch.LinkArch.InFamily(sys.MIPS64, sys.PPC64) {
-               return n
-       }
-
        if n.Right.Op != OLITERAL {
                return n
        }
index 455db9af6cbd1b116202504d3444b7db1bdab10e..cc83f0d208d4b92002ce9f7f4fb810660bc0d6ed 100644 (file)
@@ -54,8 +54,10 @@ var progtable = [ppc64.ALAST & obj.AMask]obj.ProgInfo{
        ppc64.AEQV & obj.AMask:    {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
        ppc64.AMULLD & obj.AMask:  {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
        ppc64.AMULLW & obj.AMask:  {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
-       ppc64.AMULHD & obj.AMask:  {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
-       ppc64.AMULHDU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
+       ppc64.AMULHD & obj.AMask:  {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
+       ppc64.AMULHDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
+       ppc64.AMULHW & obj.AMask:  {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
+       ppc64.AMULHWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},
        ppc64.ADIVD & obj.AMask:   {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
        ppc64.ADIVDU & obj.AMask:  {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite},
        ppc64.ADIVW & obj.AMask:   {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite},