Function safe_arch::bit_lowest_set_mask_u32

source ยท
pub fn bit_lowest_set_mask_u32(a: u32) -> u32
Available with target feature bmi1 only.
Expand description

Gets the mask of all bits up to and including the lowest set bit in a u32.

If the input is 0, you get u32::MAX

  • Formula: (a - 1) ^ a

  • Intrinsic: _blsmsk_u32

  • Assembly: blsmsk r32, r32