This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add comparison operators for vector types
- From: Andrew Pinski <Andrew_Pinski at playstation dot sony dot com>
- To: Chris Lattner <clattner at apple dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Trevor_Smigiel <Trevor_Smigiel at playstation dot sony dot com>
- Date: Tue, 2 Jun 2009 16:27:42 -0700
- Subject: Re: [PATCH] Add comparison operators for vector types
- References: <firstname.lastname@example.org> <69D42E97-CB30-4F67-985A-1270877FDF3D@apple.com>
On Fri, May 29, 2009 at 9:17 PM, Chris Lattner <email@example.com> wrote:
> On May 29, 2009, at 6:06 PM, Andrew Pinski wrote:
>> ÂThe C/C++ Language extension for the Cell defines the comparison
>> operators for vectors. ÂThe result of these operators is a single
>> boolean value representing the bitwise AND of all pairwise
>> comparisons. ÂThis patch adds support for these operators and a
>> testcase to test them for both C and C++.
>> This patch was originally written by Trevor and updated by me for the
>> tuplifications of tree-vect-generic.c.
>> OK? Bootstrapped and tested on i686-linux-gnu with no regressions.
> Is this something you want to do on the Cell alone, or for generic vectors
> in general?
generic vectors in general.
>ÂNote that OpenCL defines vector comparisons differently than
What does that language define them? The main reason why it was
defined this way (it was defined before implemented in fact), is that
the C standard defines comparison operators returning an int (with a
value of 0 or 1) so we (Cell [Sony, IBM and Toshiba]) defined it to
returning an int rather than like valarrays of returning a valarray of
Right now GCC rejects a vector of bools and defining one seems a bit
weird as what size will be the bool, always one bit, one byte, 4
bytes? How do you get from one type to another?
> ÂIf GCC aims to support it one day, it would useful to consider what
> it wants. ÂCell is a particularly useful target for OpenCL.
But isn't OpenCL a different language than C, or is it extensions to C/C++?