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

Support 32-bit unsigned saturating multiplication on aarch64

aarch64 now supports 32-bit unsigned saturating multiplication.

This commit adds support for 32-bit unsigned saturating multiplication on the AArch64 architecture. It introduces a new usmulsi3 expansion that utilizes the UMULL instruction to compute the full 32-bit product. The result is then saturated to UINT32_MAX if the high part of the product indicates overflow. A new test case is included to verify this functionality.

In Details

A new expansion usmulsi3 is added for the aarch64 target. This expansion implements saturating unsigned multiplication for a 32-bit operand size (si). It leverages the UMULL instruction to produce a 64-bit result from two 32-bit inputs, then checks the upper 32 bits of the result to determine saturation. This is relevant for targets needing specific handling of overflow in multiplication operations.

For Context
usmulsi3
GCC's internal name for the function implementing 32-bit unsigned saturating multiplication.
UMULL
An AArch64 instruction that performs an unsigned long multiplication, producing a 64-bit result from two 32-bit operands.
Saturation
In arithmetic operations, saturation means that if the result of an operation exceeds the maximum representable value for the data type, it is clamped to that maximum value, rather than wrapping around or causing an overflow error.
UINT32_MAX
The maximum value that can be represented by an unsigned 32-bit integer.
Filed Under: aarch64targetmultiplication