mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: move branchelim supported arches to Config
Change-Id: I8d10399ba71e5fa97ead06a717fc972c806c0856 Reviewed-on: https://go-review.googlesource.com/c/go/+/715042 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
2c91c33e88
commit
2d33a456c6
2 changed files with 7 additions and 4 deletions
|
|
@ -21,10 +21,7 @@ import "cmd/internal/src"
|
|||
// rewrite Phis in the postdominator as CondSelects.
|
||||
func branchelim(f *Func) {
|
||||
// FIXME: add support for lowering CondSelects on more architectures
|
||||
switch f.Config.arch {
|
||||
case "arm64", "ppc64le", "ppc64", "amd64", "wasm", "loong64":
|
||||
// implemented
|
||||
default:
|
||||
if !f.Config.haveCondSelect {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ type Config struct {
|
|||
haveBswap64 bool // architecture implements Bswap64
|
||||
haveBswap32 bool // architecture implements Bswap32
|
||||
haveBswap16 bool // architecture implements Bswap16
|
||||
haveCondSelect bool // architecture implements CondSelect
|
||||
|
||||
// mulRecipes[x] = function to build v * x from v.
|
||||
mulRecipes map[int64]mulRecipe
|
||||
|
|
@ -191,6 +192,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
|
|||
c.haveBswap64 = true
|
||||
c.haveBswap32 = true
|
||||
c.haveBswap16 = true
|
||||
c.haveCondSelect = true
|
||||
case "386":
|
||||
c.PtrSize = 4
|
||||
c.RegSize = 4
|
||||
|
|
@ -236,6 +238,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
|
|||
c.haveBswap64 = true
|
||||
c.haveBswap32 = true
|
||||
c.haveBswap16 = true
|
||||
c.haveCondSelect = true
|
||||
case "ppc64":
|
||||
c.BigEndian = true
|
||||
fallthrough
|
||||
|
|
@ -263,6 +266,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
|
|||
c.haveBswap64 = true
|
||||
c.haveBswap32 = true
|
||||
c.haveBswap16 = true
|
||||
c.haveCondSelect = true
|
||||
case "mips64":
|
||||
c.BigEndian = true
|
||||
fallthrough
|
||||
|
|
@ -296,6 +300,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
|
|||
c.LinkReg = linkRegLOONG64
|
||||
c.hasGReg = true
|
||||
c.unalignedOK = true
|
||||
c.haveCondSelect = true
|
||||
case "s390x":
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
|
|
@ -357,6 +362,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
|
|||
c.useAvg = false
|
||||
c.useHmul = false
|
||||
c.unalignedOK = true
|
||||
c.haveCondSelect = true
|
||||
default:
|
||||
ctxt.Diag("arch %s not implemented", arch)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue