Skip to content

RISC V calling convention summary

Sergey Reznick edited this page Oct 22, 2019 · 3 revisions

Scalar value is returned via a0 register.

Single scalar parameter is passed via a0 register.

Two scalar parameters are passed via a0, a1 registers.

Up-to 8 scalar parameters are passed via a0-a7 registers.

Extra parameters starting with eighth one are passed via in-memory stack (referenced by sp register).

Pointers handling does not differ from ordinary scalars.

All structs(even containing single int field) are passed via reference.

Clone this wiki locally