]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions...
authorJoel Sing <joel@sing.id.au>
Sun, 27 Aug 2023 09:35:33 +0000 (19:35 +1000)
committerJoel Sing <joel@sing.id.au>
Tue, 18 Nov 2025 07:33:36 +0000 (23:33 -0800)
commitb9ef0633f6117c74fabcd7247a76b4feb86df086
treee72455efe805092171cecbae5349b0b066a0e1e8
parenta087dea8692eee879e8226b70eb691dea7758b0b
cmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions on riscv64

Enable the use of compressed instructions on riscv64 by reducing
the PC quantum to two bytes and reducing the minimum instruction
length to two bytes. Change gostartcall on riscv64 to land at
two times the PC quantum into goexit, so that we retain four byte
alignment and revise the NOP instructions in goexit to ensure that
they are never compressed. Additionally, adjust PCALIGN so that it
correctly handles two byte offsets.

Fixes #47560
Updates #71105

Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Change-Id: I4329a8fbfcb4de636aadaeadabb826bc22698640
Reviewed-on: https://go-review.googlesource.com/c/go/+/523477
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/sys/arch.go
src/internal/goarch/goarch_riscv64.go
src/runtime/asm_riscv64.s
src/runtime/sys_riscv64.go