Using the MPC library (complex cousin of MPFR) for simplifications in gfortran

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Jan 13 21:11:00 GMT 2009


From: "Tobias Burnus" <burnus@net-b.de>

> Hi all, hi Kaveh,
>
> I'm wondering whether it would make sense to optionally use the MPC
> library (http://www.multiprecision.org/mpc/) to simplify complex
> numbers.

Heh, good timing. :-)  FWIW, I think using MPC would be useful.  In addition 
to using it in the middle-end and fortran frontend for complex trancendental 
function folding, there is another bug PR30789 that would benefit from using 
MPC for complex folding of multiplication and division.  Also, the formulas 
currently implemented in the fortran frontend for complex trancendental 
function evaluation do not appear to me to be last bit accurate in all 
cases.  (MPC incorporates extra code to make sure everything is perfectly 
rounded to the last bit).

I already have a patch to GCC to use MPC in the middle-end as well as all 
the necessary configurey changes, I'm just waiting for the trunk to be 
reopened for stage1 development.  In my plans to incorporate MPC, I had 
thought about using it for fortran, hence why I asked about existing 
testcases in the link below.  I wanted to know if something would squawk if 
I broke things:
http://gcc.gnu.org/ml/fortran/2009-01/msg00142.html


> The other question is whether it makes sense to wait for version 1.0 of
> MPC. Note: Kaveh Ghazi is also interested to have them for the middle
> end, cf.
> http://lists.gforge.inria.fr/pipermail/mpc-discuss/2008-September/000015.html
> Tobias

I think we can start using it now, but until version MPC 1.0 it out and/or 
the API is declared stable, I suggest we make it optional like the ppl/cloog 
libraries.  My configurey patch defines an autoconf macro one can check for 
this purpose.

        Regards,
        --Kaveh
--
Kaveh R. Ghazi



More information about the Fortran mailing list