clrlwi
Clear Left Immediate - 54 00 00 3E
clrlwi
Instruction Syntax
Mnemonic | Format | Flags |
clrlwi | rA, rS, n | None |
Instruction Encoding
0
1
0
1
0
1
S
S
S
S
S
A
A
A
A
A
n
n
n
n
n
n
1
1
1
1
1
1
Field | Bits | Description |
Primary Opcode | 0-5 | 010101 (0x15) |
rS | 6-10 | Source register |
rA | 11-15 | Destination register |
n | 16-20 | Number of bits to clear (left) |
Operation
rA ← (rS << n) & (0xFFFFFFFF >> n)
CLRLWI shifts the source register left by n bits and clears the leftmost n bits (sets them to zero).
- Shifts the value in rS left by n bits
- Clears the leftmost n bits (sets to zero)
- Stores the result in rA
Note: Used for bitfield extraction and manipulation.
Affected Registers
- rA (Destination register)
Examples
# Clear left 8 bits clrlwi r3, r4, 8 # Extract lower 16 bits clrlwi r5, r6, 16