This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize x*x*x*x*x*x using 3 multiplications.
- From: Roger Sayle <roger at eyesopen dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc-patches at gcc dot gnu dot org, Phil Edwards <phil at jaj dot com>
- Date: Tue, 29 Jul 2003 14:09:47 -0600 (MDT)
- Subject: 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
--