11706 vs ([lno] Canonical iv creation)

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Mar 13 22:53:00 GMT 2004


Paolo Carlini <pcarlini@suse.de> writes:

| Gabriel Dos Reis wrote:
| 
| >pow(double, int) is a standard mandated function.  There are other
| >versions of pow() that are templates.
| >
| What do you mean, exactly? Currently we have, simply:

[...]

| Therefore, exactly three overloads, which are using __pow_helper. Why

__pow_helper() is for raising any arbitrary numeric type to an integer
exponent.  In particular it is used for complex<T> too. 

| By the way, the seemingly trivial clean up that we have discussed:
| 
|   inline double
|   pow(double __x, double __y)
|   { return __builtin_pow(__x, __y); }
| 
| doesn't work as is: for some reason, pow ends up calling itself :(

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.

-- Gaby



More information about the Libstdc++ mailing list