11706 vs ([lno] Canonical iv creation)
Paolo Carlini
pcarlini@suse.de
Sat Mar 13 23:10:00 GMT 2004
Gabriel Dos Reis wrote:
>__pow_helper() is for raising any arbitrary numeric type to an integer
>exponent. In particular it is used for complex<T> too.
>
>
Ah yes, I forgot about pow(z, n)! Thanks.
But, in that case, we can use it *only* for complex, not for cmath.
>Under various circumstances, a "library" (see GCC implementation file
>for the exact terminology) __bultin_xxx can be emitted as a call to
>xxx(). That happens for example if you say -fno-builtin-xxx, or you
>turn some assumptions off, or when the compiler thinks it is better to emit
>the library call (those are "C" functions). On systems that do not
>supply for those library functions, we have libmath/stubs.c.
>In summary, while you can say what the "library implemented" xxxx() is
>doing, you don't know what would happen to your __builtin_xxx().
>In V3, it helps solving name lookup problems. Beyond that, one has to
>low down "expectations", a bit.
>
>
[in the meanwhile got your other message, thanks for the additional
explanations]
Therefore, my plan would be: let's keep the overloads for double alone
(e.g., pow(double,
double)) but let's actually exploit ::pow, __builtin_powf,
__builtin_powl for implementing
pow(double, int), pow(float, int), pow(long double, int).
Sounds reasonable?
Paolo.
More information about the Libstdc++
mailing list