This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Evaluate pow(x,n) at compile-time
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Roger Sayle <roger at www dot eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 10 Apr 2003 09:23:23 -0700
- Subject: Re: [PATCH] Evaluate pow(x,n) at compile-time
- References: <Pine.LNX.4.44.0304091959001.23263-100000@www.eyesopen.com>
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>