-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Update the CORE-V C API headers to follow the RISC-V conventi…
…ons. This patch changes the C API headers that were added for the CORE-V ISA extensions so that they follow the standard described for RISC-V here: https://github.com/riscv-non-isa/riscv-c-api-doc/blob/master/riscv-c-api.md#intrinsic-functions The C API headers must provide a uniform interface for instrinsic functions that is compatible with any compiler that supports them. In the wrapper of a C API intrinsic function definition any compiler can implement the functionality differently, whether it is with an existing instrinsic function, or with inline assembly etc... The user code that adds a C API RISC-V header is agnostic to the implementation and is then compatible with any compiler that has the header. The RISC-V intrinsic functions have - the common prefix '__riscv_' to avoid name collision with other targets. - a vendor specific prefix if they belong to a vendor specific extension. - the name of the function. - the type of the function: this is typically used to distinguish different versions of the same intrinsic function that differ only for the type of one or more operands. Another convention is to use the type 'long' instead of integer types like int32_t or uint32_t as the type 'long' will be set to the current XLEN. According to these conventions the CORE-V intrinsic functions are now redefined like: long __riscv_cv_name_type(long op1, long op2) { return __builtin_riscv_cv_name_type(op1, op2); }
- Loading branch information
Showing
5 changed files
with
828 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.