Does ROL access memory?
No. It only reads and writes integer registers; any memory access must be performed by a separate load or store instruction.
Rotate left by register
ROL uses opcode 0110011 (0x33), funct3 001, funct7 0110000. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.
Rotates rs1 left by the lower log2(XLEN) bits of rs2. Part of Zbb and Zbkb. Replaces neg/sll/srl/or four-instruction sequence.
ROL is a B/Zbb instruction for XLEN-wide rotate left. This page is checked against the official B extension semantics, with emphasis on XLEN, W suffixes, .uw suffixes, and bitwise or rotate boundaries.
Understand this scenario with real code like «rol x10, x11, x12 ; x10 = rotl(x11, x12 & (XLEN-1))».
Understand this scenario with real code like «rol x10, x11, x12 ; x10 = rotl(x11, x12 & (XLEN-1))».
No. It only reads and writes integer registers; any memory access must be performed by a separate load or store instruction.
Except that W-suffixed forms produce a 32-bit result then sign-extend and .uw forms first extract a 32-bit unsigned operand, the result is written to rd at XLEN width.