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, committed] PR 42694: Optimize pow (x, 0.25), pow (x, 0.75), and pow (1./6.)


Hi,

On Wed, 14 Apr 2010, Richard Guenther wrote:

> >> > The patch was discussed and approved in January when stage1 opened 
> >> > up: http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01288.html
> >>
> >> Have you considered to implement the transformation into the 
> >> fold_builtin phase, instead of into the expand_builtin phase? ÂThat 
> >> way the various sqrt() calls would be exposed to the tree optimizers 
> >> already which might have some advantages.
> >
> > Ok, sounds reasonable, and I'll think about it. ÂThanks.
> 
> The reason we delay this is to have a most canonical form during 
> optimization (thus the pow folders that fold x * x to pow (x, 2)).

Yes, well, but I don't see why the canonical form of pow(x,0.25) can't be 
sqrt(sqrt(x)).  We already fold pow(x,1/3) into cbrt() and pow(x,0.5) into 
sqrt() (fold, not expand!), so if we're serious about having _only_ pow as 
canonical form, then we need to remove some things from fold_builtin_pow 
too, and add some other things to fold_builtin_sqrt/cbrt.


Ciao,
Michael.

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