1
0
mirror of https://github.com/golang/go synced 2024-11-22 19:54:39 -07:00

cmd/internal/obj: set morestack arg spilling and regabi prologue on loong64

Update #40724

Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn>
Change-Id: Ie92da57e29bae0e5cccb2a49a7cbeaf02cbf3a8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/521787
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>
This commit is contained in:
Guoqi Chen 2023-08-16 09:16:21 +08:00 committed by Gopher Robot
parent c83b5fefab
commit e58c9baa9f

View File

@ -620,6 +620,10 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p = c.ctxt.StartUnsafePoint(p, c.newprog)
// Spill Arguments. This has to happen before we open
// any more frame space.
p = c.cursym.Func().SpillRegisterArgs(p, c.newprog)
// MOV REGLINK, -8/-16(SP)
p = obj.Appendp(p, c.newprog)
p.As = mov
@ -684,6 +688,8 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p.To.Reg = REGSP
p.Spadj = int32(-frameSize)
// Unspill arguments
p = c.cursym.Func().UnspillRegisterArgs(p, c.newprog)
p = c.ctxt.EndUnsafePoint(p, c.newprog, -1)
}
@ -795,6 +801,10 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p = c.ctxt.EmitEntryStackMap(c.cursym, p, c.newprog)
// Spill the register args that could be clobbered by the
// morestack code
p = c.cursym.Func().SpillRegisterArgs(p, c.newprog)
// JAL runtime.morestack(SB)
p = obj.Appendp(p, c.newprog)
@ -809,6 +819,7 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
}
p.Mark |= BRANCH
p = c.cursym.Func().UnspillRegisterArgs(p, c.newprog)
p = c.ctxt.EndUnsafePoint(p, c.newprog, -1)
// JMP start