This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]