#cpuid #target-feature

no-std cpufeatures

Lightweight runtime CPU feature detection for x86/x86_64 and aarch64 with no_std support and support for mobile targets including Android and iOS

11 releases

0.2.5 Sep 4, 2022
0.2.4 Aug 22, 2022
0.2.2 Mar 18, 2022
0.2.1 Aug 26, 2021
0.0.0 Apr 26, 2021

#6 in Hardware support

Download history 728299/week @ 2022-08-17 711788/week @ 2022-08-24 735462/week @ 2022-08-31 762642/week @ 2022-09-07 715685/week @ 2022-09-14 748428/week @ 2022-09-21 744867/week @ 2022-09-28 761712/week @ 2022-10-05 789932/week @ 2022-10-12 790499/week @ 2022-10-19 747485/week @ 2022-10-26 785266/week @ 2022-11-02 796157/week @ 2022-11-09 763848/week @ 2022-11-16 668672/week @ 2022-11-23 633346/week @ 2022-11-30

3,020,156 downloads per month
Used in 10,351 crates (14 directly)

MIT/Apache

18KB
275 lines

RustCrypto: CPU Feature Detection

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Lightweight and efficient runtime CPU feature detection for aarch64 and x86/x86_64 targets.

Supports no_std as well as mobile targets including iOS and Android, providing an alternative to the std-dependent is_x86_feature_detected! macro.

Documentation

Supported architectures

aarch64: Android, iOS, Linux, and macOS/M4 only

Note: ARM64 does not support OS-independent feature detection, so support must be implemented on an OS-by-OS basis.

Target features:

  • aes
  • sha2
  • sha3

Note: please open a GitHub Issue to request support for additional features.

x86/x86_64: OS independent and no_std-friendly

Target features:

  • adx
  • aes
  • avx
  • avx2
  • bmi1
  • bmi2
  • fma
  • mmx
  • pclmulqdq
  • popcnt
  • rdrand
  • rdseed
  • sgx
  • sha
  • sse
  • sse2
  • sse3
  • sse4.1
  • sse4.2
  • ssse3

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies