What immediate range does C.ADDI encode?
The CI format combines imm[5] and imm[4:0] into a signed 6-bit immediate, so it represents -32 through 31; regular C.ADDI does not use zero.
Regular C.ADDI adds a nonzero sign-extended 6-bit immediate to a nonzero rd: rd += imm. CI format.
Extension condition: C (or Zca) on RV32I/RV64I; 16-bit encoding, IALIGN=16. The animation assumes successful instruction fetch and no asynchronous interrupt.
Regular C.ADDI uses the CI format to add a nonzero sign-extended 6-bit immediate to a nonzero rd and write rd; it expands to addi rd, rd, imm. Encodings with nonzero rd and imm=0 are HINTs. rd=x0 with imm=0 is C.NOP; C.NOP encodings with nonzero imm are also HINTs.
RV32I/RV64I + C (or Zca), 16-bit encoding, IALIGN=16.
c.addi rd, imm0x156D = 0001010101101101Restore full register fields and the immediate, distinguishing ordinary instructions, HINTs, and shared encodings.
These are teaching steps for architectural effects, not processor pipeline stages or cycles.
C.ADDI is a 16-bit CI encoding for adding a signed 6-bit immediate to rd itself; the regular instruction form excludes rd=x0 and imm=0.
RV32I/RV64I + C/Zca, old x10=12: c.addi x10, -5 yields x10=7 after immediate sign extension and advances PC by 2.
RV32I/RV64I + C/Zca, old x10=12: c.addi x10, -5 yields x10=7 after immediate sign extension and advances PC by 2.
The CI format combines imm[5] and imm[4:0] into a signed 6-bit immediate, so it represents -32 through 31; regular C.ADDI does not use zero.