Encoding:

POOL32A

000000

rt

rs

rd

0

SRLV

00010010000

6

5

5

5

1

10

Format:

SRLV rd, rt, rs

microMIPS

Shift Word Right Logical Variable

Purpose:

Shift Word Right Logical Variable

To execute a logical right-shift of a word by a variable number of bits.

Description:

 GPR[rd] = GPR[rt] >> GPR[rs]   (logical)

The contents of the low-order 32-bit word of GPR rt are shifted right, inserting zeros into the emptied bits; the word result is sign-extended and placed in GPR rd. The bit-shift amount is specified by the low-order 5 bits of GPR rs.

Restrictions:

On 64-bit processors, if GPR rt does not contain a sign-extended 32-bit value (bits 63..31 equal), then the result of the operation is UNPREDICTABLE.

Operation:

if NotWordValue(GPR[rt]) then 
   UNPREDICTABLE 
endif
s = GPR[rs]4..0
temp = 0s || GPR[rt]31..s
GPR[rd] = sign_extend(temp)

Exceptions:

None