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 10:04:11 +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:
> template <typename T> T acos (T);
> template <> double acos(double d) { return cos (d); }
> template <> float acos(float f) { return cosf (f); }
> template <> long double acos(long double l) { return cosl (l); }
You then need to handle integer types, and complex types, and functions
with more than one argument have correspondingly larger collections of
specializations. While you could provide provide them, there are enough
that simply providing overloaded builtins seems closer to what is wanted,
and nearer to the spirit of C. (Just because merging the front ends would
make it easier to support C++ features as extensions to C, and C99 and GNU
C features as extensions to C++, doesn't mean we should do so without
justification in individual cases that the feature is appropriate, in
terms of design and style, for the language in question.)
--
Joseph S. Myers
jsm28@cam.ac.uk