This is the mail archive of the gcc@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: [Bug libstdc++/11706] std::pow(T, int) implementation pessimizescode


On Thu, 13 Nov 2003, Richard Guenther wrote:

> On Mon, 29 Sep 2003, gdr at integrable-solutions dot net wrote:
>
> > | It is - see line 556 in <cmath> which unconditionally uses ::pow. The
> >
> > It is a bug, feel free to submit a due PR :-)

Btw. shouldn't std_cmath.h get an overhaul as we have a lot more builtin
math functions now? Like fabs() uses

  inline float
  fabs(float __x)
  { return __builtin_fabsf(__x); }

but floor()

#if _GLIBCXX_HAVE_FLOORF
  inline float
  floor(float __x) { return __gnu_cxx::__c99_binding::floorf(__x); }
#else
  inline float
  floor(float __x) { return ::floor(static_cast<double>(__x)); }
#endif

but of course __bultin_floor() is available now.  Same goes for many other
functions declared here.

Richard.


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