This is the mail archive of the gcc-patches@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]

[PATCH 4.5 0/N]: Integrate GCC with the complex math library MPC


This series of patches integrates GCC with the complex math library MPC.
MPC is the complex analogue to MPFR.  It is written by some of the same
folks with the same accuracy and precision principles.  MPC is licensed
under the LGPL.  See: http://www.multiprecision.org/mpc/

Among the potential benefits of using MPC are:

1.  Folding of complex builtins with constant arguments in the
    middle-end, e.g. csin(a + bI) -> c + dI.  Of course complex
    builtins may not start out with a constant argument, but various
    optimizations may infer what the argument is and allow the folding
    to occur.

2.  Folding of fortran intrinsics.  (These optimizations don't go
    through the middle-end and so right now have duplicate functionality).

3.  Addressing complex folding bugs like PR30789 that can be tricky
    to fix (even with MPFR).


MPC is currently under 0.x version development and is not entirely
complete with respect to c99 complex builtins yet (but their plan is to do
all of the c99 math functions with c99 semantics for the special cases.)
Also as far as I'm aware, MPC is not yet included with distros or binary
sites like MPFR is.

Because of these issues, I have written the patch to make MPC's use
*optional* for now.  So GCC developers without MPC should not notice
anything.  And I have only implemented item #1 above for middle-end
builtins all conditionalized on configure finding the library and ensuring
the necessary bits are available.  We can obviously revisit this decision
and hard require MPC when it's more mature.

Although not all C99 functions are complete in the latest MPC, I'd like to
get the bulk infrastructure installed now.  As new complex functions are
added to MPC I will update the middle-end and testcases accordingly.  The
patches that follow are split up by maintenance domain to make reviewing
easier.

		Thanks,
		--Kaveh

--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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