core_detect 1.0.0

A `no_std` version of the `std::is_x86_feature_detected!` macro.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 59.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • thomcc/core_detect
    4 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • thomcc

core_detect

Build Status Docs Latest Version Minimum Rust Version

This crate provides a no_std version of the std::is_x86_feature_detected! macro.

This is possible because x86 chips can just use the cpuid instruction to detect CPU features, whereas most other architectures require either reading files or querying the OS.

Usage

Add core_detect = "1" to the [dependencies] section of your Cargo.toml.

if core_detect::is_x86_feature_detected!("ssse3") {
    println!("SSSE3 is available");
}

License / Copyright

Much of this code is taken from the stdarch repository (for easy upgrading / maximal compatibility), and thus it uses the same copyright as Rust — MIT/Apache-2.0 dual license.