]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove ginscon2 functions
authorMatthew Dempsky <mdempsky@google.com>
Wed, 14 Sep 2016 23:49:44 +0000 (16:49 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 15 Sep 2016 06:47:35 +0000 (06:47 +0000)
These are no longer reachable as gins dispatches to ginscon for all
arch-specific instructions anyway.

Change-Id: I7f34883c16058308d8afa0f960dcf554af31bfe4
Reviewed-on: https://go-review.googlesource.com/29211
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/arm64/gsubr.go
src/cmd/compile/internal/ppc64/gsubr.go
src/cmd/compile/internal/s390x/gsubr.go

index 9e73959923332bf8f6951adf273ab71046ea8594..564c5aeabdba37e1695859f256f1013f5858779a 100644 (file)
@@ -69,35 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
        rawgins(as, &n1, n2)
 }
 
-/*
- * generate
- *     as n, $c (CMP)
- */
-func ginscon2(as obj.As, n2 *gc.Node, c int64) {
-       var n1 gc.Node
-
-       gc.Nodconst(&n1, gc.Types[gc.TINT64], c)
-
-       switch as {
-       default:
-               gc.Fatalf("ginscon2")
-
-       case arm64.ACMP:
-               if -arm64.BIG <= c && c <= arm64.BIG {
-                       gcmp(as, n2, &n1)
-                       return
-               }
-       }
-
-       // MOV n1 into register first
-       var ntmp gc.Node
-       gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil)
-
-       rawgins(arm64.AMOVD, &n1, &ntmp)
-       gcmp(as, n2, &ntmp)
-       gc.Regfree(&ntmp)
-}
-
 // gins is called by the front end.
 // It synthesizes some multiple-instruction sequences
 // so the front end can stay simpler.
@@ -108,12 +79,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
                        return nil // caller must not use
                }
        }
-       if as == arm64.ACMP {
-               if x, ok := t.IntLiteral(); ok {
-                       ginscon2(as, f, x)
-                       return nil // caller must not use
-               }
-       }
        return rawgins(as, f, t)
 }
 
index 3fa151feed66113b5b9c62edb01c962dbdf80f24..ab9c16ced8e3fc4bd0a347d3571e32b1d975f4a3 100644 (file)
@@ -76,41 +76,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
        rawgins(as, &n1, n2)
 }
 
-/*
- * generate
- *     as n, $c (CMP/CMPU)
- */
-func ginscon2(as obj.As, n2 *gc.Node, c int64) {
-       var n1 gc.Node
-
-       gc.Nodconst(&n1, gc.Types[gc.TINT64], c)
-
-       switch as {
-       default:
-               gc.Fatalf("ginscon2")
-
-       case ppc64.ACMP:
-               if -ppc64.BIG <= c && c <= ppc64.BIG {
-                       rawgins(as, n2, &n1)
-                       return
-               }
-
-       case ppc64.ACMPU:
-               if 0 <= c && c <= 2*ppc64.BIG {
-                       rawgins(as, n2, &n1)
-                       return
-               }
-       }
-
-       // MOV n1 into register first
-       var ntmp gc.Node
-       gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil)
-
-       rawgins(ppc64.AMOVD, &n1, &ntmp)
-       rawgins(as, n2, &ntmp)
-       gc.Regfree(&ntmp)
-}
-
 // gins is called by the front end.
 // It synthesizes some multiple-instruction sequences
 // so the front end can stay simpler.
@@ -121,12 +86,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
                        return nil // caller must not use
                }
        }
-       if as == ppc64.ACMP || as == ppc64.ACMPU {
-               if x, ok := t.IntLiteral(); ok {
-                       ginscon2(as, f, x)
-                       return nil // caller must not use
-               }
-       }
        return rawgins(as, f, t)
 }
 
index b8925ff40d0965888ed79d2918c6ff27ab26e67f..c6ab09fad4b8e2843c9a279afaf298ab93b9d905 100644 (file)
@@ -69,39 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
        rawgins(as, &n1, n2)
 }
 
-// generate
-//     as n, $c (CMP/CMPU)
-func ginscon2(as obj.As, n2 *gc.Node, c int64) {
-       var n1 gc.Node
-
-       gc.Nodconst(&n1, gc.Types[gc.TINT64], c)
-
-       switch as {
-       default:
-               gc.Fatalf("ginscon2")
-
-       case s390x.ACMP:
-               if -s390x.BIG <= c && c <= s390x.BIG {
-                       rawgins(as, n2, &n1)
-                       return
-               }
-
-       case s390x.ACMPU:
-               if 0 <= c && c <= 2*s390x.BIG {
-                       rawgins(as, n2, &n1)
-                       return
-               }
-       }
-
-       // MOV n1 into register first
-       var ntmp gc.Node
-       gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil)
-
-       rawgins(s390x.AMOVD, &n1, &ntmp)
-       rawgins(as, n2, &ntmp)
-       gc.Regfree(&ntmp)
-}
-
 // gmvc tries to move f to t using a mvc instruction.
 // If successful it returns true, otherwise it returns false.
 func gmvc(f, t *gc.Node) bool {
@@ -172,12 +139,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
                                return nil // caller must not use
                        }
                }
-               if as == s390x.ACMP || as == s390x.ACMPU {
-                       if x, ok := intLiteral(t); ok {
-                               ginscon2(as, f, x)
-                               return nil // caller must not use
-                       }
-               }
        }
        return rawgins(as, f, t)
 }