During the context switch of goroutine scheduling, the value of the
fcc0 register needs to be saved on the stack.
Fixs #59000.
Change-Id: Ie80dbae738f60df6c11a3fe31fc57de817d76afc
Reviewed-on: https://go-review.googlesource.com/c/go/+/475577
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
l.add(movf, reg, regsize)
}
+ // save/restore FCC0
+ l.addSpecial(
+ mov+" FCC0, R4\n"+mov+" R4, %d(R3)",
+ mov+" %d(R3), R4\n"+mov+" R4, FCC0",
+ regsize)
+
// allocate frame, save PC of interrupted instruction (in LR)
p(mov+" R1, -%d(R3)", l.stack)
p(sub+" $%d, R3", l.stack)
#include "textflag.h"
TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
- MOVV R1, -472(R3)
- SUBV $472, R3
+ MOVV R1, -480(R3)
+ SUBV $480, R3
MOVV R4, 8(R3)
MOVV R5, 16(R3)
MOVV R6, 24(R3)
MOVD F29, 448(R3)
MOVD F30, 456(R3)
MOVD F31, 464(R3)
+ MOVV FCC0, R4
+ MOVV R4, 472(R3)
CALL ·asyncPreempt2(SB)
+ MOVV 472(R3), R4
+ MOVV R4, FCC0
MOVD 464(R3), F31
MOVD 456(R3), F30
MOVD 448(R3), F29
MOVV 24(R3), R6
MOVV 16(R3), R5
MOVV 8(R3), R4
- MOVV 472(R3), R1
+ MOVV 480(R3), R1
MOVV (R3), R30
- ADDV $480, R3
+ ADDV $488, R3
JMP (R30)