mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: don't use duffcopy and duffzero on Plan 9
The ssa compiler uses the duffcopy and duffzero functions, which rely on the MOVUPS instructions. However, this doesn't work on Plan 9, since floating point operations are not allowed in the note handler. This change disables the use of duffcopy and duffzero on Plan 9 in the ssa compiler. Updates #14605. Change-Id: I017f8ff83de00eabaf7e146b4344a863db1dfddc Reviewed-on: https://go-review.googlesource.com/20171 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
466c948b55
commit
d55a099e22
3 changed files with 32 additions and 25 deletions
|
|
@ -13,16 +13,17 @@ import (
|
|||
)
|
||||
|
||||
type Config struct {
|
||||
arch string // "amd64", etc.
|
||||
IntSize int64 // 4 or 8
|
||||
PtrSize int64 // 4 or 8
|
||||
lowerBlock func(*Block) bool // lowering function
|
||||
lowerValue func(*Value, *Config) bool // lowering function
|
||||
fe Frontend // callbacks into compiler frontend
|
||||
HTML *HTMLWriter // html writer, for debugging
|
||||
ctxt *obj.Link // Generic arch information
|
||||
optimize bool // Do optimization
|
||||
curFunc *Func
|
||||
arch string // "amd64", etc.
|
||||
IntSize int64 // 4 or 8
|
||||
PtrSize int64 // 4 or 8
|
||||
lowerBlock func(*Block) bool // lowering function
|
||||
lowerValue func(*Value, *Config) bool // lowering function
|
||||
fe Frontend // callbacks into compiler frontend
|
||||
HTML *HTMLWriter // html writer, for debugging
|
||||
ctxt *obj.Link // Generic arch information
|
||||
optimize bool // Do optimization
|
||||
noDuffDevice bool // Don't use Duff's device
|
||||
curFunc *Func
|
||||
|
||||
// TODO: more stuff. Compiler flags of interest, ...
|
||||
|
||||
|
|
@ -122,6 +123,12 @@ func NewConfig(arch string, fe Frontend, ctxt *obj.Link, optimize bool) *Config
|
|||
c.ctxt = ctxt
|
||||
c.optimize = optimize
|
||||
|
||||
// Don't use Duff's device on Plan 9, because floating
|
||||
// point operations are not allowed in note handler.
|
||||
if obj.Getgoos() == "plan9" {
|
||||
c.noDuffDevice = true
|
||||
}
|
||||
|
||||
// Assign IDs to preallocated values/blocks.
|
||||
for i := range c.values {
|
||||
c.values[i].ID = ID(i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue