]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: save and restore R31 for crosscall1 on loong64
authorGuoqi Chen <chenguoqi@loongson.cn>
Thu, 4 Sep 2025 09:02:01 +0000 (17:02 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Sat, 6 Sep 2025 01:11:42 +0000 (18:11 -0700)
commite8126bce9e511b92b914643d30f96846bbc5c783
tree065833e47442d95cd372c0b9280c4525314b0964
parentd767064170aa3469404d25608d9ff9fa48962337
runtime/cgo: save and restore R31 for crosscall1 on loong64

According to the Loong64 procedure call standard [1], R31 is a static
register and therefore needs to be saved and restored.

Also, the R2 (thread pointer) register has been removed here, as it is
not involved in allocation.

[1]: https://github.com/loongson/la-abi-specs/blob/release/lapcs.adoc

Change-Id: I02e5d4bedf131e491f1a262aa3cbc0896cbc9488
Reviewed-on: https://go-review.googlesource.com/c/go/+/700817
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/cgo/gcc_loong64.S