This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR11706, use __builtin_powi[lf] for pow(x, int)
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 7 Feb 2005 15:11:51 +0100 (CET)
- Subject: Re: [PATCH] Fix PR11706, use __builtin_powi[lf] for pow(x, int)
On Mon, 7 Feb 2005, Paolo Carlini wrote:
> Richard Guenther wrote:
>
> >This patch will fix PR11706 once support for __builtin_powi goes in.
> >
> >Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >
> >Ok for mainline?
> >
> This cannot be ok, because __pow_helper is used also for <complex>...
Indeed. Weird that didn't show up during testing. Grep'ing for
cmath.tcc also didn't show it because complex doesn't include it.
I'll re-test the following (very) simpler patch then. Ok if
testing succeeds?
Thanks again,
Richard.
2005-02-07 Richard Guenther <rguenth@gcc.gnu.org>
* include/c_std/std_cmath.h (pow): Use __builtin_powi[lf]
for integer overloads.
Index: include/c_std/std_cmath.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cmath.h,v
retrieving revision 1.17
diff -c -3 -p -r1.17 std_cmath.h
*** include/c_std/std_cmath.h 1 Feb 2005 13:30:32 -0000 1.17
--- include/c_std/std_cmath.h 7 Feb 2005 13:46:02 -0000
*************** namespace std
*** 349,364 ****
{ return __builtin_powl(__x, __y); }
inline double
! pow(double __x, int __i)
! { return __pow_helper(__x, __i); }
inline float
pow(float __x, int __n)
! { return __pow_helper(__x, __n); }
inline long double
pow(long double __x, int __n)
! { return __pow_helper(__x, __n); }
using ::sin;
--- 340,355 ----
{ return __builtin_powl(__x, __y); }
inline double
! pow(double __x, int __n)
! { return __builtin_powi(__x, __n); }
inline float
pow(float __x, int __n)
! { return __builtin_powif(__x, __n); }
inline long double
pow(long double __x, int __n)
! { return __builtin_powil(__x, __n); }
using ::sin;