mirror of
https://github.com/golang/go
synced 2024-09-30 03:24:39 -06:00
cmd/compile: remove scratchFpMem global
Instead, add a scratchFpMem field to ssafn, so that it may be passed on to genssa. Updates #15756 Change-Id: Icdeae290d3098d14d31659fa07a9863964bb76ed Reviewed-on: https://go-review.googlesource.com/38728 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
399086f2db
commit
7efb0779be
@ -171,8 +171,6 @@ func (s byStackVar) Len() int { return len(s) }
|
||||
func (s byStackVar) Less(i, j int) bool { return cmpstackvarlt(s[i], s[j]) }
|
||||
func (s byStackVar) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
|
||||
var scratchFpMem *Node
|
||||
|
||||
func (s *ssafn) AllocFrame(f *ssa.Func) {
|
||||
s.stksize = 0
|
||||
s.stkptrsize = 0
|
||||
@ -208,9 +206,8 @@ func (s *ssafn) AllocFrame(f *ssa.Func) {
|
||||
}
|
||||
}
|
||||
|
||||
if f.Config.NeedsFpScratch {
|
||||
scratchFpMem = tempAt(src.NoXPos, s.curfn, Types[TUINT64])
|
||||
scratchFpMem.SetUsed(scratchUsed)
|
||||
if f.Config.NeedsFpScratch && scratchUsed {
|
||||
s.scratchFpMem = tempAt(src.NoXPos, s.curfn, Types[TUINT64])
|
||||
}
|
||||
|
||||
sort.Sort(byStackVar(fn.Dcl))
|
||||
|
@ -4306,8 +4306,7 @@ func genssa(f *ssa.Func, pp *Progs) {
|
||||
s.SSEto387 = map[int16]int16{}
|
||||
}
|
||||
|
||||
s.ScratchFpMem = scratchFpMem
|
||||
scratchFpMem = nil
|
||||
s.ScratchFpMem = e.scratchFpMem
|
||||
|
||||
// Emit basic blocks
|
||||
for i, b := range f.Blocks {
|
||||
@ -4686,11 +4685,12 @@ func fieldIdx(n *Node) int {
|
||||
// ssafn holds frontend information about a function that the backend is processing.
|
||||
// It also exports a bunch of compiler services for the ssa backend.
|
||||
type ssafn struct {
|
||||
curfn *Node
|
||||
strings map[string]interface{} // map from constant string to data symbols
|
||||
stksize int64 // stack size for current frame
|
||||
stkptrsize int64 // prefix of stack containing pointers
|
||||
log bool
|
||||
curfn *Node
|
||||
strings map[string]interface{} // map from constant string to data symbols
|
||||
scratchFpMem *Node // temp for floating point register / memory moves on some architectures
|
||||
stksize int64 // stack size for current frame
|
||||
stkptrsize int64 // prefix of stack containing pointers
|
||||
log bool
|
||||
}
|
||||
|
||||
// StringData returns a symbol (a *Sym wrapped in an interface) which
|
||||
|
Loading…
Reference in New Issue
Block a user