Skip to content

Commit

Permalink
Add a preprocessor definitions to indidcate the landing pad labeling …
Browse files Browse the repository at this point in the history
…scheme

Also add 2 more constant value to let user able to determine the scheme.

Example code:
```c
 #ifdef __riscv_landing_pad
   #if __riscv_landing_pad == __riscv_landing_pad_simple
     ...
   #elif __riscv_landing_pad == __riscv_landing_pad_func_sig
     ...
   #else
     #error "Unknown labeling scheme"
   #endif
 #endif
```
  • Loading branch information
kito-cheng committed May 10, 2024
1 parent d4ebd38 commit 779beee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions riscv-c-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ https://creativecommons.org/licenses/by/4.0/.
| __riscv_misaligned_fast | 1 | Misaligned accesses are fast. |
| __riscv_misaligned_slow | 1 | Misaligned accesses are supported, but may be substantially slower than aligned accesses. |
| __riscv_misaligned_avoid | 1 | Misaligned accesses are not supported and could trap. (see [ __riscv_misaligned_{fast,slow,avoid}](#__riscv_misaligned_{fast,slow,avoid}) |
| __riscv_landing_pad | <N> (See [__riscv_landing_pad](#__riscv_landing_pad) | Defined if the landing pad is enabled, and specifies which labeling scheme is used. |
| __riscv_landing_pad_simple | 1 | Constant value for the simple labeling scheme. |
| __riscv_landing_pad_func_sig | 2 | Constant value for the function signature based labeling scheme. |

### __riscv_v_min_vlen

Expand Down Expand Up @@ -107,6 +110,10 @@ and avoid to -mstrict-align, if specified.
Perhaps obvious, but these are mutually exclusive, so only one is defined at a time
for a compilation unit.

### __riscv_landing_pad

The value of `__riscv_landing_pad` indicates which labeling scheme is used. It
can be either `__riscv_landing_pad_simple` or `__riscv_landing_pad_func_sig`.

### Architecture Extension Test Macros

Expand Down

0 comments on commit 779beee

Please sign in to comment.