Skip to content

Commit

Permalink
Add riscv_intrinsic.h to define int_xlen_t and uint_xlen_t
Browse files Browse the repository at this point in the history
  • Loading branch information
kito-cheng committed Dec 9, 2020
1 parent 66f2da3 commit 0006c50
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions riscv-c-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,25 @@ For example:
* `__attribute__((interrupt("supervisor")))`
* `__attribute__((interrupt("machine")))`

## Intrinsic Functions
## Header Files for Intrinsic Function

Do we really have none of these? I can't figure out
`gcc/gcc/config/riscv/riscv-builtins.c`...
### riscv_intrinsic.h

This file is universal intrinsic header file for all extensions, each extension
could have their own header files, but should included in this file if
corresponding extension is enabled.

This header file also defined several common RISC-V specific type and related
marco could be used in intrinsic interface or user program directly.

| Type Name | Meaning |
| --------------------- | ------------------------------------ |
| int_xlen_t | Signed integer type with XLEN bits |
| uint_xlen_t | Unsigned integer type with XLEN bits |

| Macro Name | Value |
| --------------------- | ------------------------------------ |
| INT_XLEN_MAX | Minimum value of int_xlen_t |
| INT_XLEN_MIN | Minimum value of int_xlen_t |
| UINT_XLEN_MAX | Maximum value of uint_xlen_t |
| UINT_XLEN_MIN | Minimum value of uint_xlen_t |

0 comments on commit 0006c50

Please sign in to comment.