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 Jul 2003 13:01:18 -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-07-29 13:01 -------
Subject: Re: std::pow(T, int) implementation pessimizes
code
On 29 Jul 2003, steven at gcc dot gnu dot org wrote:
> Richard, can you test this and see if it helps? It's still not as good as
> pow(x,2)->x*x but it's darn close and with loop unrolling it might even get to that.
Given recent discussion on gcc list and gcc3.4s ability to optimize
::pow, we should just drop __pow_helper() and __cmath_power() and change
inline double
std::pow(double __x, int __i)
{ return __pow_helper(__x, __i); }
to
inline double
std::pow(double __x, int __i)
{ return ::pow(__x, __i); }
Maybe for all other overloads, too.
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/