Skip to content

Commit a484e84

Browse files
authored
Merge pull request #371 from riscv-non-isa/relax-gp-reg
Relax gp could be platform specific register rather than reserved for…
2 parents 2fab064 + bb0df41 commit a484e84

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

riscv-cc.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ endif::[]
2828
In the standard ABI, procedures should not modify the integer registers tp and
2929
gp, because signal handlers may rely upon their values.
3030

31+
The presence of a frame pointer is optional. If a frame pointer exists,
32+
it must reside in x8 (s0); the register remains callee-saved.
33+
34+
If a platform requires use of a dedicated general-purpose register for a
35+
platform-specific purpose, it is recommended to use gp (x3). The platform ABI
36+
specification must document the use of this register. For such platforms, care
37+
must be taken to ensure all code (compiler generated or otherwise) avoids using
38+
gp in a way incompatible with the platform specific purpose, and that global
39+
pointer relaxation is disabled in the toolchain.
40+
3141
=== Frame Pointer Convention
3242

3343
The presence of a frame pointer is optional. If a frame pointer exists,

0 commit comments

Comments
 (0)