[PATCH] Remove GMP in favor of MPFR

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Jul 4 15:20:00 GMT 2004


On Sun, Jul 04, 2004 at 02:08:02PM +0100, Paul Brook wrote:
> [ CCing gcc-patches. Original message can be found here: 
> http://gcc.gnu.org/ml/fortran/2004-07/msg00005.html ]
> 
> On Sunday 04 July 2004 04:19, Steve Kargl wrote:
> > Gang,
> >
> > Here is a reworking of gfortran to use MPFR in preference to
> > GMP.  The diff (when uncompressed) is nearly 3800 lines and
> > on the order of 100 kB.  The patch has been bootstrapped on
> > FreeBSD.  The gfortran testsuite was run with no new regression.
> > My private test suite also compiled and ran without a problem.
> 
> Looks ok.
> 
> +/* Andy may have used biased exponents e = E + bias where bias = 1.
> +   Single precision model numbers.  */
> 
> I don't understand this comment, and the following defines are inconsistent 
> (some differ by one, others are the same).
> 
> Is this a genuine error, or the difference between defining the valid 
> exponents as <= E vs. < E ?

I'm looking at the July 1, 2004 revision of the IEEE-754 standard.  
Table 1a shows 
            p    emax   emin
binary32    24    127   -126
binary64    53   1023  -1022
binary128  113  16383 -16382

If you go to www.mpfr.org, and then go to the bottom of that
page, you'll find a link to the IEEE 754 working group.  You
can find PDFs of the current standard and the current proposed
revision.  Of course, these PDFs are to be used in contributing
comments to the IEEE 754 working group.

I've retained the original emin and emax for single (128,-125)
and double (1024,-1021) precision because I wasn't sure if the
computations of range, precision, epsilon, huge, and tiny depend
on these values in some unusual way.  This is on my list of
things to check against the draft F2003 standard.
 
> > Finally, here's a mutant ChangeLog entry.  The complexity
> > of patch has me somewhat stymied with submitting anything
> > shorter.
> 
> I'd say one entry per file is sufficient for the "Convert GMP to MPFR" 
> changes. New/removed functions should still be mentioned individually.
> 
> I'll give it a couple of days to see if anyone screams, then commit.
> 

Thanks.  I would also appreciate if others could test
the patch.  I'll (try to) fix any problems that arise. :-)

-- 
Steve



More information about the Fortran mailing list