1 Star 0 Fork 0

adp-neo/riscv-v-spec

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
calling-convention.adoc 1.27 KB
一键复制 编辑 原始数据 按行查看 历史

Appendix A: Calling Convention (Not authoritative - Placeholder Only)

Note
This Appendix is only a placeholder to help explain the conventions used in the code examples, and is not considered frozen or part of the ratification process. The official RISC-V psABI document is being expanded to specify the vector calling conventions.

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.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pulp4/riscv-v-spec.git
git@gitee.com:pulp4/riscv-v-spec.git
pulp4
riscv-v-spec
riscv-v-spec
master

搜索帮助