Code that uses vector types doesnât need to be annotated with #[target_feature], you can still use --target-feature= to select a feature globally, and use #![cfg!(target_feature)] to provide different implementations.
So even without stable #[target_feature], run-time dispatch would be possible, one would just need to split the code for each platform in different crates, compile them with --target-feature=, link them, and then dispatch to the appropriate crate using run-time feature detection. Extremely cumbersome, but possible.
Iâm a bit afraid of having to mark all the functions with:
#[ifunc("default", "sse2", "sse3", "sse4", "avx", "avx2")] // or #[ifunc("all_x86")]
fn foo() { /* .. */ }
to be able to write portable vector code that works as fast as possible on each architecture. I am also a bit afraid of compiling one crate enabling some feature, but that requires some other crate which was compiled with a different feature, and having those link. That is creating potential hard-to-debug ABI performance issues on interfaces.