There are a set of instructions for manipulating bits within a register. This figure shows some examples:
BFI instruction inserts a bit field into a register. In the preceding figure,
BFI is taking a 6-bit field from the source register (
W0) and inserting it at bit position 9 in the destination register.
UBFX extracts a bit field. In the preceding figure,
UBFX is taking a 7-bit field from bit position 18 in the source register, and placing it in the destination register.
Other instructions can reverse byte or bit order, as you can see in this figure:
RBIT are particularly useful when you are handling data that is in a different endianness.