This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? A numerical viewpoint
- To: Jonathan Thornburg <jthorn at galileo dot thp dot univie dot ac dot at>
- Subject: Re: What is acceptable for -ffast-math? A numerical viewpoint
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Sat, 4 Aug 2001 13:02:56 +0100 (BST)
- cc: <gcc at gcc dot gnu dot org>, Jonathan Thornburg <jthorn at thp dot univie dot ac dot at>
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