cmd/compile: no automatic use of fused multiply-add on amd64 even with GOAMD64=v3 #71204
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Go version
go version go1.23.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Compile the following program with
GOARCH=amd64 GOAMD64=v3 go build -gcflags=-S
What did you see happen?
What did you expect to see?
I expected fooImplicit and fooExplicit to generate identical code when setting GOAMD64=v3.
On arm64, the compiler detects the
x*y + z
pattern and automatically uses FMA. On amd64, math.FMA uses runtime feature detection unless the GOAMD64 environment variable is set to v3 or higher, in which case calls to math.FMA compile directly to VFMADD231SD. However,x*y + z
isn't detected, regardless of the value of GOAMD64.The text was updated successfully, but these errors were encountered: