Encoding:

P32A

001000

rt

rs

sa

1

100

001

111

111

6

5

5

4

1

3

3

3

3

Format:

SHRL.QB rt, rs, sa

DSP

Shift Right Logical Vector Quad Bytes

Purpose:

Shift Right Logical Vector Quad Bytes

Element-wise logical right shift of four independent bytes in a vector data type by a fixed number of bits.

Description:

rt = rs31..24 >> sa) || (rs23..16 >> sa) || (rs15..8 >> sa) || (rs7..0 >> sa)

The four byte values in register rs are each independently shifted right by sa bits and the sa most-significant bits of each value are set to zero. The four independent results are then written to the corresponding byte elements of destination register rt.

Restrictions:

No data-dependent exceptions are possible.

The operands must be values in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.

Operation:

ValidateAccessToDSPResources()
tempD7..0 = shift8Right( GPR[rs]31..24, sa )
tempC7..0 = shift8Right( GPR[rs]23..16, sa )
tempB7..0 = shift8Right( GPR[rs]15..8, sa )
tempA7..0 = shift8Right( GPR[rs]7..0, sa )
GPR[rt]31..0 = tempD7..0 || tempC7..0 || tempB7..0 || tempA7..0
function shift8Right( a7..0, s2..0 )
   if ( s2..0 = 0 ) then
      temp7..0 = a7..0
   else
      temp7..0 = ( 0s || a7..s )
   endif
   return temp7..0
endfunction shift8Right

Exceptions:

Reserved Instruction, DSP Disabled

Programming Notes:

To do a logical left shift of a word in a register without saturation, use the MIPS32 SLL instruction.