i386: Enable _Float16 to _Float32 conversions on more hardware
GCC now supports _Float16 to _Float32 conversions on F16C, AVX512F, and AVX512VL instruction sets.
GCC has enabled vector conversions between _Float16 and _Float32 types for the F16C, AVX512F, and AVX512VL instruction sets. Previously, these conversions were only supported when the AVX512FP16 extension was also present. This change expands the hardware capabilities for handling these floating-point types, improving performance for applications utilizing them.
In Details
The i386 backend now supports extendvNhfvNsf2 and truncvNsfvNhf2 operations for vector sizes of 4, 8, and 16 elements, even when only F16C, AVX512F, or AVX512VL extensions are available, without requiring AVX512FP16. This was achieved by modifying mode iterators and expanders to handle different RTL representations (UNSPECs/V?HI mode vs. float_extend/truncate/V?HF mode) based on the available instruction set extensions.
- _Float16
- A half-precision floating-point type, typically using 16 bits, offering a smaller memory footprint and potentially faster operations than single-precision types at the cost of reduced range and precision.
- _Float32
- A single-precision floating-point type, typically using 32 bits, offering a balance between range, precision, and performance. This is the standard 'float' type in many programming languages.
- F16C
- An x86 instruction set extension that provides hardware support for converting between 16-bit and 32-bit floating-point formats.
- AVX512F
- An extension to the AVX instruction set that introduces 512-bit vector registers and new instructions, including floating-point operations.
- AVX512VL
- An extension to AVX-512 that allows AVX-512 instructions to operate on 128-bit and 256-bit vectors, in addition to 512-bit vectors. This improves flexibility and performance on systems with narrower vector processing capabilities.
- AVX512FP16
- An AVX-512 extension specifically designed to accelerate operations on 16-bit floating-point numbers (_Float16).
- RTL
- Register Transfer Language, an intermediate representation used within GCC to describe operations and data flow before code generation.
- UNSPEC
- An RTL construct used in GCC to represent operations that do not have a direct machine instruction mapping, often used for complex or target-specific operations.