Why is the SLL shift amount not all of rs2?
The base integer semantics define register shifts to use only the low log2(XLEN) bits of rs2, so RV32 uses 5 bits and RV64 uses 6 bits.
Shift rs1 left logically by the low log2(XLEN) bits of rs2, result in rd
SLL is an R-type logical left shift. It shifts rs1 left by the amount in the low log2(XLEN) bits of rs2: rs2[4:0] on RV32 and rs2[5:0] on RV64. High bits shifted out are discarded, low bits are filled with zero, and the XLEN-truncated result is written to rd. opcode=0110011, funct3=001, funct7=0000000.
Starts with machine-code field decoding, then shows operand reads, instruction-specific execution, and ISA-visible state update.
This example uses fixed initial register values and PC=0x2000; instruction fetch succeeds, with no asynchronous interrupt or extra extension checks. Exception branches stop ordinary commit; post-trap PC and handler state are EEI-dependent.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
SLL takes a variable shift amount from the low log2(XLEN) bits of rs2, logically shifts rs1 left, fills low bits with zero, discards overflowed high bits, and writes rd.
RV32I/RV64I, x6=20 and x7=2: sll x5, x6, x7 gives x5=80 (0x50), retaining only low XLEN bits.
The base integer semantics define register shifts to use only the low log2(XLEN) bits of rs2, so RV32 uses 5 bits and RV64 uses 6 bits.
Use SLL when the shift amount is a run-time register value. Use SLLI when the amount is an encodable constant.