This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: Fw: Conversion to mpfr_t


On Thu, Jun 17, 2004 at 07:57:06PM +0200, Tobias Schl?ter wrote:
> 
> I may do the switch in stages.  If you look at gfc_expr in gfortran.h,
> you'll find
> 
>   union
>   {
>     mpf_t real;
> 
>     struct
>     {
>       mpf_t r, i;
>     }
>     complex;
> 
>     ...
> 
>   }
>   value;
> 
> Stage 1:  Replace mpf_t with mpfr_t.  Retain the generic 100-bit type.
>           Fix all consumers of gfc_expr->value.XYZ to work.
> 
> Stage 2:  Remove home-grown exponential() et al function in preference
>           to the MPFR equivalent.  Retain the generic 100-bit type.
> 

I have completed the first 2 stages of replacing GMP's mpf_t with
MPFR's mpfr_t.  This results in a 3581 line diff file.  The changes
have been bootstrapped, regression tested (with no new failures),
and passed my private test suite.

 GMP     MPFR
 2861    2371 arith.c
   90      83 arith.h
 1490    1490 dump-parse-tree.c
 1907    1910 expr.c
 1661    1665 gfortran.h
 3467    3467 module.c
 2219    2219 primary.c
 4008    3908 simplify.c
  377     377 trans-const.c
   59      59 trans-const.h
 3021    3021 trans-intrinsic.c
------  ------
21160   20570 total lines

This eliminated nearly 600 lines of code from gfortran.

The next stage involves the removal of the 100-bit precision
mpfr_t types in favor of 24-, 53-, and perhaps 113-bit 
precision type.   This step may take me several days because
I need to determine how to handle mix-mode math.

If someone wants to look over the current diff, then please
email privately.  I don't want to spam fortran@ with 3581
lines of code.  Of course, if someone wants to commit the
current diff I won't object.

Finally, I don't know autoconf, so I simply edited configure
and replaced "-lgmp" with "-lmpfr -lgmp" in gcc/.  Someone
will need to write a proper autoconf test.

-- 
Steve


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