[][src]Function safe_arch::bit_extract2_u32

#[must_use]pub fn bit_extract2_u32(a: u32, control: u32) -> u32
This is supported with target feature bmi1 only.

Extract a span of bits from the u32, control value style.

  • Bits 0 through 7: start position.
  • Bits 8 through 15: span length.
assert_eq!(bit_extract2_u32(0b0110, (3 << 8) | 0), 0b110);
assert_eq!(bit_extract2_u32(0b0110, (2 << 8) | 0), 0b10);
assert_eq!(bit_extract2_u32(0b0110, (2 << 8) | 1), 0b11);