This is the mail archive of the
mailing list for the GCC project.
Re: Fourth Draft "Unsafe fp optimizations" project description.
- To: dewar at gnat dot com
- Subject: Re: Fourth Draft "Unsafe fp optimizations" project description.
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 13 Aug 2001 00:44:57 -0700
- CC: gcc at gcc dot gnu dot org
- References: <20010813044715.A82B3F2B79@nile.gnat.com>
> 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
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 <email@example.com>