This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: vector comparisons in C++


On Thu, 13 Sep 2012, Jason Merrill wrote:

On 08/31/2012 06:20 PM, Marc Glisse wrote:
this patch copies some more vector extensions from the C front-end to
the C++ front-end. There seemed to be some reluctance to add those, but
I guess a patch is the best way to ask

What was the reluctance? It seems clear to me that if we support the type, we should support these operations.

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).

Following the OpenCL standard makes sense to me.

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


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 copied this directly from the C front-end, which I guess split the test to have 2 different error messages. I could call same_type_ignoring_top_level_qualifiers_p and only if it fails do more specific tests to determine the error message (or I could even merge the 2 error messages, "vectors with different types" should be good enough).

Did I understand your suggestion correctly?


Thank you for your comments,


--
Marc Glisse


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