7.140 --reassociate_saturation, --no_reassociate_saturation
Enables and disables more aggressive optimization in loops that use saturating arithmetic.
Saturating addition is not associative. That is,
(x+y)+z might not be
x+(y+z). For example, with a saturating maximum of 50,
(40+20)-10 = 40 while
40+(20-10) = 50.
Some compiler optimizations rely on associativity, using re-association to rearrange
expressions into a more efficient sequence.
--no_reassociate_saturation option prohibits re-association of
saturating addition, and therefore limits the level of optimization on saturating
--reassociate_saturation option instructs the compiler to re-associate
saturating additions, and might enable optimizations when compiling with other options, such
Saturating addition is not associative, so enabling
--reassociate_saturation could affect the result with a reduction in
The default is
The following code contains the function
L_mac, which performs saturating additions.
int f(short *a, short *b)
int r = 0;
for (i = 0; i < 100; i++)