aarch64: Port NEON saturating add/sub intrinsics to pragma framework
NEON saturating add/sub intrinsics (vqadd, vqsub) and their scalar variants are ported to GCC's pragma-based framework.
The NEON saturating add and subtract intrinsics, vqadd and vqsub, along with their scalar variants (e.g., vqaddb, vqsubh), have been ported to GCC’s pragma-based framework for aarch64. The patch also enhances the gimple_ifn handler to automatically convert single-element vector modes (V1XX) to their corresponding scalar XX modes for processing, mirroring existing behavior in arm_neon.h and reusing scalar patterns without impacting codegen quality.
In Details
The vqadd and vqsub NEON intrinsics, including their scalar (e.g., vqaddb) and vector variants, are now handled via the pragma-based framework. A key change is in gimple_ifn::fold, which now automatically converts single-element vector types (V1DI, V1DF) to their native scalar types (DI, DF) and back. This leverages existing scalar patterns and aligns with how arm_neon.h previously handled these cases by casting to scalar types.
- NEON
- An Advanced SIMD extension for ARM processors, providing accelerated xử lý of vector data.
- intrinsics
- Special functions that map directly to specific hardware instructions, allowing C/C++ code to leverage specialized processor capabilities.
- pragma-based framework
- A mechanism within GCC where compiler behavior, particularly for intrinsics, is controlled by pragmas, enabling more flexible and maintainable handling of built-in functions.
- gimple_ifn
- Represents an intrinsic function call within GCC's internal GIMPLE representation, allowing for specific handling and optimization passes.
- V1XX modes
- GCC internal types representing single-element vectors, such as V1DI for a 64-bit vector containing one 64-bit element.