RISC-V rejects conflicting Zclsd and Zcf extensions.
RISC-V compiler now rejects code using both Zclsd and Zcf extensions due to encoding conflicts.
The RISC-V compiler now diagnoses conflicts between the Zclsd and Zcf extensions. These extensions share instruction encodings, leading to ambiguity. The check is performed after expanding implied extensions, ensuring that conflicts are caught even when C and F flags imply Zcf on RV32.
In Details
This commit modifies riscv_common.cc to add a conflict check between the Zclsd and Zcf extensions within riscv_subset_list::check_conflict_ext. Both extensions utilize overlapping instruction encodings. The check is deferred until after implied extensions are expanded to catch cases where C and F flags on RV32 implicitly enable Zcf. This prevents ambiguous code generation.
- RISC-V
- An open-standard instruction set architecture (ISA) based on reduced instruction set computer (RISC) principles. It is designed to be simple, modular, and extensible.
- Zclsd
- A custom RISC-V extension that likely deals with compressed load/store instructions or similar functionalities. Its exact definition depends on the specific RISC-V profiles and extensions being used.
- Zcf
- A custom RISC-V extension, potentially related to control flow or conditional operations. Its exact definition depends on the specific RISC-V profiles and extensions being used.
- instruction encoding
- The binary representation of an instruction. Different instructions or different forms of the same instruction are assigned unique encodings.