C.JR
RISC-V C.JR Instruction Details
Instruction ManualC-typeJump via register: pc = rs1. CR format. rs1!=x0.
Instruction Syntax
c.jr rs1
Operand Breakdown
Compressed instructions are 16 bits; registers are often limited to x8–x15.
Immediate fields are narrower. Refer to the full encoding for this compressed instruction.
CCompressed Instruction
Instruction Behavior
C.JR (CR format) jumps to address in rs1. Expands to jalr x0,0(rs1). Valid only when rs1≠x0 (rs1=x0 reserved). Does not save return address.
Common Usage Scenarios
Function Call & Return
Understand this scenario with real code like «c.jr ra # return».
Pre-Use Checklist
Syntax Check
- Confirm the current instruction format is C-type.
- Confirm the operand order matches the example.
Semantic Check
- Ensure the destination register usage is compatible with the calling convention.
- Confirm this is not the lower-level form of a pseudo-instruction expansion.
Pitfalls / Common Confusions
rs1 cannot be x0