go/src/cmd
Cherry Zhang cf148f3d46 cmd/compile, runtime: use ABI-aware function converting float to interface
Currently, when converting a float (say float64), we use convT64
function. In the runtime convT64 expects a uint64 argument. In
the compiler, convT64 is defined as taking an "any" argument (so
it works with also uint64-like types such as [1]uint64). The "any"
type is instantiated with the concrete type in walk. So the
backend will see instances such as convT64([1]uint64).

Currently, float64 is treated as uint64-like. So the backend will
see convT64(float64). With a memory-based calling convention this
is fine. With a register-based calling convention, however, it
will pass the argument in a floating point register, whereas the
runtime expects the argument in an integer register (as it is
declared as uint64).

To fix this, this CL introduces runtime functions convT32F and
convT64F. They behave the same as convT32/convT64, but with a
float argument. In the compiler, use convT32F/convT64F to convert
float-like type to interface.

With this, "GOEXPERIMENT=regabi,regabiargs go test math fmt"
works.

Updates #40724.

Change-Id: I8b2e232096a95e4a7c4ab81795d77ef224ffaab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/307232
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-04-05 18:22:47 +00:00
..
addr2line all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp 2020-12-09 19:12:23 +00:00
api all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
asm cmd/asm: complete the support for VDUP on arm64 2021-03-19 01:38:59 +00:00
buildid
cgo cmd/cgo: check whether C compiler exists 2021-03-17 20:29:22 +00:00
compile cmd/compile, runtime: use ABI-aware function converting float to interface 2021-04-05 18:22:47 +00:00
cover cmd/cover: use golang.org/x/tools/cover directly 2021-03-25 20:57:58 +00:00
dist cmd/dist: include "go1.x-" in devel go version strings 2021-04-03 10:58:19 +00:00
doc cmd/doc: properly display interface methods 2021-03-19 03:05:26 +00:00
fix all: introduce and use internal/execabs 2021-01-21 19:10:18 +00:00
go cmd/go: refactor modload.CheckRetractions 2021-04-05 15:29:16 +00:00
gofmt cmd/gofmt: fix const association to avoid inaccurate comment 2021-03-10 17:10:00 +00:00
internal cmd/compile: untangle Wrapper and ABIWrapper flags 2021-04-05 17:27:18 +00:00
link cmd/link: mangle function name with ABI on Mach-O 2021-04-05 16:37:20 +00:00
nm all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
objdump cmd/internal/objfile: don't require runtime.symtab symbol for XCOFF 2021-01-11 18:19:08 +00:00
pack cmd/pack: r command create output file if not exist 2020-12-22 18:16:54 +00:00
pprof cmd/vendor, cmd/pprof: use golang.org/x/term directly 2021-03-26 06:03:20 +00:00
test2json all: introduce and use internal/execabs 2021-01-21 19:10:18 +00:00
trace all: use HTML5 br tags 2021-03-13 03:38:42 +00:00
vendor cmd/vendor, cmd/pprof: use golang.org/x/term directly 2021-03-26 06:03:20 +00:00
vet cmd/vet: bring in sigchanyzer to report unbuffered channels to signal.Notify 2021-03-08 23:13:52 +00:00
README.vendor
go.mod cmd/vendor, cmd/pprof: use golang.org/x/term directly 2021-03-26 06:03:20 +00:00
go.sum cmd/go: move psuedo-version and version sorting to x/mod 2021-03-24 13:54:14 +00:00

README.vendor

See src/README.vendor for information on loading vendored packages
and updating the vendor directory.