Trait bitintr::Rbit [] [src]

pub trait Rbit {
    fn rbit(self) -> Self;
}

Bit reverse

Required Methods

Reverse the bit order.

Instructions

  • RBIT:
    • Description: Reverse Bits reverses the bit order in a register.
    • Architecture: ARMv7, ARMv8.
    • Registers: 32 (v7) / 64 (v8) bits.

Example

assert_eq!(0b0011_0001_u8.rbit(), 0b1000_1100_u8);
assert_eq!(0b0000_0000_0100_1011_u16.rbit(), 0b1101_0010_0000_0000_u16);
assert_eq!(
    0b11111111_u32.rbit(),
    0b11111111_00000000_00000000_00000000_u32
);

Implementors