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: Compressed Disasembly #6500

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 a difference in the disassembly of various instructions in the compressed extension. The c.jr, c.addiw, c.lwsp, c.ldsp, c.lqsp all successfully decode when the rd register is zero, although this encoding is reserved for future use. To prevent this a nzcrd register has been added which excludes the zero register, and these instructions have been changed to use it.

The c.nop instruction encodes hardware hints when the immediate field is non-zero. Section 2.9 of the riscv-spec-20191213 describes hardware hints as ignore-able on hardware that does not support them as they do not change any architecturally visible state, except for advancing the pc. The current behaviour of c.nop excludes these from its encoding which causes them to fail to dissemble. The correct behaviour is to either include the hints into the encoding of the base instruction, or separate them out into a different hint instruction. As they have been included in the base instruction in other places the same has been done for the c.nop instruction.

@GhidorahRex GhidorahRex self-assigned this May 13, 2024
@GhidorahRex GhidorahRex added Type: Bug Something isn't working Feature: Processor/RISC-V Status: Triage Information is being gathered labels May 13, 2024
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 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants