This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Can GMP be replaced by trees?
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>, gcc at gcc dot gnu dot org
- Date: Tue, 18 May 2004 12:15:03 +0000 (UTC)
- Subject: Re: Can GMP be replaced by trees?
- References: <40A9F429.9010503@physik.uni-muenchen.de>
On Tue, 18 May 2004, [ISO-8859-1] Tobias Schlüter wrote:
> With Toon's recent remark about how incorrect rounding due to excess
> precision in our frontend may corrupt results, and Steve's work which
Reference?
> revealed several minor mistakes in the GMP code in arith.c, I started
> wondering if our dependency on GMP can be removed.
If MPFR - part of GMP though not enabled by default - were used, it would
avoid lots of errors (and excess precision) by using already debugged
code. Cf. <http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00912.html>
listing functions in arith.c duplicating code that already exists in GMP.
By changing the core GCC code (for anything more than +-*/) to use MPFR,
rather than going the other way, support for folding particular functions
is naturally shared by all languages supporting those functions - for
example, you get constant folding for most of the C99 <math.h> and
<complex.h> functions "for free" (as MPFR already implements computing
0.5ulp correctly rounded values for those functions). (You also fix the
well-known problem that sqrtl can be folded with incorrect rounding on
systems with 106-bit long double.) Contributions to MPFR to support
functions not already supported help more than just GCC.
--
Joseph S. Myers
jsm@polyomino.org.uk