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: Fourth Draft "Unsafe fp optimizations" project description.


dewar@gnat.com writes:

> Well the question is whether the built-in routines can be used in normal
> mode. I would say that it makes sense to say yes on this. After all, IEEE
> has no notion of required accuracy for elementary functions in the first
> place.

At the time, no technique was known which would allow the elementary
functions to be computed accurately in reasonable time, so no requirement
was made.  Compare this situation with that of the square root routine,
which has a strict accuracy requirement, because a suitable technique
was known at the time.

Since then, the situation has improved, and I believe that CVS
versions of glibc do have math libraries, contributed by IBM, which
compute accurate results for the most commonly used elementary
functions.  See for instance libc/sysdeps/ieee754/dbl-64/e_exp.c.

On the x86 series, though, glibc doesn't use these routines, instead
preferring to use the hardware functions with some additional range
reduction, because (a) there is a speed increase and (b) the x86 FP
model as implemented by gcc is not the IEEE FP model that the routines
were written for and so I think they don't actually work right on x86.
Thus the results on x86 may differ from the accurate result.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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