AArch64 gains support for new FP16/BF16 matrix multiply instructions
AArch64 support is extended to include new AdvSIMD and SVE matrix multiply intrinsics for FP16 and BF16 data types.
This commit introduces support for several new Advanced SIMD and Scalable Vector Extension (SVE) features on AArch64, specifically related to half-precision (FP16) and bfloat16 (BF16) matrix multiplication. It adds intrinsics for vmmlaq_f16 and vmmlaq_f32_f16 in AdvSIMD, and svmmla_f16 and svmmla_bf16 in SVE, including overloaded aliases. The changes involve updating C++ front-end builtins, backend patterns, and test suite configurations to recognize and utilize these new hardware capabilities.
In Details
This patch adds support for AArch64's FEAT_F16F32MM, FEAT_F16MM, and FEAT_SVE_B16MM features. This involves defining new macros (TARGET_F16F32MM, TARGET_F16MM, TARGET_SVE_B16MM), adding new NEON and SVE intrinsics and their implementations (aarch64-neon-builtins-base.cc, aarch64-sve-builtins-sve2.def), and defining new machine patterns (aarch64-simd.md, aarch64-sve2.md). It also updates aarch64_update_cpp_builtins to define corresponding __ARM_FEATURE__ macros and augments the test suite to verify these new features. A related fix in binutils is noted.
- AArch64
- The 64-bit ARM architecture. GCC supports generating code for this architecture.
- AdvSIMD
- An extension to the ARM architecture that provides Single Instruction, Multiple Data (SIMD) capabilities, similar to SSE on x86. It's used for accelerating multimedia and signal processing.
- SVE
- Scalable Vector Extension, an advanced SIMD instruction set for ARM architecture that allows vector registers to be of variable length, adapting to the hardware.
- FEAT_F16F32MM
- A specific ARM architecture feature enabling matrix multiplication operations involving FP16 and FP32 data types.
- FEAT_F16MM
- A specific ARM architecture feature enabling matrix multiplication operations involving FP16 data types.
- FEAT_SVE_B16MM
- A specific ARM architecture feature enabling SVE matrix multiplication operations involving BF16 data types.
- FP16
- Half-precision floating-point format, using 16 bits to represent a floating-point number. It offers reduced memory usage and potentially faster computation compared to FP32.
- BF16
- Bfloat16 (Brain Floating Point) format, another 16-bit floating-point format optimized for deep learning workloads. It has the same exponent range as FP32 but less precision.
- intrinsics
- Functions provided by the compiler that map directly to specific hardware instructions. They allow programmers to use advanced hardware features from C/C++ code.
- machine patterns
- Internal representations within GCC's backend that describe how to generate specific machine instructions for a target architecture.