mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: don't use FMA on plan9
CL 137156 introduces an intrinsic on AMD64 that executes vfmadd231sd when feature detection is successful. However, because floating-point isn't allowed in note handler, the builder disables SSE instructions, and fails when attempting to execute this instruction. This change disables FMA on plan9 to immediately use the software fallback. Fixes #35063. Change-Id: I87d8f0995bd2f15013d203e618938f5079c9eed2 Reviewed-on: https://go-review.googlesource.com/c/go/+/202617 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
48eb79ec21
commit
03fb1f607b
2 changed files with 22 additions and 5 deletions
|
|
@ -43,6 +43,7 @@ type Config struct {
|
|||
Race bool // race detector enabled
|
||||
NeedsFpScratch bool // No direct move between GP and FP register sets
|
||||
BigEndian bool //
|
||||
UseFMA bool // Use hardware FMA operation
|
||||
}
|
||||
|
||||
type (
|
||||
|
|
@ -326,12 +327,18 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.ctxt = ctxt
|
||||
c.optimize = optimize
|
||||
c.useSSE = true
|
||||
c.UseFMA = true
|
||||
|
||||
// Don't use Duff's device nor SSE on Plan 9 AMD64, because
|
||||
// floating point operations are not allowed in note handler.
|
||||
if objabi.GOOS == "plan9" && arch == "amd64" {
|
||||
c.noDuffDevice = true
|
||||
c.useSSE = false
|
||||
// On Plan 9, floating point operations are not allowed in note handler.
|
||||
if objabi.GOOS == "plan9" {
|
||||
// Don't use FMA on Plan 9
|
||||
c.UseFMA = false
|
||||
|
||||
// Don't use Duff's device and SSE on Plan 9 AMD64.
|
||||
if arch == "amd64" {
|
||||
c.noDuffDevice = true
|
||||
c.useSSE = false
|
||||
}
|
||||
}
|
||||
|
||||
if ctxt.Flag_shared {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue