Implementation of <tgmath.h>
Richard Henderson
rth@cygnus.com
Mon Jul 31 11:14:00 GMT 2000
On Fri, Jul 28, 2000 at 08:47:26PM +0100, Joseph S. Myers wrote:
> The best suggestion I have for a compiler extension to allow a correct
> implementation would be a series of builtin functions corresponding to
> the glibc macros, so that for example
>
> #define expm1(Val) __builtin_tgmath_unary_real_only(Val, expm1f, expm1, \
> expm1l)
>
> would have the compiler create a call to the appropriate one of expm1f,
> expm1, expm1l according to the type of Val and the rules of <tgmath.h>
> when it sees a call to __builtin_tgmath_unary_real_only.
Ug. This would seem to need the addition of mini-templates to
the C front end.
OTOH, the IA-64 abi has some builtin functions that could benefit
from this. At present we implement two separate builtins and
play header file tricks to try and make it come out right.
r~
More information about the Gcc
mailing list