This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Vector Extensions in GCC
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Vector Extensions in GCC
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 12 Jul 2001 18:18:04 +0100 (BST)
- cc: Stan Shebs <shebs at apple dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
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