cpubits

Crates.iocpubits
lib.rscpubits
version0.1.0-rc.1
created_at2026-01-18 19:15:09.030829+00
updated_at2026-01-23 18:25:00.157193+00
descriptionCompile-time detection heuristics for the optimal word size to use for the target CPU, which in some cases may differ from its address size a.k.a. `target_pointer_width`. Implemented as `macro_rules!`
homepage
repositoryhttps://github.com/RustCrypto/utils
max_upload_size
id2052907
size28,540
utils (github:rustcrypto:utils)

documentation

https://docs.rs/cpubits

README

RustCrypto: CPU bits selection

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

Compile-time detection heuristics for the optimal word size to use for the target CPU, which in some cases may differ from its address size a.k.a. target_pointer_width.

Implemented as macro_rules!.

Documentation

Example

Below is a basic example of how you can use the cpubits! macro:

cpubits::cpubits! {
    16 => { pub type Word = u16; }
    32 => { pub type Word = u32; }
    64 => { pub type Word = u64; }
}

License

Licensed under either of:

at your option.

Includes portions from the cfg-if crate, which are also dual-licensed Apache 2.0 + MIT. Copyright (c) 2014 Alex Crichton.

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.

Commit count: 1279

cargo fmt