This is the mail archive of the 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 comparison

On Sun, Aug 15, 2010 at 6:30 PM, Andrew Pinski <> wrote:
> On Sun, Aug 15, 2010 at 10:09 AM, Artem Shinkarov
> <> wrote:
>> This patch implements vector comparison according to OpenCL standard.
>> The patch tries to dispatch vector comparison to hardware-specific
>> instructions. If case when it is impossible, vector comparison is
>> expanded piecewise.
> I had posted a patch which had implemented them using the standard
> tree codes and expansion and tree-lower-vect took care of the rest.
> This was for reduction of vector comparison into a single scalar.
> In fact we had agreed that they should implicitly turn a vector int
> into a scalar when used in the context of a bool.
> See .

Yes, I looked over your patch. The thing is that OpenCL defines vector
comparison exactly in a way it is currently implemented. I can't see
any problem to reduce it with a max or min function over vector
elements for being able to use it inside if statement.

> Please consider using tree codes all the way through the gimple IR if
> the target supports expansion and doing the expansion only at expand
> time. ?Building a call expression is expensive and really you could
> use opcodes and not worry about a target hook. ?I think opcodes it is
> a much easier way allowing for targets to add support rather than
> adding more and more target hooks.

The hook approach was approved by Richard, so let's wait what he is
going to tell.


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