diff mbox

[x86] Improves x86 permutation expand

Message ID CAOvf_xzoitm4Dt+vzdyigaRWxy0y_9V9JLTORoA0FjiAmL=4mA@mail.gmail.com
State New
Headers show

Commit Message

Evgeny Stupachenko July 3, 2014, 8:57 a.m. UTC
The following patch should fix 61618
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61618


Evgeny

On Mon, Jun 9, 2014 at 11:49 PM, Richard Henderson <rth@redhat.com> wrote:
> On 06/09/2014 12:10 PM, Evgeny Stupachenko wrote:
>> Nice catch.
>> Patch with corresponding changes:
>
> Looks ok with an appropriate changelog.
>
>
> r~

Comments

Uros Bizjak July 4, 2014, 11:20 a.m. UTC | #1
On Thu, Jul 3, 2014 at 10:57 AM, Evgeny Stupachenko <evstupac@gmail.com> wrote:
> The following patch should fix 61618
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61618
>
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index 8046c67..2cffcef 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -43211,12 +43211,10 @@ expand_vec_perm_pblendv (struct expand_vec_perm_d *d)
>    bool ok;
>
>    /* Use the same checks as in expand_vec_perm_blend, but skipping
> -     AVX2 as it requires more than 2 instructions for general case.  */
> +     AVX float case and AVX2 as they require more than 2 instructions.  */
>    if (d->one_operand_p)
>      return false;
> -  if (TARGET_AVX && (vmode == V4DFmode || vmode == V8SFmode))
> -    ;
> -  else if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
> +  if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
>      ;
>    else
>      return false;

ChangeLog entry is missing.

Uros.
Evgeny Stupachenko July 4, 2014, 12:49 p.m. UTC | #2
2014-07-04  Evgeny Stupachenko  <evstupac@gmail.com>

        * config/i386/i386.c (expand_vec_perm_pblendv): Disable for AVX.


On Fri, Jul 4, 2014 at 3:20 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Jul 3, 2014 at 10:57 AM, Evgeny Stupachenko <evstupac@gmail.com> wrote:
>> The following patch should fix 61618
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61618
>>
>> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
>> index 8046c67..2cffcef 100644
>> --- a/gcc/config/i386/i386.c
>> +++ b/gcc/config/i386/i386.c
>> @@ -43211,12 +43211,10 @@ expand_vec_perm_pblendv (struct expand_vec_perm_d *d)
>>    bool ok;
>>
>>    /* Use the same checks as in expand_vec_perm_blend, but skipping
>> -     AVX2 as it requires more than 2 instructions for general case.  */
>> +     AVX float case and AVX2 as they require more than 2 instructions.  */
>>    if (d->one_operand_p)
>>      return false;
>> -  if (TARGET_AVX && (vmode == V4DFmode || vmode == V8SFmode))
>> -    ;
>> -  else if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
>> +  if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
>>      ;
>>    else
>>      return false;
>
> ChangeLog entry is missing.
>
> Uros.
Uros Bizjak July 4, 2014, 1:16 p.m. UTC | #3
On Fri, Jul 4, 2014 at 2:49 PM, Evgeny Stupachenko <evstupac@gmail.com> wrote:
> 2014-07-04  Evgeny Stupachenko  <evstupac@gmail.com>
>
>         * config/i386/i386.c (expand_vec_perm_pblendv): Disable for AVX.

Please mention PR target/61618 above.

>>> The following patch should fix 61618
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61618
>>>
>>> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
>>> index 8046c67..2cffcef 100644
>>> --- a/gcc/config/i386/i386.c
>>> +++ b/gcc/config/i386/i386.c
>>> @@ -43211,12 +43211,10 @@ expand_vec_perm_pblendv (struct expand_vec_perm_d *d)
>>>    bool ok;
>>>
>>>    /* Use the same checks as in expand_vec_perm_blend, but skipping
>>> -     AVX2 as it requires more than 2 instructions for general case.  */
>>> +     AVX float case and AVX2 as they require more than 2 instructions.  */

Just say:

AVX and AVX2, as they require ...

OK with these changes.

Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8046c67..2cffcef 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -43211,12 +43211,10 @@  expand_vec_perm_pblendv (struct expand_vec_perm_d *d)
   bool ok;

   /* Use the same checks as in expand_vec_perm_blend, but skipping
-     AVX2 as it requires more than 2 instructions for general case.  */
+     AVX float case and AVX2 as they require more than 2 instructions.  */
   if (d->one_operand_p)
     return false;
-  if (TARGET_AVX && (vmode == V4DFmode || vmode == V8SFmode))
-    ;
-  else if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
+  if (TARGET_SSE4_1 && GET_MODE_SIZE (vmode) == 16)
     ;
   else
     return false;