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

aarch64: Name SVE FRINTN pattern after the roundeven optab.

Renames the SVE FRINTN pattern to 'roundeven' for consistency and enables its use in vectorization.

This commit renames the SVE UNSPEC_COND_FRINTN pattern in the GCC AArch64 backend to roundeven, aligning it with the standard terminology and the existing Advanced SIMD implementation. Previously, the mismatch prevented roundeven operations from being vectorized using SVE, forcing them to fall back to Advanced SIMD. This change ensures that roundeven can now be correctly implemented by SVE, improving performance for relevant floating-point operations.

In Details

The UNSPEC_COND_FRINTN pattern in config/aarch64/iterators.md was incorrectly mapped to the frintn optab instead of roundeven. FRINTN (round to nearest, ties to even) is semantically equivalent to roundeven. This mismatch caused loops using __builtin_roundeven to be vectorized with Advanced SIMD (if available) rather than SVE, as SVE lacked a direct implementation for roundeven. This change corrects the mapping and adds two new test cases (roundeven_1.c, roundeven_2.c) to verify SVE vectorization.

For Context
SVE
Scalable Vector Extension, an optional ARM architecture feature that provides powerful vector processing capabilities with a flexible vector length.
optab
An 'operation table' in GCC, mapping internal intermediate representations (like UNSPECs) to specific machine instructions or patterns.
FRINTN
A floating-point instruction that rounds a value to the nearest integer, with ties rounded to the even number.
roundeven
A C++ intrinsic function (__builtin_roundeven in GCC) that rounds a floating-point number to the nearest integer, with ties rounded to the nearest even integer.
Filed Under: aarch64sveoptimizationfloating point