GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
aarch64 Performance Win

Port NEON min/max intrinsics to pragma-based framework

Integrates NEON min/max intrinsics into GCC's pragma framework, simplifying their handling and enabling better optimization.

This commit ports several NEON (Advanced SIMD) minimum and maximum intrinsics to GCC’s pragma-based framework on aarch64. Intrinsics like vmax, vmin, vmaxnm, and vminnm (and their vector variants) are now handled more uniformly. This change simplifies the compiler’s internal representation of these operations and allows for better optimization, potentially folding them into single instructions in some cases, as seen with famax and famin in the test suite. Note that floating-point variants requiring specific NaN semantics are not yet ported.

In Details

The aarch64 backend has been gradually migrating its NEON intrinsic handling to a pragma-based framework. This patch continues that effort by integrating vmax, vmin, vmaxnm, and vminnm intrinsics, along with their vector-width variants (q suffix), into this framework. New function bases and definition groups are added in aarch64-neon-builtins-base.cc and .def respectively. Concurrently, the direct function definitions in arm_neon.h for these intrinsics are removed, as their lowering is now managed via the pragma system. The faminmax-no-codegen.c test is updated to reflect th…

For Context
NEON
ARM's Advanced SIMD extension, a set of single instruction, multiple data (SIMD) instructions used for accelerating multimedia and signal processing tasks on ARM processors.
intrinsics
Special functions that allow C/C++ code to directly access specific hardware instructions, such as those in NEON. They provide a higher-level abstraction than inline assembly but offer similar control.
pragma-based framework
An internal compiler framework that uses pragmas to define and manage the behavior and lowering of specific language constructs or intrinsic functions. It aims to centralize and simplify the compiler's handling of these features.
SIMD
Single Instruction, Multiple Data. A class of parallel computers in Flynn's taxonomy that perform the same operation on multiple data points simultaneously using a single instruction.
NaN
Not a Number. A special floating-point value representing an undefined or unrepresentable result, such as the result of 0/0 or sqrt(-1).
Filed Under: aarch64neonintrinsicsoptimization