]> Cypherpunks repositories - gostls13.git/commitdiff
internal/abi: define PPC64 register ABI constants
authorLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 17 Aug 2021 18:38:41 +0000 (13:38 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 21 Sep 2021 12:51:45 +0000 (12:51 +0000)
Add the PPC64 register ABI constants, and allow
GOEXPERIMENT regabi values to be set for PPC64.

Change-Id: I1c9562ae6669c604db69a7b8ad935d1bc117c899
Reviewed-on: https://go-review.googlesource.com/c/go/+/343870
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>

src/internal/abi/abi_ppc64x.go [new file with mode: 0644]
src/internal/buildcfg/exp.go

diff --git a/src/internal/abi/abi_ppc64x.go b/src/internal/abi/abi_ppc64x.go
new file mode 100644 (file)
index 0000000..e386532
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build goexperiment.regabireflect && (ppc64 || ppc64le)
+// +build goexperiment.regabireflect
+// +build ppc64 ppc64le
+
+package abi
+
+const (
+       // See abi_generic.go.
+
+       // R3 - R10, R14 - R17.
+       IntArgRegs = 12
+
+       // F1 - F12.
+       FloatArgRegs = 12
+
+       EffectiveFloatRegSize = 8
+)
index 3844e4f021193cdff6cf9f373c863e5ff6bd11c5..7cbe4c804d0bff04cddb0c90650665858c2ec633 100644 (file)
@@ -111,8 +111,8 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (flags, baseline goexperiment
                flags.RegabiReflect = true
                flags.RegabiArgs = true
        }
-       // regabi is only supported on amd64 and arm64.
-       if goarch != "amd64" && goarch != "arm64" {
+       // regabi is only supported on amd64, arm64, ppc64 and ppc64le.
+       if goarch != "amd64" && goarch != "arm64" && goarch != "ppc64le" && goarch != "ppc64" {
                flags.RegabiReflect = false
                flags.RegabiArgs = false
        }