rorw
Rotate right word (Register)
- Extension
- Zbb, Zbkb, Zk, Zkn, Zks
- XLEN
- RV64 only
- Assembly (riscv-unified-db)
rorw xd, xs1, xs2- Length
- 32-bit
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0110000 | rs2 | rs1 | 101 | rd | 01110 | 11 | |||||||||||||||||||||||||
Match 0x6000503b, mask 0xfe00707f. Source: rorw rd rs1 rs2 31..25=0x30 14..12=5 6..2=0x0E 1..0=3 in riscv-opcodes/extensions/rv64_zbb.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs2 | 24:20 | rs2 |
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
Performs a rotate right on the least-significant word of xs1 by the amount in least-significant 5 bits of xs2. The resultant word is sign-extended by copying bit 31 to all of the more-significant bits.
Description from riscv-unified-db, reformatted.
Operation
XReg xs1_word = X[xs1][31:0];
XReg shamt = X[xs2][4:0];
XReg unextended_result = (xs1_word >> shamt) | (xs1_word << (32 - shamt));
X[xd] = {{32{unextended_result[31]}}, unextended_result};Pseudocode in riscv-unified-db’s IDL, quoted unchanged.
Specification and related pages
- The RISC-V Instruction Set Manual: src/unpriv/zbb.adoc (Zbb)
- The RISC-V Instruction Set Manual: src/unpriv/zbkb.adoc (Zbkb)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zk)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zkn)
- The RISC-V Instruction Set Manual: src/unpriv/zk.adoc (Zks)
- riscv-unified-db: spec/std/isa/inst/B/rorw.yaml
- Zbb instruction listing
- Zbkb instruction listing
- Zk instruction listing
- Zkn instruction listing
- Zks instruction listing