Skip to content

Commit

Permalink
Merge pull request #371 from riscv-non-isa/relax-gp-reg
Browse files Browse the repository at this point in the history
Relax gp could be platform specific register rather than reserved for…
  • Loading branch information
kito-cheng authored Apr 14, 2023
2 parents 2fab064 + bb0df41 commit a484e84
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions riscv-cc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ endif::[]
In the standard ABI, procedures should not modify the integer registers tp and
gp, because signal handlers may rely upon their values.

The presence of a frame pointer is optional. If a frame pointer exists,
it must reside in x8 (s0); the register remains callee-saved.

If a platform requires use of a dedicated general-purpose register for a
platform-specific purpose, it is recommended to use gp (x3). The platform ABI
specification must document the use of this register. For such platforms, care
must be taken to ensure all code (compiler generated or otherwise) avoids using
gp in a way incompatible with the platform specific purpose, and that global
pointer relaxation is disabled in the toolchain.

=== Frame Pointer Convention

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

0 comments on commit a484e84

Please sign in to comment.