Description
The choice between full_masks.rs
and bitmask.rs
seems to be made at compile time (
avx512f
target feature.
When compiling for general x86-64 targets but doing runtime feature detection for avx512f
, the current approach will generate suboptimal code for avx512, because it will use the full_masks.rs
implementation instead of the bitmask.rs
implementation.
I'd like to be able to use bitmasks in avx512 even when using runtime feature detection. It's probably out of scope (and, I think, undesirable) for std::simd
to be responsible for runtime feature detection, so one option would be for std::simd
to be refactored to expose both Mask
and Bitmask
as two separate types -- perhaps both implementing the same set of traits. This way, callers could choose between a full-mask implementation and a bitmask implementation based on whatever logic they choose, including e.g. runtime feature detection.