roriw

Rotate right immediate word (32-bit) RV64 only

Rotates the low 32 bits of t2 right by an immediate amount and sign-extends the result into t1 (RV64 only).

RISC-V manual: roriw

Forms

  • roriw , ,

Operands

t1
Any integer register, x0 to x31, or its named alias, such as zero, t0 or t6.
t2
An integer register. It may be the same register as t1.
imm5
An unsigned 5-bit immediate, 0 to 31, used for values such as a shift count or a CSR immediate.

This example runs on RV64.

.text
li t0, 13
# t0=13, immediate 2; roriw writes 1073741827 to t2.
roriw t2, t0, 2