// 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
//
// 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
}
}
}
- // regabi is always enabled on amd64.
- if goarch == "amd64" {
+ if regabiAlwaysOn {
flags.RegabiWrappers = true
flags.RegabiArgs = true
}