diff --git a/cpufeatures/src/x86.rs b/cpufeatures/src/x86.rs index c973b744..eb1c359e 100644 --- a/cpufeatures/src/x86.rs +++ b/cpufeatures/src/x86.rs @@ -14,11 +14,12 @@ macro_rules! __unless_target_features { ($($tf:tt),+ => $body:expr ) => {{ #[cfg(not(all($(target_feature=$tf,)*)))] { - #[cfg(not(target_env = "sgx"))] + #[cfg(not(any(target_env = "sgx", target_os = "none", target_os = "uefi")))] $body - // CPUID is not available on SGX targets - #[cfg(target_env = "sgx")] + // CPUID is not available on SGX. Freestanding and UEFI targets + // do not support SIMD features with default compilation flags. + #[cfg(any(target_env = "sgx", target_os = "none", target_os = "uefi"))] false }