#arch #x86 #detection #features #cpuid #detect

no-std core_detect

A no_std version of the std::is_x86_feature_detected! macro

2 releases (1 stable)

1.0.0 May 9, 2021
0.1.0 Sep 21, 2020

#552 in Hardware support

Download history 404/week @ 2024-07-21 430/week @ 2024-07-28 144/week @ 2024-08-04 228/week @ 2024-08-11 146/week @ 2024-08-18 148/week @ 2024-08-25 258/week @ 2024-09-01 321/week @ 2024-09-08 219/week @ 2024-09-15 325/week @ 2024-09-22 135/week @ 2024-09-29 372/week @ 2024-10-06 561/week @ 2024-10-13 435/week @ 2024-10-20 371/week @ 2024-10-27 286/week @ 2024-11-03

1,726 downloads per month
Used in 43 crates

MIT/Apache

37KB
408 lines

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.

No runtime deps