aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/location.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-07-13 16:15:54 -0700
committerKeith Randall <khr@golang.org>2016-07-18 16:11:36 +0000
commit25e0a367da6254d89b497f392ea9d1679455d000 (patch)
tree65d17174fd2ebfed7180ee993529857d318dba89 /src/cmd/compile/internal/ssa/location.go
parent6b6de15d327142a19c978c8b9811310b174fd60b (diff)
downloadgo-25e0a367da6254d89b497f392ea9d1679455d000.tar.gz
go-25e0a367da6254d89b497f392ea9d1679455d000.zip
[dev.ssa] cmd/compile: clean up tuple types and selects
Make tuple types and their SelectX ops fully generic. These ops no longer need to be lowered. Regalloc understands them and their tuple-generating arguments. We can now have opcodes returning arbitrary pairs of results. (And it would be easy to move to >2 results if needed.) Update arm implementation to the new standard. Implement just enough in 386 port to do 64-bit add. Change-Id: I370ed5aacce219c82e1954c61d1f63af76c16f79 Reviewed-on: https://go-review.googlesource.com/24976 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/location.go')
-rw-r--r--src/cmd/compile/internal/ssa/location.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/location.go b/src/cmd/compile/internal/ssa/location.go
index 85f525565b..fc3a19ca35 100644
--- a/src/cmd/compile/internal/ssa/location.go
+++ b/src/cmd/compile/internal/ssa/location.go
@@ -36,3 +36,16 @@ func (s LocalSlot) Name() string {
}
return fmt.Sprintf("%s+%d[%s]", s.N, s.Off, s.Type)
}
+
+type LocPair [2]Location
+
+func (t LocPair) Name() string {
+ n0, n1 := "nil", "nil"
+ if t[0] != nil {
+ n0 = t[0].Name()
+ }
+ if t[1] != nil {
+ n1 = t[1].Name()
+ }
+ return fmt.Sprintf("<%s,%s>", n0, n1)
+}