libstdc++: Add std::complex to SIMD vectorizable types
Complex number types now support SIMD vectorization, enabling vectorized operations.
This commit introduces support for std::complex types within the SIMD vectorization framework. While operations like multiplication and addition are trivially handled using scalar functions, division is not yet implemented. The implementation allows for basic SIMD operations on complex numbers, expanding the utility of SIMD for complex-valued computations.
In Details
This change extends GCC's SIMD infrastructure to recognize and process std::complex types. It modifies bits/simd_details.h and related headers to introduce new ABI variants (_CxIleav, _CxCtgus) and concepts (__complex_like, __vectorizable) to handle complex numbers. The impact is enabling vectorized arithmetic on complex types, though some operations like division and absolute value remain unimplemented due to dependencies on simd.math.
- SIMD
- Single Instruction, Multiple Data. A type of parallel processing where a single operation is performed on multiple data points simultaneously, significantly speeding up computations on large datasets. In GCC, SIMD support is integrated into <code>libstdc++</code> for vectorized types.
- Vectorizable types
- Data types that can be processed by SIMD instructions. This commit adds C++'s
std::complexto the list of types that GCC's SIMD infrastructure can optimize. - ABI variants
- Application Binary Interface variants within the SIMD framework that define how data is arranged and operated upon. New variants like
_CxIleavand_CxCtgusare introduced to represent complex number data layouts for SIMD operations.