Does C.J save a return address?
No; it corresponds to jal x0, offset.
16-bit CJ jump: add a signed even byte offset to PC, without saving a return address.
Extension condition: RV32C / RV64C; this page describes C extension version 2.0.
C.J uses the 16-bit CJ format to jump unconditionally to the current instruction PC plus a sign-extended offset. The byte offset is even, from -2048 through 2046; zero is legal. It corresponds to jal x0, offset 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.j → PC ← 0x00001020; no link register write
0xA005
Architectural result not committed yet.
C.J uses CJ format to update PC unconditionally by a sign-extended offset in 2-byte multiples, without writing a link register.
Understand this scenario with real code like «c.j 128 # PC=0x1000 -> PC=0x1080; no link write».
Understand this scenario with real code like «c.j 128 # PC=0x1000 -> PC=0x1080; no link write».
No; it corresponds to jal x0, offset.