Function safe_arch::bit_lowest_set_mask_u64

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

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

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

  • Formula: (a - 1) ^ a

  • Intrinsic: _blsmsk_u64

  • Assembly: blsmsk r64, r64