Crate cpuid_bool[−][src]
Macro for checking CPU capabilities at runtime.
Usage example
if cpuid_bool::cpuid_bool!("sha", "aes") { println!("CPU supports both SHA and AES extensions"); } else { println!("SHA and AES extensions are not supported"); }
Note that if all tested target features are enabled via compiler options
(e.g. by using RUSTFLAGS
), cpuid_bool!
macro immideatly will expand
to true
and will not use CPUID instruction. Such behavior allows
compiler to eliminate fallback code.
After first call macro caches result and returns it in subsequent calls, thus runtime overhead for them is minimal.
Macros
cpuid_bool | Check at runtime if CPU supports sequence of target features. |
Structs
LazyBool | This structure represents a lazily initialized static boolean value. |