On 09/13/2012 11:47 AM, Marc Glisse wrote:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

In comments 1 and 7, Richard Guenther didn't seem too enthusiastic about
any vector-related extension to the C++ front-end.

Some users (other PRs) asked instead that we make vector types
class-like so users can define their own operator<(vec,vec).

As Mike says, we want code that works in C to work in C++ too as much as possible. Furthermore, this builtin support would be useful for implementing a C++ class for vector arithmetic, just as it is with std::complex. I'm not aware of any other portable way to implement such a class.

Following the OpenCL standard makes sense to me.

I should really take a look at that standard...

My impression is that the C vector support was written to follow OpenCL, so extending the same semantics to C++ would also follow OpenCL.

I don't know either.

+      if (TREE_TYPE (type0) != TREE_TYPE (type1))

I think this should use same_type_ignoring_top_level_qualifiers_p.

Hmm, I assume you mean

same_type_ignoring_top_level_qualifiers_p (type0, type1)

which would replace both this test and

TYPE_VECTOR_SUBPARTS (type0) != TYPE_VECTOR_SUBPARTS (type1)

below?

I was thinking just for the first test, but I suppose that would work too. My concern is that vectors of typedefs of the same type need to be compatible.

Jason

Reply via email to