riscvarchive / riscv-eabi-spec

Proposal for new Embedded ABI (EABI) for use in embedded RISC-V systems.
Creative Commons Attribution 4.0 International
26 stars 5 forks source link

System preprocessor definitions for architecture & ABI #5

Open ilg-ul opened 5 years ago

ilg-ul commented 5 years ago

(this should be passed to the team that will implement the compiler, but for reference I enter it here)

The current ABI selection must be available via a compiler system preprocessor definition, so the software will know how to handle exception frames (and possible other low level use cases).

The only document where I saw some preprocessor definitions is:

https://github.com/riscv/riscv-toolchain-conventions

but it does not include a macro for the ABI.

Neither the dumps that I did some time ago do not list the ABI:

https://gnu-mcu-eclipse.github.io/arch/riscv/programmer/#preprocessor-macros

aswaterman commented 5 years ago

The UABI defines riscv_float_abi_soft, __riscv_float_abi_single, or riscv_float_abi_double to indicate which of the three UABI calling conventions is in use for a given XLEN. I think the EABI should follow the same convention for simplicity, but additionally define __riscv_eabi to distinguish the EABI from the UABI.