1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![cfg_attr(RUSTC_IS_NIGHTLY, feature(cfg_target_feature))]
#![cfg_attr(RUSTC_IS_NIGHTLY, feature(platform_intrinsics))]
#![cfg_attr(RUSTC_IS_NIGHTLY, feature(i128_type))]

//! `bitintr` offers portable bit manipulation intrinsics.
//!
//! The intrinsics are named after their CPU instruction and organized in
//! modules named after their architecture/instruction set:
//! `bitintr::{arch}::{instruction_set}::{instruction_name}`.
//!
//! They are implemented for all integer types _except_ `u128/i128`. Whether a
//! fallback software implementation is used depends on the integer types
//! involved and the instruction sets supported by the target.
//!
//! ## Example
//!
//! ```rust
//! extern crate bitintr;
//! use bitintr::x86::bmi2::*;
//!
//! fn main() {
//!    // Intrinsics are provided as trait methods:
//!    let method_call = 1.pdep(0);
//!    // And as free functions:
//!    let free_call = pdep(1, 0);
//!    assert_eq!(method_call, free_call);
//! }
//! ```

mod int;
pub use int::Int;

mod alg;
pub mod x86;
pub mod arm;