On Wed, Aug 15, 2018 at 6:33 AM, Jeff Law <l...@redhat.com> wrote: > On 08/11/2018 03:54 AM, Allan Sandfeld Jensen wrote: >> On Samstag, 11. August 2018 11:18:39 CEST Jakub Jelinek wrote: >>> On Sat, Aug 11, 2018 at 10:59:26AM +0200, Allan Sandfeld Jensen wrote: >>>> +/* A subroutine of ix86_expand_vec_perm_builtin_1. Try to implement D >>>> + using movss or movsd. */ >>>> +static bool >>>> +expand_vec_perm_movs (struct expand_vec_perm_d *d) >>>> +{ >>>> + machine_mode vmode = d->vmode; >>>> + unsigned i, nelt = d->nelt; >>>> + rtx x; >>>> + >>>> + if (d->one_operand_p) >>>> + return false; >>>> + >>>> + if (TARGET_SSE2 && (vmode == V2DFmode || vmode == V4SFmode)) >>>> + ; >>>> + else >>>> + return false; >>>> + >>>> + /* Only the first element is changed. */ >>> >>> Two spaces after . >>> >>>> + if (d->perm[0] != nelt && d->perm[0] != 0) >>>> + return false; >>>> + for (i = 1; i < nelt; ++i) { >>>> + { >>>> + if (d->perm[i] != i + nelt - d->perm[0]) >>>> + return false; >>>> + } >>>> + } >>> >>> Extraneous {}s (both pairs, the outer ones even badly indented). >>> >>> Otherwise LGTM. >>> >> Updated: >> >> Note as an infrequent contributor don't have commit access, so I need someone >> reviewing to also commit. > I fixed up the ChangeLog, extracted the test from the original patch and > committed all the bits to the trunk.
I have amended the committed code with attached fixup patch. 2018-08-15 Uros Bizjak <ubiz...@gmail.com> * config/i386/i386.c (expand_vec_perm_movs): Enable V4SFmode for TARGET_SSE. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros.
Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 263563) +++ config/i386/i386.c (working copy) @@ -46157,9 +46157,8 @@ expand_vec_perm_movs (struct expand_vec_perm_d *d) if (d->one_operand_p) return false; - if (TARGET_SSE2 && (vmode == V2DFmode || vmode == V4SFmode)) - ; - else + if (!(TARGET_SSE && vmode == V4SFmode) + && !(TARGET_SSE2 && vmode == V2DFmode)) return false; /* Only the first element is changed. */