Why is an unsigned REMUW remainder still sign-extended?
Unsignedness determines how the low 32-bit remainder is calculated; as a W instruction, REMUW then sign-extends that 32-bit result to 64 bits.
Unsigned remainder of 32-bit division, sign-extended to 64 bits
REMUW is an RV64 M-extension unsigned remainder instruction. It uses the low 32 bits of both rs1 and rs2 and always sign-extends the 32-bit remainder to 64 bits. A zero divisor returns the low 32-bit dividend, sign-extended to 64 bits. Unsigned division cannot overflow.
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.
This selector chooses specification-defined division-result branches. Division presets set the displayed t1/t2 initial values; editing a source register restores normal mode. It is not a trap or performance model.
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.
REMUW is RV64-only: it takes an unsigned remainder from the low 32 bits of both sources, then sign-extends that 32-bit value from bit 31 to 64 bits in rd.
RV64 plus M, x6=20 and x7=7: remuw x5, x6, x7 gives x5=6; the low 32-bit sources are unsigned, but the remainder is still sign-extended to 64 bits.
Unsignedness determines how the low 32-bit remainder is calculated; as a W instruction, REMUW then sign-extends that 32-bit result to 64 bits.