Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-06-04 Thread Richard Henderson
On 06/04/2014 02:23 PM, Evgeny Stupachenko wrote: > Thanks. Moving pattern down helps. Now make check for the following > patch passed: Excellent. This version looks good. r~

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-06-04 Thread Evgeny Stupachenko
Thanks. Moving pattern down helps. Now make check for the following patch passed: diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 2ef1384..8266f3e 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1417,6 +1417,22 @@ return true;

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-06-04 Thread Richard Henderson
On 06/04/2014 10:06 AM, Evgeny Stupachenko wrote: > Is it ok to use the following pattern? > > patch passed bootstrap and make check, but one test failed: > gcc/testsuite/gcc.target/i386/vect-rebuild.c > It failed on /* { dg-final { scan-assembler-times "\tv?permilpd\[ \t\]" 1 } } > */ > which is

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-06-04 Thread Evgeny Stupachenko
Is it ok to use the following pattern? patch passed bootstrap and make check, but one test failed: gcc/testsuite/gcc.target/i386/vect-rebuild.c It failed on /* { dg-final { scan-assembler-times "\tv?permilpd\[ \t\]" 1 } } */ which is now palignr. However, both palignr and permilpd costs 1 tick and

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-05-19 Thread Richard Henderson
On 05/05/2014 09:54 AM, Evgeny Stupachenko wrote: > @@ -42943,6 +42944,10 @@ expand_vec_perm_1 (struct expand_vec_perm_d *d) >if (expand_vec_perm_vpermil (d)) > return true; > > + /* Try palignr on one operand. */ > + if (d->one_operand_p && expand_vec_perm_palignr (d)) > +return t

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-05-19 Thread Evgeny Stupachenko
Ping. On Mon, May 5, 2014 at 8:54 PM, Evgeny Stupachenko wrote: > Assuming first part of the patch is committed. Is the following patch > ok? It passes bootstrap and make check. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index 91f6f21..475448e 100644 > --- a/gcc/config/i38

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-05-05 Thread Evgeny Stupachenko
Assuming first part of the patch is committed. Is the following patch ok? It passes bootstrap and make check. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 91f6f21..475448e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -42808,6 +42808,7 @@ expand_vec_perm

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-30 Thread Evgeny Stupachenko
On Tue, Apr 29, 2014 at 9:39 PM, Richard Henderson wrote: > On 04/29/2014 10:13 AM, Evgeny Stupachenko wrote: >> + /* For a rotaion permutation with one operand like: {5 6 7 0 1 2 3 4} >> + PALIGNR is better than PSHUFB. Check for a rotation in permutation. >> */ >> + for (i = 0; i < nelt

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Richard Henderson
On 04/29/2014 10:13 AM, Evgeny Stupachenko wrote: > + /* For a rotaion permutation with one operand like: {5 6 7 0 1 2 3 4} > + PALIGNR is better than PSHUFB. Check for a rotation in permutation. */ > + for (i = 0; i < nelt; ++i) > +if d->perm[(i + 1) & (nelt - 1)] - d->perm[i])) &

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Jakub Jelinek
On Tue, Apr 29, 2014 at 07:58:39AM -0700, H.J. Lu wrote: > On Tue, Apr 29, 2014 at 6:50 AM, Evgeny Stupachenko > wrote: > > The patch adds use of palignr instruction, when we have one operand > > permutation like: > > {5 6 7 0 1 2 3 4}: > > > > Treating this as {5 6 7 8 9 a b c} on 2 operands, an

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Evgeny Stupachenko
Thanks. The path is fixed according to your comments: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 002d295..aa6372a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -42807,6 +42807,79 @@ expand_vec_perm_pshufb (struct expand_vec_perm_d *d) return true;

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Evgeny Stupachenko
On Tue, Apr 29, 2014 at 6:58 PM, H.J. Lu wrote: > On Tue, Apr 29, 2014 at 6:50 AM, Evgeny Stupachenko > wrote: >> Hi, >> >> The patch adds use of palignr instruction, when we have one operand >> permutation like: >> {5 6 7 0 1 2 3 4}: >> >> Treating this as {5 6 7 8 9 a b c} on 2 operands, and t

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Richard Henderson
On 04/29/2014 06:50 AM, Evgeny Stupachenko wrote: > + if (d->one_operand_p != true) > +return false; This looks odd. Better as !d->one_operand_p. > + > + /* For an in order permutation with one operand like: {5 6 7 0 1 2 3 4} > + PALIGNR is better than PSHUFB. Check for an order in pe

Re: [PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread H.J. Lu
On Tue, Apr 29, 2014 at 6:50 AM, Evgeny Stupachenko wrote: > Hi, > > The patch adds use of palignr instruction, when we have one operand > permutation like: > {5 6 7 0 1 2 3 4}: > > Treating this as {5 6 7 8 9 a b c} on 2 operands, and therefore palignr on 5. > > Bootstrap and make check passed. >

[PATCH 2/2, x86] Add palignr support for AVX2.

2014-04-29 Thread Evgeny Stupachenko
Hi, The patch adds use of palignr instruction, when we have one operand permutation like: {5 6 7 0 1 2 3 4}: Treating this as {5 6 7 8 9 a b c} on 2 operands, and therefore palignr on 5. Bootstrap and make check passed. Is it ok? Evgeny 2014-04-29 Evgeny Stupachenko * config/i386/