This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Exponentiation by integral exponents
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org list" <gcc at gcc dot gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Tue, 27 Apr 2004 17:23:34 -0400
- Subject: Re: [gfortran] Exponentiation by integral exponents
- References: <408ECD52.2090709@physik.uni-muenchen.de>
On Apr 27, 2004, at 17:14, Tobias Schlüter wrote:
FYI I have ported Andy's code for exponentiation by an integral
exponent to our tree. This is an implementation of Knuth's algorithm
which uses the minimum number of multiplications for exponents < 100.
As an additional bonus there's no more need to special case an
exponent of three, the optimal code is generated automatically. I'll
submit this once my copyright assignment is handled.
Does anybody have any insight on how to write testcases for this?
You should not need it if you use __builtin_pow and you turn on
flag_unsafe_math_optimizations on. Maybe the best way is to have
another flag
to say expand __builtin_pow always.
Thanks,
Andrew Pinski