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.
Uses the same rhythm as the ADDI page: machine-code fields, fixed-field identification, operand reads, instruction-specific execution, and ISA-visible state update.
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.
Understand this scenario with real code like «sll x5, x6, x7 # x5 = x6 << (x7[4:0] on RV32, x7[5:0] on RV64)».
Understand this scenario with real code like «sll x5, x6, x7 # x5 = x6 << (x7[4:0] on RV32, x7[5:0] on RV64)».
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.