aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/flagalloc.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2016-05-13 11:25:07 -0400
committerCherry Zhang <cherryyz@google.com>2016-05-19 02:48:36 +0000
commitccaed50c7bf6381275d49adcf54974441752fd11 (patch)
treed7ebf8d2a3fc624d31934e79dd5759cb5b3dc54a /src/cmd/compile/internal/ssa/flagalloc.go
parente2848de9efc599e1af54079ab1f8e79e0e26764c (diff)
downloadgo-ccaed50c7bf6381275d49adcf54974441752fd11.tar.gz
go-ccaed50c7bf6381275d49adcf54974441752fd11.zip
[dev.ssa] cmd/compile: handle boolean values for SSA on ARM
Fix hardcoded flag register mask in ssa/flagalloc.go by auto-generating the mask. Also fix a mistake (in previous CL) about conditional branches. Progress on SSA backend for ARM. Still not complete. Now "container/ring" package compiles and tests passed. Updates #15365. Change-Id: Id7c8805c30dbb8107baedb485ed0f71f59ed6ea8 Reviewed-on: https://go-review.googlesource.com/23093 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/flagalloc.go')
-rw-r--r--src/cmd/compile/internal/ssa/flagalloc.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/flagalloc.go b/src/cmd/compile/internal/ssa/flagalloc.go
index f6c457dc9e..c6dc8d7f91 100644
--- a/src/cmd/compile/internal/ssa/flagalloc.go
+++ b/src/cmd/compile/internal/ssa/flagalloc.go
@@ -4,8 +4,6 @@
package ssa
-const flagRegMask = regMask(1) << 33 // TODO: arch-specific
-
// flagalloc allocates the flag register among all the flag-generating
// instructions. Flag values are recomputed if they need to be
// spilled/restored.
@@ -33,7 +31,7 @@ func flagalloc(f *Func) {
if v == flag {
flag = nil
}
- if opcodeTable[v.Op].reg.clobbers&flagRegMask != 0 {
+ if opcodeTable[v.Op].reg.clobbers&f.Config.flagRegMask != 0 {
flag = nil
}
for _, a := range v.Args {
@@ -105,7 +103,7 @@ func flagalloc(f *Func) {
}
// Issue v.
b.Values = append(b.Values, v)
- if opcodeTable[v.Op].reg.clobbers&flagRegMask != 0 {
+ if opcodeTable[v.Op].reg.clobbers&f.Config.flagRegMask != 0 {
flag = nil
}
if v.Type.IsFlags() {