RISC-V Topic Guide

Calling Convention

The standard RISC-V psABI calling convention covers caller/callee-saved integer registers, a0-a7 argument registers with a0-a1 also used for returns, the optional s0/fp frame-pointer chain, 16-byte stack alignment at entry and throughout execution, and hardware floating-point ABI argument and return rules. ILP32E is an exception: it uses a0-a5 and requires only 4-byte stack alignment.

a0-a7raspgptpt0-t6s0-s11fp/s0fa0-fa7caller-savedcallee-saved16-byte stack alignmentreturn valuesargument passing