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

aarch64: Make NEON_FUNCTION a variadic macro for code reduction

aarch64: Simplifies NEON intrinsic definitions by converting NEON_FUNCTION to a variadic macro, reducing redundancy.

This patch refactors the NEON_FUNCTION macro in the aarch64 backend to be variadic. This change allows a single macro definition to handle multiple NEON intrinsics that share the same GIMPLE handler class and arguments, up to 10 intrinsics. By reducing redundancy in how intrinsics map to handlers, this improves code maintainability and clarity within the NEON builtins framework.

In Details

The NEON_FUNCTION macro in aarch64-neon-builtins-functions.h was converted to a variadic macro (NEON_FUNCTION_IMPL) to support up to 10 intrinsics mapping to the same GIMPLE handler class and arguments. This eliminates redundant macro definitions for intrinsics with identical handler mappings, reducing boilerplate code. The trailing comma is still required for empty argument lists.

For Context
NEON
ARM's advanced SIMD (Single Instruction, Multiple Data) architecture extension.
variadic macro
A C preprocessor macro that can accept a variable number of arguments.
GIMPLE
GCC's Intermediate Representation (IR) form, designed for optimization passes.
intrinsic
A function provided by the compiler that maps directly to a specific hardware instruction.
Filed Under: aarch64neonmacrocode-reduction