RISC-V: Fix implied extensions for xsmtvdotii
Corrects the order of RISC-V extension definitions to ensure proper implication.
The order of extension definitions in bfd/elfxx-riscv.c has been corrected to ensure that implied extensions are processed correctly. The xsmtvdotii extension, which implies xsmtvdot, was listed after xsmtvdot. This commit swaps their order so that xsmtvdotii now correctly implies xsmtvdot and its own dependencies, such as zve32x. A test case has also been added to verify this behavior.
In Details
The riscv_implicit_subsets array in bfd/elfxx-riscv.c defines relationships where one RISC-V extension implies the presence of another. The processing order of this array is critical; an extension must appear before any extensions it implies. Previously, xsmtvdotii was listed after xsmtvdot, causing -march=rv64i_xsmtvdotii to only include xsmtvdot without its necessary prerequisite zve32x. This commit reorders the entries to fix this dependency issue and includes a test to confirm correct implication resolution.
- RISC-V
- An open-standard instruction set architecture (ISA) based on reduced instruction set computing principles.
- Extension
- In RISC-V, an extension is a set of additional instructions that augment the base integer ISA. Common extensions include 'M' (Integer Multiplication and Division), 'A' (Atomic Instructions), and 'F'/'D' (Single/Double-Precision Floating-Point).
- Implication
- In the context of RISC-V extensions, implication means that selecting a particular extension automatically enables another, often more basic, extension required for its functionality.
- xsmtvdot
- A RISC-V extension likely related to vector operations or specific SIMD instructions, possibly involving dot products.
- xsmtvdotii
- An extension that builds upon or extends the functionality of
xsmtvdot, possibly introducing improved performance or additional capabilities.