Skip to content

Instantly share code, notes, and snippets.

@mithro
Last active March 26, 2019 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mithro/3eb3089873a670ce2030c07555febe84 to your computer and use it in GitHub Desktop.
Save mithro/3eb3089873a670ce2030c07555febe84 to your computer and use it in GitHub Desktop.
Register ABI Name Description Saver
x0 zero Hard-wired zero
x1 ra Return address Caller
x2 sp Stack pointer Callee
x3 gp Global pointer
x4 tp Thread pointer
x5–7 t0–2 Temporaries Caller
x8 s0/fp Saved register/frame pointer Callee
x9 s1 Saved register Callee
x10–11 a0–1 Function arguments/return values Caller
x12–17 a2–7 Function arguments Caller
x18–27 s2–11 Saved registers Callee
x28–31 t3–6 Temporaries Caller

RV32E Calling Convention

The RV32E calling convention is designed to be usable with the RV32E ISA.

This calling convention is the same as the integer calling convention, except for the following differences. The stack pointer need only be aligned to a 32-bit boundary.

Registers x16-x31 do not participate in the ABI, so there are only six argument registers, a0-a5, only two callee-saved registers, s0-s1, and only three temporaries, t0-t2.

If used with an ISA that has any of the registers x16-x31 and f0-f31, then these registers are considered temporaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment