This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Vector shuffling
- From: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Richard Guenther <richard dot guenther at gmail dot com>, Duncan Sands <baldrick at free dot fr>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Oct 2011 16:18:47 +0100
- Subject: Re: Vector shuffling
- References: <CABYV9SU02gncjg=AqMWTqJ-W=4GZM-x83RXiyQdPnVWyHSEgfQ@mail.gmail.com> <Pine.LNX.4.64.1109021948010.25938@digraph.polyomino.org.uk> <CABYV9SWmdR1crm=vLuGCCMZNWv7aESqVMscn=M4yeUP=W-AVHQ@mail.gmail.com> <CABYV9SU1KsFTvPfRjZpwH8joTPKJ6aFEWgwmy=_P9PrxFCKv=g@mail.gmail.com> <4E724C78.6020006@redhat.com> <CABYV9SV5kHMxRK5g3XRhVDysG=Nu-Szb_oOOsaMSudXXP0K8xg@mail.gmail.com> <4E83332D.1010002@redhat.com> <CABYV9SX+SDBg9JK7k25n7XAmcRQ+E8ij9bOOC0_s_2b0eZEvDA@mail.gmail.com> <4E848D45.5000001@redhat.com> <CABYV9SXaJJT6urtc3RpOLfqNiCe_SAfht=1CESJpQgtgtY4Xmw@mail.gmail.com> <4E86080A.7000009@redhat.com> <CABYV9SUgjeeD58LqELHr38GGvwZUcEndXqxdoR5xM_gtaUC1Kg@mail.gmail.com> <4E863399.6020803@redhat.com> <CABYV9SUt+mFr3XQLHnzJevBmovkop92tSRDnR9j4U7bOuDWuew@mail.gmail.com> <CABYV9SWznzBp=bTpeNJuP-ThP-b_wOGQuvV-9V7-NJoZ_9LFUA@mail.gmail.com> <4E89D11A.1020707@redhat.com> <CABYV9SV3ErQr=dE0tRTN+M__NiX7YLzE+c6XEhu-eHU8SaNr4Q@mail.gmail.com> <4E89ED00.3080002@redhat.com> <CABYV9SW_krtcEK_V21uaN7YgfRwU-Td+fGh7Q_-7Ha0VgHArSA@mail.gmail.com>
Ping.
Richard, the patch in the attachment should be submitted asap. The
other problem could wait for a while.
Thanks,
Artem.
On Tue, Oct 4, 2011 at 12:04 AM, Artem Shinkarov
<artyom.shinkaroff@gmail.com> wrote:
> On Mon, Oct 3, 2011 at 6:12 PM, Richard Henderson <rth@redhat.com> wrote:
>> On 10/03/2011 09:43 AM, Artem Shinkarov wrote:
>>> Hi, Richard
>>>
>>> There is a problem with the testcases of the patch you have committed
>>> for me. The code in every test-case is doubled. Could you please,
>>> apply the following patch, otherwise it would fail all the tests from
>>> the vector-shuffle-patch would fail.
>>
>> Huh. ?Dunno what happened there. ?Fixed.
>>
>>> Also, if it is possible, could you change my name from in the
>>> ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last
>>> version is the way I am spelled in the passport, and the name I use in
>>> the ChangeLog.
>>
>> Fixed.
>>
>>
>> r~
>>
>
> Richard, there was a problem causing segfault in ix86_expand_vshuffle
> which I have fixed with the patch attached.
>
> Another thing I cannot figure out is the following case:
> #define vector(elcount, type) ?\
> __attribute__((vector_size((elcount)*sizeof(type)))) type
>
> vector (8, short) __attribute__ ((noinline))
> f (vector (8, short) x, vector (8, short) y, vector (8, short) mask) {
> ? ?return ?__builtin_shuffle (x, y, mask);
> }
>
> int main (int argc, char *argv[]) {
> ? ?vector (8, short) v0 = {argc, 1,2,3,4,5,6,7};
> ? ?vector (8, short) v1 = {argc, 1,argc,3,4,5,argc,7};
> ? ?vector (8, short) mask0 = {0,2,3,1,4,5,6,7};
> ? ?vector (8, short) v2;
> ? ?int i;
>
> ? ?v2 = f (v0, v1, ?mask0);
> ? ?/* v2 = ?__builtin_shuffle (v0, v1, mask0); */
> ? ?for (i = 0; i < 8; i ++)
> ? ? ?__builtin_printf ("%i, ", v2[i]);
>
> ? ?return 0;
> }
>
> I am compiling with support of ssse3, in my case it is ./xgcc -B. b.c
> -O3 -mtune=core2 -march=core2
>
> And I get 1, 1, 1, 3, 4, 5, 1, 7, on the output, which is wrong.
>
> But if I will call __builtin_shuffle directly, then the answer is correct.
>
> Any ideas?
>
>
> Thanks,
> Artem.
>