aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2021-07-16 02:36:52 +1000
committerJoel Sing <joel@sing.id.au>2021-08-21 08:58:07 +0000
commitdcee007aad6cca16cec0383a394dd7db92cd6790 (patch)
tree6eec18499f3ca2a0ef82b707b756cd44d7f39304 /src
parente17439e0877d6ddb6881d9eb59758c27cc62f930 (diff)
downloadgo-dcee007aad6cca16cec0383a394dd7db92cd6790.tar.gz
go-dcee007aad6cca16cec0383a394dd7db92cd6790.zip
cmd/compile: sort regalloc switch by architecture
Also tweak comment for the arm64 case. Change-Id: I073405bd2acf901dcaaf33a034a84b6a09dd4a83 Reviewed-on: https://go-review.googlesource.com/c/go/+/334869 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Meng Zhuo <mzh@golangcn.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/regalloc.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go
index 3d978e7ac8..28fac6ccd0 100644
--- a/src/cmd/compile/internal/ssa/regalloc.go
+++ b/src/cmd/compile/internal/ssa/regalloc.go
@@ -620,20 +620,20 @@ func (s *regAllocState) init(f *Func) {
}
if s.f.Config.ctxt.Flag_dynlink {
switch s.f.Config.arch {
- case "amd64":
- s.allocatable &^= 1 << 15 // R15
- case "arm":
- s.allocatable &^= 1 << 9 // R9
- case "ppc64le": // R2 already reserved.
- // nothing to do
- case "arm64":
- // nothing to do?
case "386":
// nothing to do.
// Note that for Flag_shared (position independent code)
// we do need to be careful, but that carefulness is hidden
// in the rewrite rules so we always have a free register
// available for global load/stores. See gen/386.rules (search for Flag_shared).
+ case "amd64":
+ s.allocatable &^= 1 << 15 // R15
+ case "arm":
+ s.allocatable &^= 1 << 9 // R9
+ case "arm64":
+ // nothing to do
+ case "ppc64le": // R2 already reserved.
+ // nothing to do
case "s390x":
s.allocatable &^= 1 << 11 // R11
default: