]> Cypherpunks repositories - gostls13.git/commitdiff
internal/abi, internal/buildcfg: always enable register ABI on ARM64
authorCherry Mui <cherryyz@google.com>
Wed, 2 Mar 2022 16:59:48 +0000 (11:59 -0500)
committerCherry Mui <cherryyz@google.com>
Fri, 18 Mar 2022 16:39:28 +0000 (16:39 +0000)
In last cycle we developed register ABI for ARM64, enabled by
default as a GOEXPERIMENT. This cycle we turn it on all the time.
Later CLs will clean up fallback code.

To support in-development platforms (e.g. RISC-V), separate the
boolean variables for in-development platforms and always-on
platforms.

Change-Id: I97c27f6aeccc85ccc57eed2abd783b176da3ad80
Reviewed-on: https://go-review.googlesource.com/c/go/+/393364
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/internal/abi/abi_arm64.go
src/internal/abi/abi_generic.go
src/internal/buildcfg/exp.go

index 8f85901c478ca13290a06207002c48ababa7bad3..4dc51431bfb80da987a2550a4f1d221e61e4571e 100644 (file)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build goexperiment.regabiargs
-
 package abi
 
 const (
index d7d2f3749bc30b79063ce56fd4c538c2fa846a4f..bc8483b4f93ee580059ef3199d8f2979653e98fb 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !goexperiment.regabiargs && !amd64
+//go:build !goexperiment.regabiargs && !amd64 && !arm64
 
 package abi
 
index a56b36efdf52e1075d64064f0256a11068f4e321..b2bf9b2c832a8c85fbae11c420242764aacb8665 100644 (file)
@@ -56,9 +56,16 @@ var FramePointerEnabled = GOARCH == "amd64" || GOARCH == "arm64"
 //
 // TODO(mdempsky): Move to internal/goexperiment.
 func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
-       regabiSupported := false
+       // regabiSupported is set to true on platforms where register ABI is
+       // supported and enabled by default.
+       // regabiAlwaysOn is set to true on platforms where register ABI is
+       // always on.
+       var regabiSupported, regabiAlwaysOn bool
        switch goarch {
-       case "amd64", "arm64", "ppc64le", "ppc64":
+       case "amd64", "arm64":
+               regabiAlwaysOn = true
+               fallthrough
+       case "ppc64le", "ppc64":
                regabiSupported = true
        }
 
@@ -120,8 +127,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
                }
        }
 
-       // regabi is always enabled on amd64.
-       if goarch == "amd64" {
+       if regabiAlwaysOn {
                flags.RegabiWrappers = true
                flags.RegabiArgs = true
        }