extlwi
Extract and Left Justify Immediate
Extracts a specified number of bits from the source register, left-justifies them, and places them in the target register.
Details
The extlwi instruction extracts 'n' bits starting at position 'b' from the source register RS and left-justifies them in the target register RA. The high-order 32 bits of the target register are preserved or rotated as needed.
Programming Note
The extlwi instruction is useful for extracting a specific bit field from a source register and left-justifying it in the target register. Ensure that the bit positions 'b' and 'n' are correctly specified to avoid data corruption. The operation preserves or rotates the high-order bits of the target register, so be aware of this behavior if you need to maintain specific register contents.
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
Example
Encoding
Operands
-
ra
Target General Purpose Register -
rs
Source General Purpose Register -
n
Number of bits to extract (must be greater than 0) -
b
Starting bit position for extraction