IssueRaiser

cmd/compile: switch to a register-based calling convention for Go functions

I propose that we switch the Go internal ABI (used between Go functions) from stack-based to register-based argument and result passing for Go ~1.16~ 1.17. I lay out the details of our proposal and the work required in [this document](https://golang.org/design/40724-register-calling). The ABI specification can be found [here](https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/cmd/compile/internal-abi.md). This was previously proposed in #18597, where @dr2chase did some excellent prototyping work that our new proposal builds on. With multiple ABI support, we’re now in a much better position to execute on this without breaking compatibility with the existing body of Go assembly code. I’ve opened this new issue to focus on discussion of our new proposal. /cc @dr2chase @danscales @thanm @cherrymui @mknyszek @prattmic @randall77 An incomplete and evolving list of tasks: - [X] Define ABI specification ([CL](https://golang.org/cl/285292), @aclements) - [X] Add GOEXPERIMENT=regabi and asm macro ([CL](https://golang.org/cl/252258)) - [x] cmd/compile: late call lowering ([CLs](https://go-review.googlesource.com/q/hashtag:%22drchase-late-call%22)) - [x] cmd/compile: implement register arguments (@dr2chase) - [x] spill around morestack call ([CL](https://golang.org/cl/279520)) - [x] add temporary ABI pragma for testing ([CL](https://golang.org/cl/279521)) - [x] add abstract argument registers ([WIP CL](https://golang.org/cl/260539)) - [x] implement ABI rule

Posted by aclements on Aug 12, 2020, 1:55 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

support (Other)

cmd/compile: switch to a register-based calling convention for Go functions

aclementsAug 12, 2020, 1:55 PM

I propose that we switch the Go internal ABI (used between Go functions) from stack-based to register-based argument and result passing for Go ~1.16~ 1.17. I lay out the details of our proposal and the work required in [this document](https://golang.org/design/40724-register-calling). The ABI specification can be found [here](https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/cmd/compile/internal-abi.md). This was previously proposed in #18597, where @dr2chase did some excellent prototyping work that our new proposal builds on. With multiple ABI support, we’re now in a much better position to execute on this without breaking compatibility with the existing body of Go assembly code. I’ve opened this new issue to focus on discussion of our new proposal. /cc @dr2chase @danscales @thanm @cherrymui @mknyszek @prattmic @randall77 An incomplete and evolving list of tasks: - [X] Define ABI specification ([CL](https://golang.org/cl/285292), @aclements) - [X] Add GOEXPERIMENT=regabi and asm macro ([CL](https://golang.org/cl/252258)) - [x] cmd/compile: late call lowering ([CLs](https://go-review.googlesource.com/q/hashtag:%22drchase-late-call%22)) - [x] cmd/compile: implement register arguments (@dr2chase) - [x] spill around morestack call ([CL](https://golang.org/cl/279520)) - [x] add temporary ABI pragma for testing ([CL](https://golang.org/cl/279521)) - [x] add abstract argument registers ([WIP CL](https://golang.org/cl/260539)) - [x] implement ABI rule

Comments (0)

No comments yet. Start the discussion.

Comment on this issue