Skip to content

feat: Reject conflicting RISC-V ISA extensions#1526

Merged
lapla-cogito merged 1 commit into
wild-linker:mainfrom
lapla-cogito:riscv_attr_merge
Feb 11, 2026
Merged

feat: Reject conflicting RISC-V ISA extensions#1526
lapla-cogito merged 1 commit into
wild-linker:mainfrom
lapla-cogito:riscv_attr_merge

Conversation

@lapla-cogito

Copy link
Copy Markdown
Member

part of #916

While base ISA conflicts are already caught by merge_eflags, there were no checks to detect conflicting combinations of ISA extensions.

@lapla-cogito lapla-cogito changed the title feat: Reject conflicting RISC-V ISA extensions during attribute merging feat: Reject conflicting RISC-V ISA extensions Feb 11, 2026
Comment thread libwild/src/layout.rs
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"),
];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For record-keeping, let me explain why I'm listing these pairs: Zfinx specifies the following:

Every current and future extension that uses F registers will also have an ZFinx version 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lapla-cogito lapla-cogito merged commit 326bb2a into wild-linker:main Feb 11, 2026
20 checks passed
@lapla-cogito lapla-cogito deleted the riscv_attr_merge branch February 11, 2026 07:55
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.

2 participants