matrixmultiply/x86/macros.rs
1macro_rules! is_x86_feature_detected_ {
2 ($name:tt) => {{
3 #[cfg(feature="std")]
4 {
5 // For testing purposes, we can make sure only one specific feature
6 // is enabled by setting MMTEST_FEATURE=featurename (all others
7 // disabled). This does not force it to be detected, it must also be.
8 compile_env_matches_or_is_empty!("MMTEST_FEATURE", $name) && is_x86_feature_detected!($name)
9 }
10 #[cfg(not(feature="std"))]
11 {
12 // For testing purposes, we can make sure only one specific feature
13 // is enabled by setting MMTEST_FEATURE=featurename (all others
14 // disabled). This does not force it to be detected, it must also
15 // be. In the `no_std` case, the `is_86_feature_detected` macro is
16 // not available, so we have to fall back to checking whether the
17 // feature is enabled at compile-time.
18 compile_env_matches_or_is_empty!("MMTEST_FEATURE", $name) && cfg!(target_feature=$name)
19 }
20 }};
21}