gecko-dev/third_party/rust/raw-cpuid
shravanrn@gmail.com 4fbd7a0f7c Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D61077

--HG--
extra : moz-landing-system : lando
2020-02-12 04:11:49 +00:00
..
ci Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
examples Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
src Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
.cargo-checksum.json Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
AUTHORS Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
Cargo.lock Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
Cargo.toml Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
LICENSE.md Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
README.md Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00
build.rs Bug 1610991 - Update rlbox_lucet lib to Mac compatible version r=froydnj 2020-02-12 04:11:49 +00:00

README.md

cpuid Build Status Crates.io

A library to parse the x86 CPUID instruction, written in rust with no external dependencies. The implementation closely resembles the Intel CPUID manual description. The library does only depend on libcore.

The code should be in sync with the latest March 2018 revision of the Intel Architectures Software Developers Manual.

Library usage

let cpuid = CpuId::new();

match cpuid.get_vendor_info() {
    Some(vf) => assert!(vf.as_string() == "GenuineIntel"),
    None => ()
}

let has_sse = match cpuid.get_feature_info() {
    Some(finfo) => finfo.has_sse(),
    None => false
};

if has_sse {
    println!("CPU supports SSE!");
}

match cpuid.get_cache_parameters() {
    Some(cparams) => {
        for cache in cparams {
            let size = cache.associativity() * cache.physical_line_partitions() * cache.coherency_line_size() * cache.sets();
            println!("L{}-Cache size is {}", cache.level(), size);
        }
    },
    None => println!("No cache parameter information available"),
}

Documentation