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] Optimize x*x*x*x*x*x using 3 multiplications.


On 29 Jul 2003, Gabriel Dos Reis wrote:
> | The std::pow thread on "gcc" is an insteresting one.  I too would
> | recommend forwarding std::pow(double,int) to std::pow(double,double) for
> | the case where the second argument is __builtin_constant_p.  An even
> | better solution would be to provide a __builtin_powi function directly
>
> I was going to contact you to see how we could manage to provide
> support for things like
>
>     __builtin_pow{, f, l}i(FLOAT, int)
>         with FLOAT in {double, float, long double}

That's a neat idea.  I'll admit that I hadn't thought about it but adding
builtins for powif and powil in addition to powi is obviously a excellent
suggestion.  The current expand_builtin_powi code already handles all
three forms (but only for second argument constant).  I've Cc'd Phil
Edwards who's expressed an interest in implementing this.  Phil, let me
know if there's anything I can do to help.

It might also be worth contacting the glibc/newlib folks to check that
they don't already have a name for these functions, even if they don't
have any immediate plans to provide implementations.  It would be
unfortunate to have this functionality ratified by a future ISO C/C++
standard, but under a different name (if its avoidable).

Roger
--


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