Why cannot ADDIW with zero replace it?
C.ZEXT.W zero-extends the low 32 bits; ADDIW/C.ADDIW with zero sign-extends bit 31. Low bits 0x80000001 give 0x0000000080000001 and 0xffffffff80000001, respectively.
16-bit zero-extend word (RV64: lower 32 bits)
C.ZEXT.W (Zcb, CU format, RV64 only) zero-extends the low 32 bits of rd'/rs1' to 64 bits, with rd'/rs1' limited to x8-x15. It requires Zba and is equivalent to the 32-bit encoding add.uw rd', rd', zero. ADDIW/C.ADDIW with zero performs 32-bit sign-extension, not zero-extension. It belongs to Zcb and depends on Zca and Zba.
Shows only official compressed fields, conditions, and architectural state; it does not model a pipeline, cache, or timing.
C.ZEXT.W requires Zcb, Zba, and RV64; Zcb depends on Zca.
C.ZEXT.W is the 16-bit encoding form for compressed zero-extend word; its semantics and encodable register restriction are defined by the official Zcb rules.
RV64 Zcb+Zba, old x10=0xffffffff80000001: c.zext.w x10 writes x10=0x0000000080000001.
RV64 Zcb+Zba, old x10=0xffffffff80000001: c.zext.w x10 writes x10=0x0000000080000001.
C.ZEXT.W zero-extends the low 32 bits; ADDIW/C.ADDIW with zero sign-extends bit 31. Low bits 0x80000001 give 0x0000000080000001 and 0xffffffff80000001, respectively.
RV64 only, with one x8-x15 source/destination. Requires Zcb and Zba; Zcb depends on Zca.