From: Meng Zhuo Date: Wed, 10 Dec 2025 13:08:01 +0000 (+0800) Subject: cmd/compile: update ABI document for riscv64 X-Git-Url: https://git.feebdaed.xyz/?a=commitdiff_plain;h=927c89bbc5cc7366e86ecbb0f77267435b1d6d2c;p=0xmirror%2Fgo.git cmd/compile: update ABI document for riscv64 The duff device has been dropped on riscv64, we can remove related documentation now. Change-Id: Iffe5093bde6854bca236e290b91ab9f48d3f8c06 Reviewed-on: https://go-review.googlesource.com/c/go/+/728901 Reviewed-by: Mark Ryan LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-by: Joel Sing Reviewed-by: Dmitri Shuralyov --- diff --git a/src/cmd/compile/abi-internal.md b/src/cmd/compile/abi-internal.md index 8de8356132..a04b5aed3f 100644 --- a/src/cmd/compile/abi-internal.md +++ b/src/cmd/compile/abi-internal.md @@ -799,17 +799,15 @@ assembly code are as follows: | X2 | Stack pointer | Same | Same | | X3 | Global pointer | Same | Used by dynamic linker | | X4 | TLS (thread pointer) | TLS | Scratch | -| X24,X25 | Scratch | Scratch | Used by duffcopy, duffzero | | X26 | Closure context pointer | Scratch | Scratch | | X27 | Current goroutine | Same | Same | | X31 | Scratch | Scratch | Scratch | *Rationale*: These register meanings are compatible with Go’s -stack-based calling convention. Context register X20 will change to X26, -duffcopy, duffzero register will change to X24, X25 before this register ABI been adopted. +stack-based calling convention. X10 – X17, X8, X9, X18 – X23, is the same order as A0 – A7, S0 – S7 in platform ABI. F10 – F17, F8, F9, F18 – F23, is the same order as FA0 – FA7, FS0 – FS7 in platform ABI. -X8 – X23, F8 – F15 are used for compressed instruction (RVC) which will benefit code size in the future. +X8 – X23, F8 – F15 are used for compressed instruction (RVC) which benefits code size. #### Stack layout