Why can a logical left shift produce all ones in the upper 32 bits?
The shift fills low bits with zero within 32 bits; the W form then sign-extends result bit 31 to 64 bits. When bit 31 is 1, the upper 32 bits are all ones.
Shift 32-bit value in rs1 left logically by immediate, sign-extend 32-bit result to 64 bits
SLLIW is an I-type instruction with opcode=0011011, funct3=001, and imm[11:5]=0000000. It logically shifts the low 32 bits of rs1 by imm[4:0], fills low bits with zero, and sign-extends the 32-bit result to 64 bits in rd. Encodings with imm[5] equal to 1 are reserved.
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.
Shift 32-bit value in rs1 left logically by immediate, sign-extend 32-bit result to 64 bits
RV64I, x11=0x40000000: slliw x10, x11, 1 gives 0xffffffff80000000; shifted bit 31 is 1, so the upper 32 bits are all ones.
The shift fills low bits with zero within 32 bits; the W form then sign-extends result bit 31 to 64 bits. When bit 31 is 1, the upper 32 bits are all ones.