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: gcc at gcc dot gnu dot org
- Subject: Re: What is acceptable for -ffast-math? A numerical viewpoint
- From: Jonathan Thornburg <jthorn at thp dot univie dot ac dot at>
- Date: Sat, 4 Aug 2001 15:16:02 +0200
- Cc: Jonathan Thornburg <jthorn at thp dot univie dot ac dot at>
- References: <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00221.html> <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00223.html> <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00225.html>
In message <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00221.html>,
I wrote [[code to implement complex division with reduced chance of
spurious overflow/underflow]]
| if (|c| < |d|)
| then {
| compute
| a/d + b/d i
| -----------
| c/d + 1 i
| }
| else {
| compute
| a/c + b/c i
| -----------
| 1 + d/c i
| }
In message <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00223.html>,
"Joseph S. Myers" <jsm28 at cam dot ac dot uk> wrote
> When we have an implementation of this sort of division in GCC, clearly it
> should go in libgcc as a library function.
In message <url:http://gcc.gnu.org/ml/gcc/2001-08/msg00225.html>,
dewar at gnat dot com wrote
# That's non-optimal unless you inline, since this is a case where you really
# want to be able to do extensive scheduling.
I'd like to see gcc offer the option of either inlining this or not,
presumably guided by -Os vs -finline-functions, and other such options
which control speed vs generated-code-size tradeoffs.
And I'd hope that other nontrivial libc and libm functions (memmov/cpy,
str*, cos, log, pow, ...) would also be inlined or not on a similar basis.
This is clearly an area where one size does *not* fit all programs!
--
-- Jonathan Thornburg <jthorn@aei.mpg.de>
Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
Golm, Germany http://www.aei.mpg.de/~jthorn/home.html
Universitaet Wien (Vienna, Austria) / Institut fuer Theoretische Physik
"Stock prices have reached what looks like a permanently high plateau"
-- noted economist Irving Fisher, 15 October 1929