Alex Crichton e18fa0baf6
Shuffle around stdsimd::arch::detect bits (#428)
Compile more code on more platforms, tweak imports, try to catch mistakes
sooner.
2018-04-15 10:53:38 -05:00

9 lines
205 B
Rust

//! Bit manipulation utilities.
/// Tests the `bit` of `x`.
#[allow(dead_code)]
pub fn test(x: usize, bit: u32) -> bool {
debug_assert!(bit < 32, "bit index out-of-bounds");
x & (1 << bit) != 0
}