Is the result zero-extended?
No. Bit 31 of the low 32-bit result is copied to bits 63..32: 0x80000000 becomes 0xffffffff80000000.
Add a sign-extended 12-bit immediate to rs1, then sign-extend the low 32-bit result to 64 bits in rd.
ADDIW (I-type, opcode=0011011, funct3=000) adds the sign-extended 12-bit immediate to rs1, ignores overflow, and writes the sign-extended low 32-bit result to rd. With an immediate of 0 it is the SEXT.W pseudoinstruction. Exists only in RV64I.
RV64I; XLEN=64; 32-bit result → sign extension
addiw rd, rs1, immAssume successful instruction fetch, no asynchronous interrupt or extra extension checks; one initial value per register.
0xFFF5851BDecode the current instruction fields and read sources before writeback; no result has been committed.
These are teaching steps for architectural effects, not processor pipeline stages or cycles.
Add a sign-extended 12-bit immediate to rs1, then sign-extend the low 32-bit result to 64 bits in rd.
RV64I, x11=0x7fffffff: addiw x10, x11, 1 yields 0xffffffff80000000; this is not 64-bit addition.
RV64I, x11=0x7fffffff: addiw x10, x11, 1 yields 0xffffffff80000000; this is not 64-bit addition.
No. Bit 31 of the low 32-bit result is copied to bits 63..32: 0x80000000 becomes 0xffffffff80000000.
It sign-extends the low 32 bits of rs1 to 64 bits, equivalent to sext.w rd, rs1. It does not preserve arbitrary upper 32 bits of rs1.