POOL16B 001001 |
rd |
rt |
encoded sa |
1 |
6 |
3 |
3 |
3 |
1 |
SRL16 rd, rt, decoded_sa |
microMIPS |
Shift Word Right Logical (16-bit instr size) |
Shift Word Right Logical (16-bit instr size)
To execute a logical right-shift of a word by a fixed number of bits
GPR[rd] = GPR[rt] >> decoded_sa (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 . by decoding the encoded_sa field.
Table 5.16 lists the encoded values of the encoded_sa field and the actual bit shift amount values.
Table 5.16 Shift Amount Field Encoding
Encoded Input (Hex) |
Decoded Value (Decimal) |
0 |
8 |
1 |
1 |
2 |
2 |
3 |
3 |
4 |
4 |
5 |
5 |
6 |
6 |
7 |
7 |
The 3-bit register fields can only specify GPRs $2-$7, $16, $17.
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.
if NotWordValue(GPR[rt]) then UNPREDICTABLE endif decoded_sa = DECODE(encoded_sa) s = decoded_sa temp = 0s || GPR[rt]31..s GPR[rd] = sign_extend(temp)
None