feat: Reject conflicting RISC-V ISA extensions#1526
Merged
Conversation
2b9e253 to
212bfbe
Compare
davidlattimore
approved these changes
Feb 11, 2026
lapla-cogito
commented
Feb 11, 2026
Comment on lines
+826
to
+833
| /// Conflicting pairs of RISC-V ISA extensions. | ||
| const RISCV_CONFLICTING_EXT_PAIRS: &[(&str, &str)] = &[ | ||
| ("f", "zfinx"), | ||
| ("d", "zdinx"), | ||
| ("q", "zqinx"), | ||
| ("zfh", "zhinx"), | ||
| ("zfhmin", "zhinxmin"), | ||
| ]; |
Member
Author
There was a problem hiding this comment.
For record-keeping, let me explain why I'm listing these pairs: Zfinx specifies the following:
Every current and future extension that uses
Fregisters will also have anZFinxversion that is incompatible with the extension.
According to this, enabling any of these pairs simultaneously in the same implementation would violate the intent of the specification.
Member
Author
There was a problem hiding this comment.
Additionally, this list is somewhat excessive. If we were strictly limited to rv64gc, the minimum necessary would be just (f, zfinx) and (d, zdinx). However, rather than properly updating this list in the future, I considered it more meaningful to proactively exclude other pairs here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
part of #916
While base ISA conflicts are already caught by
merge_eflags, there were no checks to detect conflicting combinations of ISA extensions.