GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
aarch64

Fix vadd intrinsic behavior on signed integer overflow.

Signed integer overflow in aarch64 `vadd` intrinsics now wraps around as required by ACLE.

This commit corrects the behavior of aarch64 vadd family of intrinsics concerning signed integer overflow. Previously, they followed C’s undefined behavior, but the ACLE standard mandates wraparound semantics. The fix involves casting operands to unsigned types before performing the addition, ensuring the specified wraparound behavior. Additionally, tests for floating-point addition intrinsics have been added.

In Details

The vadd intrinsics for aarch64 NEON were previously not conforming to the ACLE standard regarding signed integer overflow, which should be wraparound. This patch introduces a gimple_arith struct to handle these operations, ensuring that a cast to unsigned is performed prior to the addition, thereby guaranteeing wraparound semantics. This corrects a subtle ABI compliance issue.

For Context
vadd
A family of NEON intrinsics for performing vector addition on floating-point or integer data types.
ACLE
ARM C Language Extensions, a set of extensions to the C language for programming ARM-specific features, including NEON SIMD instructions.
wraparound semantics
When an arithmetic operation results in a value outside the representable range, it 'wraps around' to the other end of the range. For unsigned integers, this is well-defined. For signed integers, it's typically undefined behavior in C, but standards like ACLE can mandate specific behavior.
NEON
ARM's advanced Single Instruction Multiple Data (SIMD) architecture, providing a set of instructions to perform the same operation on multiple data points simultaneously.
Filed Under: aarch64intrinsicsACLEinteger overflow