Commit f03855f4 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: remove ginscon2 functions

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/29211Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 82703f84
...@@ -69,35 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) { ...@@ -69,35 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
rawgins(as, &n1, n2) 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. // gins is called by the front end.
// It synthesizes some multiple-instruction sequences // It synthesizes some multiple-instruction sequences
// so the front end can stay simpler. // so the front end can stay simpler.
...@@ -108,12 +79,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog { ...@@ -108,12 +79,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
return nil // caller must not use 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) return rawgins(as, f, t)
} }
......
...@@ -76,41 +76,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) { ...@@ -76,41 +76,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
rawgins(as, &n1, n2) 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. // gins is called by the front end.
// It synthesizes some multiple-instruction sequences // It synthesizes some multiple-instruction sequences
// so the front end can stay simpler. // so the front end can stay simpler.
...@@ -121,12 +86,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog { ...@@ -121,12 +86,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
return nil // caller must not use 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) return rawgins(as, f, t)
} }
......
...@@ -69,39 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) { ...@@ -69,39 +69,6 @@ func ginscon(as obj.As, c int64, n2 *gc.Node) {
rawgins(as, &n1, n2) 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. // gmvc tries to move f to t using a mvc instruction.
// If successful it returns true, otherwise it returns false. // If successful it returns true, otherwise it returns false.
func gmvc(f, t *gc.Node) bool { func gmvc(f, t *gc.Node) bool {
...@@ -172,12 +139,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog { ...@@ -172,12 +139,6 @@ func gins(as obj.As, f, t *gc.Node) *obj.Prog {
return nil // caller must not use 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) return rawgins(as, f, t)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment