Architecture

Table 3-6. Shift instructions

(a) SLL, SRL, SRA

Instruction

Format and Description

 

 

 

 

 

 

 

 

 

op

 

0

 

rt

rd

sa

funct

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Shift Left

SLL rd, rt, sa

 

 

 

 

 

 

 

 

 

Logical

Left-shift the contents of register rt by the number of bits indicated in sa (shift

 

amount), and zero-fill the low-order bits. Store the resulting 32 bits in register

 

rd.

 

 

 

 

 

 

 

 

 

Shift Right

SRL rd, rt, sa

 

 

 

 

 

 

 

 

 

Logical

Right-shift the contents of register rt by sa bits, and zero-fill the high-order bits.

 

Store the resulting 32 bits in register rd.

 

 

 

 

 

Shift Right

SRA rd, rt, sa

 

 

 

 

 

 

 

 

 

Arithmetic

Right-shift the contents of register rt by sa bits, and sign-extend the high-order

 

bits. Store the resulting 32 bits in register rd.

 

 

 

 

 

(b) SLLV, SRLV, SRAV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction

Format and Description

 

 

 

 

 

 

 

 

 

op

 

rs

 

rt

rd

0

funct

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Shift Left

SLLV rd, rt, sa

 

 

 

 

 

 

 

 

 

Logical

Left-shift the contents of register rt.

The number of bits shifted is indicated in

Variable

the 5 low-order bits of the register rs contents. Zero-fill the low-order bits of rt

 

and store the resulting 32 bits in register rd.

 

 

 

 

 

Shift Right

SRLV rd, rt, sa

 

 

 

 

 

 

 

 

 

Logical

Right-shift the contents of register rt.

The number of bits shifted is indicated in

Variable

the 5 low-order bits of the register rs contents. Zero-fill the high-order bits of rt

 

and store the resulting 32 bits in register rd.

 

 

 

 

 

Shift Right

SRAV rd, rt, sa

 

 

 

 

 

 

 

 

 

Arithmetic

Right-shift the contents of register rt.

The number of bits shifted is indicated in

Variable

the 5 low-order bits of the register rs contents. Sign-extend the high-order bits

 

of rt and store the resulting 32 bits in register rd.

 

 

 

 

29

Page 38
Image 38
Toshiba TX39 user manual SLLV, SRLV, Srav Instruction Format and Description