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

*From*: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>*To*: Paul Brook <paul at codesourcery dot com>*Cc*: fortran at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>,"gcc at gcc dot gnu dot org list" <gcc at gcc dot gnu dot org>*Date*: Wed, 28 Apr 2004 01:09:09 +0200*Subject*: Re: [gfortran] Exponentiation by integral exponents*References*: <408ECD52.2090709@physik.uni-muenchen.de> <23B628D8-9891-11D8-9EA6-000393A6D2F2@physics.uc.edu> <408ED9A7.5060603@physik.uni-muenchen.de> <200404272315.48828.paul@codesourcery.com>

On Tuesday 27 April 2004 23:07, Tobias Schlüter wrote:

Andrew Pinski wrote:

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

...

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.

Does the builtin recognize the case pow(x,(float)i), where i is an integer? Then this sounds like a very good idea.

Maybe the way to indicate we always want to expand __builtin_pow would be to pass the second parameter with an integer type. It may be easier to add __builtin_powi to avoid needing polymorphic builtins.

Definitely.

kind = expr->op1->ts.kind; switch (expr->op2->ts.type) { case BT_INTEGER: /* Integer powers are expanded inline as multiplications. */ gfc_conv_integer_power (se, lse.expr, rse.expr); return;

gfc_conv_expr_type (&rse, expr->op2, type); // first try

rse.expr = convert (type, rse.expr); // second try

**References**:**Re: [gfortran] Exponentiation by integral exponents***From:*Andrew Pinski

**Re: [gfortran] Exponentiation by integral exponents***From:*Tobias Schlüter

**Re: [gfortran] Exponentiation by integral exponents***From:*Paul Brook

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |