Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISCV: clear lsb in compressed jump instructions #6483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sleigh-InSPECtor
Copy link
Contributor

As part of a research project testing the accuracy of the sleigh specifications compared to real hardware, we observed an unexpected behaviour in the c.jalr, c.jr, and ret instructions for RISCV. According to section 16.4 of the 20191213 unprivileged specification, these instructions expand to the jalr instruction. In section 2.5 it says that when calculating the address for jalr the least significant bit is cleared. While the current behaviour leaves this bit as is. Current behaviour for the c.jalr instruction also jumps to the inst_next address instead of the registers value when the ra register is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Processor/RISC-V Status: Triage Information is being gathered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants