Check x86 features even in no_std#469
Conversation
|
Interesting, this is my first time looking at the |
|
Do you know what this line means in their docs?
|
|
There was a drama around AVX10 versions with both 512-bit and 256-bit-only vector support, but eventually Intel decided to roll it back and settled on 512-bit only. I think it is related to that, see rust-lang/rust#138843 I don't know if I just tested on AMD 7970X CPU (Zen 4, AVX512-capable) and performance both before and after is the same, meaning the features are detected the same way. Maybe @tarcieri can share some more details about this if he has time. |
|
I think this is a better link, AVX512 features are about to be stabilized: rust-lang/rust#138940 |
| #[cfg(blake3_avx512_ffi)] | ||
| #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] | ||
| #[inline(always)] | ||
| #[allow(unreachable_code)] |
Previously "std" enabled runtime CPU feature detection on x86, but as of #469 that's always on.
|
Follow-up doc changes in f3e0184. |
|
I'd appreciate 1.8.3 release with this change included, it has been a while since PR was merged |
|
Good idea, done! |
This makes it possible to use accelerated versions with runtime feature detection in
no_stdenvironment.This is nice in projects where bare-metal implementation is needed or when most all the code is already
no_stdand requiringstdjust to get a faster version of blake3 is inconvenient.I went with well known and well maintained
cpufeatures, though eventually previously used macros should become usable from::core: rust-lang/rfcs#2725Note that
cpufeaturesalready handles cases where features are enabled at compile time, so there is no need for explicit#[cfg(target_feature = "X")]blocks anymore.The only thing that still depends on
stdfeature now isstd::io.