BLAKE3 icon indicating copy to clipboard operation
BLAKE3 copied to clipboard

factor out RISCV support from the guts_api branch

Open oconnor663 opened this issue 2 years ago • 1 comments

TODO: figure out what environment variable should enable this

oconnor663 avatar Jan 22 '24 06:01 oconnor663

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.

silvanshade avatar Jan 24 '24 23:01 silvanshade