aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/abi/abiutils.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-02-13 10:49:37 -0500
committerDavid Chase <drchase@google.com>2021-03-03 03:02:39 +0000
commitf2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919 (patch)
tree6df5cf70ba9c5dc737d9e32a9db78626cffc6301 /src/cmd/compile/internal/abi/abiutils.go
parent06c72f3627ea749d8579d0d590fd715b2d5e512f (diff)
downloadgo-f2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919.tar.gz
go-f2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919.zip
cmd/compile: retrieve Args from registers
in progress; doesn't fully work until they are also passed on register on the caller side. For #40724. Change-Id: I29a6680e60bdbe9d132782530214f2a2b51fb8f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/293394 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/abi/abiutils.go')
-rw-r--r--src/cmd/compile/internal/abi/abiutils.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/abi/abiutils.go b/src/cmd/compile/internal/abi/abiutils.go
index 8549c0325d..903cc5205d 100644
--- a/src/cmd/compile/internal/abi/abiutils.go
+++ b/src/cmd/compile/internal/abi/abiutils.go
@@ -158,6 +158,13 @@ func (a *ABIConfig) LocalsOffset() int64 {
return a.offsetForLocals
}
+// FloatIndexFor translates r into an index in the floating point parameter
+// registers. If the result is negative, the input index was actually for the
+// integer parameter registers.
+func (a *ABIConfig) FloatIndexFor(r RegIndex) int64 {
+ return int64(r) - int64(a.regAmounts.intRegs)
+}
+
// NumParamRegs returns the number of parameter registers used for a given type,
// without regard for the number available.
func (a *ABIConfig) NumParamRegs(t *types.Type) int {