Why does c.addw have register restrictions?
Many C formats encode registers with shorter fields, so some forms can access only x8..x15 or fixed registers.
32-bit add with sign-extend to 64. CA format, RV64C.
rd′ selects x8–x15 and is both the old source and the writeback destination; read the old value before writing.
rs2′ also selects x8–x15; equal source names have one old value.
RV64C: retain the low 32-bit sum, then sign-extend to 64 bits; this is not a full 64-bit sum.
A 16-bit RV64C CA instruction: add x[rd'] and x[rs2'], sign-extend the low 32-bit sum to 64 bits, and write rd'. Both registers are x8–x15.
Shows only manual-defined 16-bit fields, operands, and ISA-visible results; it does not model a pipeline, cache, timing, or an implementation's memory-fault handling.
Scope: RV64C, 16-bit CA encoding.
rd'=000 -> x8; rs2'=001 -> x9
A 16-bit RV64C CA instruction: add x[rd'] and x[rs2'], sign-extend the low 32-bit sum to 64 bits, and write rd'. Both registers are x8–x15.
RV64C, old x8=0x7fffffff and x9=1: c.addw x8, x9 produces low sum 0x80000000 and writes x8=0xffffffff80000000.
Many C formats encode registers with shorter fields, so some forms can access only x8..x15 or fixed registers.
No. It is a 16-bit encoded instruction defined by the C extension.