i386: Vectorize _Float16 conversions with F16C and AVX512F
Enables vectorization for _Float16 to float conversions on x86, improving performance for targets with F16C or AVX512F.
This commit enhances the vectorizer on x86-64 to efficiently convert between _Float16 and float vectors, even when AVX512FP16 is not fully supported. It achieves this by enabling existing pack and unpack expanders for various vector modes using F16C and AVX512VL instructions. New specific expanders and adjustments to existing ones ensure that conversions, including different lane counts, are vectorized using the most appropriate instructions available, preventing scalar fallback and improving performance.
In Details
The vectorizer's vec_pack_trunc and vec_unpacks_{lo,hi} optabs were previously limited to TARGET_AVX512FP16. This commit extends their use to targets with F16C and AVX512VL, enabling vectorization of _Float16 <-> float conversions. It introduces f16c_truncv4sfv8hf2 for V4SFmode and V8HFmode conversions, leveraging AVX512FP16 instructions when available and vcvtps2ph/vcvtph2ps otherwise. The 256- and 512-bit modes reuse existing trunc/extend expanders, while 128-bit modes are updated to use the new expander or extendv4hfv4sf2.
- _Float16
- A half-precision floating-point type (16 bits) that provides a smaller memory footprint and potentially faster computations than single-precision floats.
- F16C
- An x86 instruction set extension that provides hardware support for conversions between 16-bit and 32-bit floating-point formats.
- AVX512F
- Advanced Vector Extensions 512-bit Fused Multiply-Add, a set of instructions for 512-bit SIMD operations, including floating-point arithmetic.
- AVX512VL
- An extension to AVX-512 that allows AVX-512 instructions to operate on 128-bit and 256-bit registers, in addition to 512-bit registers.
- AVX512FP16
- An extension to AVX-512 that adds support for 16-bit floating-point operations.
- vectorizer
- A compiler component that transforms scalar code into equivalent vector code, utilizing SIMD instructions to perform operations on multiple data elements simultaneously.
- optab
- A table within GCC that maps generic operations (like addition, bitwise OR) to target-specific instruction sequences or patterns.