clrrwi
Clear Right Immediate - 54 00 00 3C
clrrwi

Instruction Syntax

MnemonicFormatFlags
clrrwirA, 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 (right)

Operation

rA ← (rS >> n) & (0xFFFFFFFF << n)

CLRRWI shifts the source register right by n bits and clears the rightmost n bits (sets them to zero).

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

Note: Used for bitfield extraction and manipulation.

Affected Registers

Examples

# Clear right 8 bits
clrrwi r3, r4, 8

# Extract upper 16 bits
clrrwi r5, r6, 16

Related Instructions

clrlwi, rlwinm, slwi, srwi

Back to Index