Commit 7efb0779 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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/38728Reviewed-by: default avatarDavid Chase <drchase@google.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 399086f2
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment