std::pow implementation

Andrew Pinski pinskia@physics.uc.edu
Tue Jul 29 13:59:00 GMT 2003


On Tuesday, Jul 29, 2003, at 08:57 US/Eastern, Richard Guenther wrote:

> On Tue, 29 Jul 2003, Andrew Pinski wrote:
>
>> On Tuesday, Jul 29, 2003, at 08:43 US/Eastern, Richard Guenther wrote:
>>> On 29 Jul 2003, Gabriel Dos Reis wrote:
>>>
>>> To show you some of the performance improve I get with my "hacked"
>>> __pow_helper(), the average time for one iteration of my scientific
>>> app dropped from 2.6s to 1.8s - this is a 30% improvement. Not to say
>>> I ever expected gcc (or libstdc++) to not create x*x out of
>>> std::pow(x,2).
>>
>> If you use ::pow instead, gcc does change it to be x*x on the mainline
>> at least.
>
> Why isnt this done for std::pow? Any particular reason?

I just think this is just a bug in GCC for the builtins matching but I 
do not know the exact reason.

Andrew



More information about the Gcc mailing list