diff options
| author | Guoqi Chen <chenguoqi@loongson.cn> | 2025-02-25 10:50:50 +0800 |
|---|---|---|
| committer | abner chenc <chenguoqi@loongson.cn> | 2025-02-26 17:36:57 -0800 |
| commit | 01ba8bfe868df2eea10ea8dd5bfbe5af0549909d (patch) | |
| tree | 42b9a7b19360301bfea841a1c3175c2e39ae73de /src | |
| parent | 11c847e536bff955eab65cc0a3008557362dda22 (diff) | |
| download | go-01ba8bfe868df2eea10ea8dd5bfbe5af0549909d.tar.xz | |
runtime/cgo: use standard ABI call setg_gcc in crosscall1 on loong64
Change-Id: Ie38583d667d579751d643b2da2aa56390b69904c
Reviewed-on: https://go-review.googlesource.com/c/go/+/652255
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/asm_loong64.s | 4 | ||||
| -rw-r--r-- | src/runtime/cgo/gcc_loong64.S | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/runtime/asm_loong64.s b/src/runtime/asm_loong64.s index d5dc61ff68..604b1243f7 100644 --- a/src/runtime/asm_loong64.s +++ b/src/runtime/asm_loong64.s @@ -656,9 +656,9 @@ TEXT runtime·setg(SB), NOSPLIT, $0-8 JAL runtime·save_g(SB) RET -// void setg_gcc(G*); set g called from gcc with g in R19 +// void setg_gcc(G*); set g called from gcc with g in R4 TEXT setg_gcc<>(SB),NOSPLIT,$0-0 - MOVV R19, g + MOVV R4, g JAL runtime·save_g(SB) RET diff --git a/src/runtime/cgo/gcc_loong64.S b/src/runtime/cgo/gcc_loong64.S index 6b7668f288..c84a3715b2 100644 --- a/src/runtime/cgo/gcc_loong64.S +++ b/src/runtime/cgo/gcc_loong64.S @@ -34,10 +34,11 @@ crosscall1: fst.d $f30, $r3, 136 fst.d $f31, $r3, 144 - move $r18, $r4 // save R4 - move $r19, $r6 + // r4 = *fn, r5 = *setg_gcc, r6 = *g + move $r23, $r4 // save R4 + move $r4, $r6 jirl $r1, $r5, 0 // call setg_gcc (clobbers R4) - jirl $r1, $r18, 0 // call fn + jirl $r1, $r23, 0 // call fn ld.d $r23, $r3, 8 ld.d $r24, $r3, 16 |
