Skip to content

riscv: apply JALR bit-zero semantics to C.JR and C.JALR - #271

Merged
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/cjr-cjalr-bit0
Aug 12, 2026
Merged

riscv: apply JALR bit-zero semantics to C.JR and C.JALR#271
LekKit merged 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/cjr-cjalr-bit0

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

riscv: apply JALR bit-zero semantics to C.JR and C.JALR

Fixes #267

Commit message

riscv: apply JALR bit-zero semantics to C.JR and C.JALR

Description

C.JR and C.JALR expand to JALR, but the compressed path writes the raw odd target to PC. Mask bit 0 before the transfer in both compressed paths; the link register behavior remains unchanged.

Validation

  • Native RV64 hardware and QEMU execute the odd-target controls at the aligned address.
  • Interpreter and JIT paths are both validated against the references.
  • The proposed change is limited to the compressed RISC-V decode path.

@LekKit
LekKit merged commit 6edcfda into LekKit:staging Aug 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RVVM traps on odd C.JR/C.JALR targets instead of clearing bit 0

2 participants