These options enable and disable more aggressive optimization in loops that use saturating addition, by either permitting or prohibiting re-association of saturation arithmetic.
Usage
Although potentially useful when vectorizing code, these options are not necessarily restricted to vectorization. For example, --reassociate_saturation could take effect when compiling with -O3 -Otime, even when automatic vectorization is not enabled.
Restriction
Saturating addition is not associative, so enabling re-association could affect the result with a reduction in accuracy.
Default
The default is --no_reassociate_saturation.
Example
The following code does not vectorize unless --reassociate_saturation is specified.
#include <dspfns.h>
int f(short *a, short *b)
{
int i;
int r = 0;
for (i = 0; i < 100; i++)
r=L_mac(r,a[i],b[i]);
return r;
}