Why does C.JR clear target bit 0?
It has jalr x0, 0(rs1) semantics; JALR clears bit 0 after forming its target.
Jump via register: target is rs1 with bit 0 cleared. CR format. rs1!=x0.
Extension condition: RV32C / RV64C; this page describes C extension version 2.0.
C.JR (CR format) jumps with the semantics of jalr x0, 0(rs1): its target comes from rs1 with bit 0 cleared. It is valid only when rs1!=x0 (rs1=x0 is reserved) and saves no return address.
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. Subsequent target instruction-fetch exceptions are outside this model.
c.jr → PC ← 0x00002000; no link register write
0x8082
Architectural result not committed yet.
C.JR uses CR format and has jalr x0, 0(rs1) semantics: it clears target bit 0 and writes no return address.
Understand this scenario with real code like «c.jr ra # ra=x1=0x2001 -> PC=0x2000; no link write».
It has jalr x0, 0(rs1) semantics; JALR clears bit 0 after forming its target.