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]

Re: [FORTRAN PATCH]: Use mpc_pow_z for (complex float ** int)


On Wed, Oct 07, 2009 at 05:02:04PM -0400, Kaveh R. GHAZI wrote:
> The fortran frontend has special case code to handle constant folding of
> (complex real ** int).  The existing MPC solution handles it by converting
> the integer exponent (an mpz_t) into a complex real (mpc_t) of the same
> size as the existing base argument and then calling mpc_pow to get the
> result.
> 
> This patch updates it to use the new mpc_pow_z function.  In addition to
> being more compact and simple on the GCC side, this change solves a
> potential problem.  That is, when converting a very large int to a real it
> may not fit into the precision of that floating point number.  The
> mpc_pow_z function takes this into account by accepting the raw mpz_t
> without conversion and handles it appropriately internally in the library.
> 
> Tested on x86_64-unknown-linux-gnu without MPC, with mpc-0.7 and with
> mpc svn revision 701 (which has the new mpc_pow_z).  No regressions.
> 
> Okay for mainline?
> 

OK.

-- 
Steve


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