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 macros for RISCV features #244

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Add macros for RISCV features #244

merged 1 commit into from
Jul 12, 2022

Conversation

michael-roe
Copy link
Contributor

Add macros that test which RISCV features have been enabled at compile time.

This patch has been tested with clang version 14.0.0 (and should also work with gcc).

clang does not currently support 128 bit integer registers (CPU_FEATURES_ARCH_RISCV128) or 128 bit floating point registers (CPU_FEATURES_COMPILED_RISCV_Q); all the other features are supported by clang 14.0.0.

These features are all either in the ratified version of the RISCV Unprivileged specification, or are ratified extensions. (the V vector extension, Zb bitmap extensions, and Zk crypto extensions were ratified in November 2021). i.e. they are all officially part of the RISCV spec.

@michael-roe
Copy link
Contributor Author

Ok, I've updated the PR to add macros for E, I, Zfh, Zfhmin, Zksed and Zksh.

clang 14.0.0 doesn't support rv32e, so you'll never see CPU_FEATURES_COMPILED_RISCV_E set unless you're using a different compiler.

@toor1245
Copy link
Contributor

looks good

@gchatelet gchatelet merged commit 8360923 into google:main Jul 12, 2022
@gchatelet gchatelet added this to the v0.8.0 milestone Apr 27, 2023
@gchatelet gchatelet added the misc non user facing: internal, cleanup, ci, release process label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc non user facing: internal, cleanup, ci, release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants