diff --git a/asm/riscv_encode.go b/asm/riscv_encode.go index abdb408..23e8b26 100644 --- a/asm/riscv_encode.go +++ b/asm/riscv_encode.go @@ -65,7 +65,7 @@ func riscvRegNum(name string) int { return 25 case "X26", "S10": return 26 - case "X27", "S11": + case "X27", "S11", "g": return 27 case "X28", "T3": return 28 diff --git a/testdata/verify/abi_arm64.s b/testdata/verify/abi_arm64.s index 53e8b2d..840b50d 100644 --- a/testdata/verify/abi_arm64.s +++ b/testdata/verify/abi_arm64.s @@ -22,9 +22,9 @@ TEXT ·dirtyFP(SB), NOSPLIT, $0-16 RET // func dirtyG(a int64) int64 -// Deliberately clobbers R28, the goroutine pointer (a serious ABI violation). +// Deliberately clobbers g, the goroutine pointer (R28; a serious ABI violation). TEXT ·dirtyG(SB), NOSPLIT, $0-16 - MOVD $0x5678, R28 + MOVD $0x5678, g MOVD a+0(FP), R0 MOVD R0, ret+8(FP) RET diff --git a/testdata/verify/abi_loong64.s b/testdata/verify/abi_loong64.s index cc21d76..217c4e2 100644 --- a/testdata/verify/abi_loong64.s +++ b/testdata/verify/abi_loong64.s @@ -13,9 +13,9 @@ TEXT ·cleanAdd(SB), NOSPLIT, $0-24 RET // func dirtyG(a int64) int64 -// Deliberately clobbers R22, the goroutine pointer (a serious ABI violation). +// Deliberately clobbers g, the goroutine pointer (R22; a serious ABI violation). TEXT ·dirtyG(SB), NOSPLIT, $0-16 - MOVV $0x5678, R22 + MOVV $0x5678, g MOVV a+0(FP), R4 MOVV R4, ret+8(FP) RET diff --git a/testdata/verify/abi_riscv64.s b/testdata/verify/abi_riscv64.s index 36c1ead..ed588ad 100644 --- a/testdata/verify/abi_riscv64.s +++ b/testdata/verify/abi_riscv64.s @@ -13,9 +13,9 @@ TEXT ·cleanAdd(SB), NOSPLIT, $0-24 RET // func dirtyG(a int64) int64 -// Deliberately clobbers X27, the goroutine pointer (a serious ABI violation). +// Deliberately clobbers g, the goroutine pointer (X27; a serious ABI violation). TEXT ·dirtyG(SB), NOSPLIT, $0-16 - MOV $0x5678, X27 + MOV $0x5678, g MOV a+0(FP), X5 MOV X5, ret+8(FP) RET