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

Re: Vector Extensions in GCC


On Thu, 12 Jul 2001, Mark Mitchell wrote:

> To be clear, I'm only talking about an implementation technique, not
> a language extension.  It's just that we could implement the function,
> in the guts of the compiler, as a template -- one that was builtin,
> not one that ever appeared in source code.

In that case, the <tgmath.h> source code will presumably contain such 
definitions as

#define cos(x) __some_compiler_magic(cos, cosf, cosl, ccos, ccosf, ccosl, x)

or, if we add compiler magic for each individual function internally,

#define cos(x) __some_compiler_magic_tgmath_cos(x)

(the present version being

#define cos(Val) __TGMATH_UNARY_REAL_IMAG (Val, cos, ccos)

where __TGMATH_UNARY_REAL_IMAG is a complicated macro containing a
statement expression and calling more macros).

It seems to me that __some_compiler_magic would look to the user pretty 
much like an overloaded builtin, even if internally it uses a template to 
dispatch the call to the correct function.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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