[PATCH, committed] PR 42694: Optimize pow (x, 0.25), pow (x, 0.75), and pow (1./6.)

Richard Guenther richard.guenther@gmail.com
Wed Apr 14 15:47:00 GMT 2010


On Wed, Apr 14, 2010 at 5:41 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> On Wed, Apr 14, 2010 at 05:30:06PM +0200, Michael Matz wrote:
>> Hi,
>>
>> On Wed, 14 Apr 2010, Michael Meissner wrote:
>>
>> > I committed the following patch for 42694 that adds some optimizations
>> > for pow, particularly pow (x, 0.75) that shows up in some Fortran code
>> > (bwaves).
>> >
>> > 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)).

Richard.

> --
> Michael Meissner, IBM
> 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
> meissner@linux.vnet.ibm.com
>



More information about the Gcc-patches mailing list