s390: Support half-float vector constants in constant pool
s390 vector constants with half-float elements can now be loaded from the constant pool.
Support for half-float elements within vector constants has been added for the s390 architecture. This change registers the necessary modes (V{1,2,4,8}HFmode) for constant vectors loaded from the constant pool, enabling their correct handling. A new test case (vec-const-hf-1.c) has been added to verify this functionality.
In Details
This commit extends the s390 backend to properly handle vector constants containing half-precision floating-point elements (HFmode) when loaded from the constant pool. Previously, these modes were not registered, preventing their correct use. By adding V{1,2,4,8}HFmode to constant_modes in config/s390/s390.cc, GCC can now generate code that loads these vector constants from the constant pool, which is essential for efficient execution of code using these types. A new test case gcc.target/s390/vector/vec-const-hf-1.c is included for verification.
- half-float
- A floating-point number format that uses 16 bits to store its value, offering less precision and range than single-precision (32-bit) or double-precision (64-bit) formats.
- vector constant
- A constant value that is stored as a vector, meaning it contains multiple data elements (e.g., integers or floating-point numbers) that can be processed in parallel by SIMD instructions.
- constant pool
- A section within an object file or executable that stores constant values used by the program. This allows the compiler to efficiently reference these constants without embedding them directly in the code stream.
- s390
- A family of mainframe computer architectures developed by IBM.
- mode
- In GCC, a 'mode' represents a machine data type, such as integer types of different sizes or floating-point types. Vector types also have specific modes.