What is acceptable for -ffast-math? A numerical viewpoint

Joseph S. Myers jsm28@cam.ac.uk
Sat Aug 4 05:03:00 GMT 2001


On Sat, 4 Aug 2001, Jonathan Thornburg wrote:

> Suppose we're in a language where "complex" is a primitive datatype
> (eg Fortran or C99).  Then there are several plausible ways to implement
> complex division:

We need to follow #pragma STDC CX_LIMITED_RANGE - default OFF - here.

G.5.1#8 provides example code for complex division - which still doesn't
avoid all cases of overflow/underflow.

> beyond the square root of the overflow/underflow threshold.  (3) avoids
> almost (though not quite) all of the spurious overflows/underflows, at
> the cost of a data-dependent conditional branch, which is a major
> performance hit on (heavily-pipelined) modern hardware.  (3) also has
> larger object code.

When we have an implementation of this sort of division in GCC, clearly it
should go in libgcc as a library function.

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc mailing list