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: [PATCH] Evaluate pow(x,n) at compile-time


Roger Sayle <roger at www dot eyesopen dot com> writes:

> The following patch enables gcc to evaluate pow(x,y) at compile-time,
> where x and y are compile-time constants and y is integer valued.
> 
> The patch below has been tested on i686-pc-linux-gnu with a full
> "make bootstrap", all languages except Ada and treelang, and a
> testsuite run with a top-level "make -k check" with no new
> regressions.
> 
> Ok for mainline?

I think your real_powi is not as accurate as the system pow() routine
could be, correct?  I don't think we should start folding constants to
less-accurate values than the system routines would provide.

-- 
- Geoffrey Keating <geoffk at geoffk dot org>


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