arc: Don't advertise optab for unsupported vector modes [PR126243]
Prevents compiler ICEs by restricting vector operation advertising to supported modes.
This commit corrects the advertisement of vector operation optabs for the ARC architecture. Previously, operations like multiply and divide were advertised for V2SImode even when not supported by TARGET_PLUS_QMACW. This led to middle-end ICEs when operands degraded to DImode. The change restricts these optabs to be advertised only when TARGET_PLUS_QMACW is enabled, ensuring that vector modes are correctly supported.
In Details
Restricts advertisement of v2si mul/div/smin/smax optabs to when TARGET_PLUS_QMACW is enabled. Previously, these were advertised if the scalar equivalent existed, leading to ICEs when the middle-end vectorized and operands degraded to DImode on unsupported hardware. This aligns optab availability with actual hardware support, preventing compiler crashes.
- optab
- A table of operations supported by the compiler, mapping operations to their corresponding machine instructions or expansion routines.
- V2SImode
- A GCC internal mode representing a vector of two single-precision floating-point or integer elements.
- TARGET_PLUS_QMACW
- A GCC target machine specific macro indicating support for the ARC 'plus QMACW' instruction set extension, which includes specific vector processing capabilities.
- ICE
- Internal Compiler Error. A condition where the compiler encounters an unrecoverable error during its own processing, usually indicating a bug in the compiler itself.
- DImode
- A GCC internal mode representing a double-precision floating-point or a 64-bit integer.