rolw
Rotate left word (Register)
This instruction is defined by:
Synopsis
Performs a rotate left of the least-significant word of xs1 by the amount in least-significant 5 bits of xs2. The resulting word value is sign-extended by copying bit 31 to all of the more-significant bits.
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
if (implemented?(ExtensionName::B) && (misa.B == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
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};
if (implemented?(ExtensionName::B) && (misa.B == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
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};