that's how the #[target_feature(enable = "xxx")] attribute works. it is a per-function attribute which affects which features are enabled for the backend during codegen. however, calling such function requires unsafe if the caller does not have the same target features enabled, and will result in UB at runtime if the cpu didn't support the required feature.
note, it is different from a conditional compilation guard, which looks like #[cfg(target_feature = "yyy")]. I explained the difference in this previous post: