Vector shuffling

Richard Guenther richard.guenther@gmail.com
Wed Aug 31 09:00:00 GMT 2011


On Wed, Aug 31, 2011 at 1:51 AM, Chris Lattner <clattner@apple.com> wrote:
> On Aug 30, 2011, at 10:01 AM, Artem Shinkarov wrote:
>>>> The patch at the moment lacks of some examples, but mainly it works
>>>> fine for me. It would be nice if i386 gurus could look into the way I
>>>> am doing the expansion.
>>>>
>>>> Middle-end parts seems to be more or less fine, they have not changed
>>>> much from the previous time.
>>>
>>> +@code{__builtin_shuffle (vec, mask)} and
>>> +@code{__builtin_shuffle (vec0, vec1, mask)}. Both functions construct
>>>
>>> the latter would be __builtin_shuffle2.
>>
>> Why??
>> That was the syntax we agreed on that elegantly handles both cases in one place.
>
> If you're going to add vector shuffling builtins, you might consider adding the same builtin that clang has for compatibility:
> http://clang.llvm.org/docs/LanguageExtensions.html#__builtin_shufflevector
>
> It should be straight-forward to map it into the same IR.

Sure.  It doesn't support a vector argument for element selection though,
which I think is required for a mapping to OpenCL shuffle/shuffle2.  That's odd.

Richard.

> -Chris
>



More information about the Gcc-patches mailing list