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

factor out RISCV support from the guts_api branch #375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oconnor663
Copy link
Member

TODO: figure out what environment variable should enable this

TODO: figure out what environment variable should enable this
Base automatically changed from guts_portable to master January 22, 2024 06:24
@silvanshade
Copy link

TODO: figure out what environment variable should enable this

In the RVV support for the rust crypto packages that I've been working on, I've generally been following the scheme where first, the feature gate for v is used (e.g., #[cfg(target_feature = "v")]) and then, for the extensions which don't have corresponding Rust features yet (but are exposed to the LLVM code generator), I've been adding cfg flags that follow the naming scheme target_feature_<ext>.

The intention is that these cfg flags would be replaced by proper target_feature gates once the features are exposed to Rust.

If you followed that scheme here, you'd end up with something like this:

#[cfg(all(target_feature = "v", target_feature = "zbb", target_feature_zvbb))]
...

If you're trying to parse this through the environment variables, it looks like the variable CARGO_CFG_TARGET_FEATURE is set to a comma separated list of the target features enabled. You should be able to get general cfg flags from CARGO_CFG_<cfg>, so then target_feature_zvbb should be set as CARGO_CFG_TARGET_FEATURE_ZVBB. Referenced here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants