diff options
| author | Jorropo <jorropo.pgm@gmail.com> | 2025-10-26 15:50:13 +0100 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-10-28 07:51:47 -0700 |
| commit | 2d33a456c678c388dc3ce7e2a5389aeeeb6ef184 (patch) | |
| tree | 14627ad954673a4e4e392caa22fbd40acdc7a0a1 /src/cmd/compile/internal | |
| parent | 2c91c33e88c68a5f6cc2f10296698faa305f6267 (diff) | |
| download | go-2d33a456c678c388dc3ce7e2a5389aeeeb6ef184.tar.xz | |
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>
Diffstat (limited to 'src/cmd/compile/internal')
| -rw-r--r-- | src/cmd/compile/internal/ssa/branchelim.go | 5 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssa/config.go | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go index a7d339cad0..7b0a7ae8ec 100644 --- a/src/cmd/compile/internal/ssa/branchelim.go +++ b/src/cmd/compile/internal/ssa/branchelim.go @@ -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 } diff --git a/src/cmd/compile/internal/ssa/config.go b/src/cmd/compile/internal/ssa/config.go index 7cc16ce26d..819d77e420 100644 --- a/src/cmd/compile/internal/ssa/config.go +++ b/src/cmd/compile/internal/ssa/config.go @@ -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) } |
