This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11706] std::pow(T, int) implementation pessimizes code
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Sep 2003 15:29:30 -0000
- Subject: [Bug libstdc++/11706] std::pow(T, int) implementation pessimizes code
- References: <20030729120327.11706.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11706
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2003-09-29 15:29 -------
Subject: Re: std::pow(T, int) implementation pessimizes
code
On 29 Sep 2003, gdr at integrable-solutions dot net wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11706
>
>
>
> ------- Additional Comments From gdr at integrable-solutions dot net 2003-09-29 15:05 -------
> Subject: Re: std::pow(T, int) implementation pessimizes code
>
> "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org> writes:
>
> | Why exactly should cmath not use ::pow
>
> we should not use ::pow because there is no ::pow in <cmath> -- at
> least in principle.
It is - see line 556 in <cmath> which unconditionally uses ::pow. The
problem are just the integer overloads of pow, as if using the regular
float ones we optimize according to the gcc builtins added by Roger.
So we can f.i. just drop the integer overloads of std::pow.
Richard.
> | (or __builtin_pow())?
>
> I remember Roger supplied builtins for various T in pow(T, int).
> They should help.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/