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]
Other format: [Raw text]

Re: Can GMP be replaced by trees?


On Tuesday 18 May 2004 13:15, Joseph S. Myers wrote:
> 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?

http://gcc.gnu.org/ml/fortran/2004-05/msg00061.html

> > 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.

This would be my preferred solution.

Tobi: The existing routines for real arithmetic are in real.{c,h}, and do not 
involve tree nodes. These would probably be useable as a replacement for GMP. 
However I think the best solution would be to convert everything to use MPFR 
as described above.

Paul


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