c.j
Jump
This instruction is defined by:
Synopsis
C.J performs an unconditional control transfer. The offset is sign-extended and added to the pc to form the jump target address. C.J can therefore target a ±2 KiB range.
It expands to jal x0, offset
.
Decode Variables
signed Bits<12> imm = sext({$encoding[12], $encoding[8], $encoding[10:9], $encoding[6], $encoding[7], $encoding[2], $encoding[11], $encoding[5:3], 1'd0});
Execution
-
Pruned, XLEN == 64
-
Original
jump($pc + imm);
if (implemented?(ExtensionName::C) && (CSR[misa].C == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
jump($pc + imm);