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 shuffling


On Sun, Aug 15, 2010 at 7:34 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Sun, Aug 15, 2010 at 7:30 AM, Artem Shinkarov
> <artyom.shinkaroff@gmail.com> wrote:
>> The patch implements vector shuffling according to the OpenCL
>> standard. The patch introduces builtin function __builtin_shuffle
>> which accepts two or three parameters: __builtin_shuffle (vec, mask)
>> or __builtin_shuffle (vec0, vec1, mask) and returns a shuffled vector.
>>
>> Function is trying to dispatch shuffling to the hardware-specific
>> shuffling instructions via new target hooks. If this attempt fails,
>> function expands shuffling piecewise.
>
> I don't like the idea of a target hook here. ?Opcodes seems like an
> easier way of adding support to new targets. ?Not to mention maybe we
> should have a new tree code and a new rtl code which will allow the
> compiler to optimize these shuffles easier.

On the tree level we generally express target dependent features via
builtins.  What tree code are you thinking of?  We have vector lowering
for target unsupported stuff to allow optimizing - would that new tree code
be target specific then (in that it appears only when target support
is available)?

I think the hurdle to add a new tree code should be large - otherwise we'll
just accumulate a mess.

Richard.

> -- Pinski
>


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