Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 999 Bytes

calling-convention.adoc

File metadata and controls

24 lines (17 loc) · 999 Bytes

Appendix A: Calling Convention

In the RISC-V psABI, the vector registers v0-v31 are all caller-saved. The vl and vtype CSRs are also caller-saved.

Procedures may assume that vstart is zero upon entry. Procedures may assume that vstart is zero upon return from a procedure call.

Note
Application software should normally not write vstart explicitly. Any procedure that does explicitly write vstart to a nonzero value must zero vstart before either returning or calling another procedure.

The vxrm and vxsat fields of vcsr have thread storage duration.

Executing a system call causes all caller-saved vector registers (v0-v31, vl, vtype) and vstart to become unspecified.

Note
This scheme allows system calls that cause context switches to avoid saving and later restoring the vector registers.
Note
Most OSes will choose to either leave these registers intact or reset them to their initial state to avoid leaking information across process boundaries.