rorw

Rotate right word (Register)

This instruction is defined by:

Encoding

svg

Synopsis

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.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> xs2 = $encoding[24:20];
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

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};
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};