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

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Jan 12 16:52:00 GMT 2005


Paolo Carlini <pcarlini@suse.de> writes:

| Gabriel Dos Reis wrote:
| 
| >Richard Guenther <rguenth@tat.physik.uni-tuebingen.de> writes:
| >
| >|            else if (__builtin_types_compatible_p(_Tp, double))
| >
| >Dispatching on types is done is C++ with template specializations.
| >
| Please correct me if I'm wrong: probably the optimal solution (besides
| generically improving the treatment of loops with constant bounds) would
| involve dispatching integer powers of float, double, long double to
| appropriate builtins (using template specializations), otherwise, using
| the generic loop.
| 
| Unfortunately, the above builtins are still missing :-( Is there a PR open
| tracking this issue? Shall I open one?

I don't know of any PR open for that.  However, for the issue at hand,
the fix is to have __buitin_powi and such.  See past discussions with
Roger Sayle.

-- Gaby



More information about the Libstdc++ mailing list