clrlwi
Clear Left Immediate - 54 00 00 3E
clrlwi

Instruction Syntax

MnemonicFormatFlags
clrlwirA, rS, nNone

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
FieldBitsDescription
Primary Opcode0-5010101 (0x15)
rS6-10Source register
rA11-15Destination register
n16-20Number 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).

  1. Shifts the value in rS left by n bits
  2. Clears the leftmost n bits (sets to zero)
  3. Stores the result in rA

Note: Used for bitfield extraction and manipulation.

Affected Registers

Examples

# Clear left 8 bits
clrlwi r3, r4, 8

# Extract lower 16 bits
clrlwi r5, r6, 16

Related Instructions

clrrwi, rlwinm, slwi, srwi

Back to Index