This is the mail archive of the gcc-patches@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]

[PATCH] PR11706, optimize std::pow(T, int)


Hi!

This is a fix for the ages old PR11706 (or rather a work-around?).
cmath __pow_helper now recognizes constant (or small constant)
integer powers and dispatches to the appropriate gcc builtin in
these cases.  This makes the code for ::pow(x, 2), std::pow(x, 2)
and std::pow(x, 2.0) the same, likewise for exponents > 2 in case
of -ffast-math (even without -funroll-loops).

Ok for mainline?

Thanks,
Richard.


2005-01-12  Richard Guenther <richard.guenther@uni-tuebingen.de>

	PR11706
	* libstdc++-v3/include/c_std/std_cmath.h (__pow_helper):
	Specialize for (small) constant exponents.

Attachment: p2
Description: Text document


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