]> Cypherpunks repositories - gostls13.git/commit
cmd/go: define an asm macro for GOEXPERIMENT=regabi
authorAustin Clements <austin@google.com>
Tue, 1 Sep 2020 15:21:50 +0000 (11:21 -0400)
committerAustin Clements <austin@google.com>
Thu, 3 Sep 2020 12:55:47 +0000 (12:55 +0000)
commita538b59fd2428ba4d13f296d7483febf2fc05f97
tree5f1e5c14701765ae64173551edda7b94dc91532c
parent2b8b06ebbf0198d3c7a9b4d839bc05d9b13ecbe7
cmd/go: define an asm macro for GOEXPERIMENT=regabi

This defines a macro for the regabi GOEXPERIMENT when assembling
runtime assembly code.

In general, assembly code will be shielded from the calling convention
change, but there is a small amount of runtime assembly that is going
to have to change. By defining a macro, we can easily make the small
necessary changes. The other option is to use build tags, but that
would require duplicating nontrivial amounts of unaffected code,
leading to potential divergence issues. (And unlike Go code, assembly
code can't depend on the compiler optimizing away branches on a
feature constant.) We consider the macro preferable, especially since
this is expected to be temporary as we transition to the new calling
convention.

Updates #40724.

Change-Id: I73984065123968337ec10b47bb12c4a1cbc07dc5
Reviewed-on: https://go-review.googlesource.com/c/go/+/252258
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/go/internal/work/gc.go