Skip to content

Instantly share code, notes, and snippets.

@lenary
Last active July 1, 2020 21:19
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 lenary/4016183f5d04b26816e2b811e9f25dd4 to your computer and use it in GitHub Desktop.
Save lenary/4016183f5d04b26816e2b811e9f25dd4 to your computer and use it in GitHub Desktop.

RISC-V Registers Cheatsheet

Numeric ABI Name Calling Convention RVC? RVE?
x0 zero Immutable No Yes
x1 ra Return Address No Yes
x2 sp Callee-Saved No* Yes
x3 gp Unallocatable No Yes
x4 tp Unallocatable No Yes
x5-x7 t0-t2 Caller-Saved No Yes
x8 s0, fp Callee-Saved Yes Yes
x9 s1 Callee-Saved Yes Yes
x10-x15 a0-a5 Arguments Yes Yes
x16-x17 a6-a7 Arguments No No
x18-x27 s2-s11 Callee-saved No No
x28-x31 t3-t6 Caller-Saved No No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment