SPECIAL 000000 |
rs |
rt |
rd |
0 00000 |
SRAV 000111 |
6 |
5 |
5 |
5 |
5 |
6 |
SRAV rd, rt, rs |
MIPS32 |
Shift Word Right Arithmetic Variable |
Shift Word Right Arithmetic Variable
To execute an arithmetic right-shift of a word by a variable number of bits.
GPR[rd] = GPR[rt] >> GPR[rs] (arithmetic)
The contents of the low-order 32-bit word of GPR rt are shifted right, duplicating the sign-bit (bit 31) in 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.
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 s = GPR[rs]4..0 temp = (GPR[rt]31)s || GPR[rt]31..s GPR[rd] = sign_extend(temp)
None