Does C.LW zero-extend on RV64?
No; like LW, it sign-extends the loaded 32-bit word to XLEN.
Load a 32-bit word, sign-extend it to XLEN, and write rd'. CL format.
Extension condition: RV32C / RV64C; this page describes C extension version 2.0.
C.LW (CL format, with rd' and rs1' limited to x8-x15) loads a 32-bit word from rs1' plus a zero-extended, 4-byte-scaled offset, sign-extends it to XLEN, and writes rd'. It expands to lw rd', offset(rs1'); the offset range is 0 through 124 bytes.
Three learning stages illustrate architectural rules, without modeling processor pipelines or cycles.
RV32C / RV64C; C sets IALIGN=16, so PC is an even byte address. Address arithmetic wraps at XLEN. The example assumes an EEI-permitted memory access; the chosen EEI outcome applies only to misalignment. Natural alignment does not exclude other access exceptions.
c.lw → x8 ← 0xFFFFFFFFFFFFFF80; PC ← 0x0000000000001002
0x4900
Architectural result not committed yet.
C.LW uses CL format: rs1' plus a zero-extended, 4-byte-scaled offset forms the address, and the loaded word is sign-extended to XLEN.
Understand this scenario with real code like «c.lw x8, 0(x10) # RV64C; x10=0x2000; EEI permits mem32[0x2000]=0xFFFFFF80 -> x8=0xFFFFFFFFFFFFFF80».
No; like LW, it sign-extends the loaded 32-bit word to XLEN.