Can GMP be replaced by trees?
Joseph S. Myers
jsm@polyomino.org.uk
Tue May 18 12:15:00 GMT 2004
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
More information about the Gcc
mailing list