Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preprocessor definitions to indidcate the landing pad labeling … #76

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. |
Copy link

@mylai-mtk mylai-mtk May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| __riscv_landing_pad_simple | 1 | Defined if the "simple" landing pad is in use. Constant value for the simple labeling scheme. |
| __riscv_landing_pad_func_sig | 2 | Defined if the "func_sig" landing pad is in use. Constant value for the function signature based labeling scheme. |

Add some conditions to spare the preprocessor from bloated macros?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we are to limit when these macros are defined, why not just use:

#if defined(__riscv_zicfilp_landing_pad_simple)
...
#elif defined(__riscv_zicfilp_landing_pad_func_sig)
...
#endif

? This avoids more new macros, and it's clear when these macros would be defined, and when they would not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, but I keep __riscv_zicfilp_landing_pad for now, we could remove that later...if that is not really used in anywhere :)


### __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