i386.c (expand_vec_perm_vperm2f128): Canonicalize dfirst permutation.
authorJakub Jelinek <jakub@redhat.com>
Wed, 1 Oct 2014 20:41:05 +0000 (22:41 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 1 Oct 2014 20:41:05 +0000 (22:41 +0200)
* config/i386/i386.c (expand_vec_perm_vperm2f128): Canonicalize
dfirst permutation.

From-SVN: r215777

gcc/ChangeLog
gcc/config/i386/i386.c

index 04637b05527c46b2e008e0c478551a557e93a070..54b6b0b2dc076595cc669b3fb60a885952d3bb6d 100644 (file)
@@ -1,5 +1,8 @@
 2014-10-01  Jakub Jelinek  <jakub@redhat.com>
 
+       * config/i386/i386.c (expand_vec_perm_vperm2f128): Canonicalize
+       dfirst permutation.
+
        PR target/63428
        * config/i386/i386.c (expand_vec_perm_pshufb): Fix up rperm[0]
        argument to avx2_permv2ti.
index 84484bb25128a7fcbac463e129fc7d248927a3e2..b40852d3b6bb0f8ce3256ab518124a441a6cf92b 100644 (file)
@@ -43874,15 +43874,16 @@ expand_vec_perm_vperm2f128 (struct expand_vec_perm_d *d)
            dfirst.perm[i] = (i & (nelt2 - 1))
                             + ((perm >> (2 * (i >= nelt2))) & 3) * nelt2;
 
+         canonicalize_perm (&dfirst);
          ok = expand_vec_perm_1 (&dfirst);
          gcc_assert (ok);
 
          /* And dsecond is some single insn shuffle, taking
             d->op0 and result of vperm2f128 (if perm < 16) or
             d->op1 and result of vperm2f128 (otherwise).  */
-         dsecond.op1 = dfirst.target;
          if (perm >= 16)
-           dsecond.op0 = dfirst.op1;
+           dsecond.op0 = dsecond.op1;
+         dsecond.op1 = dfirst.target;
 
          ok = expand_vec_perm_1 (&dsecond);
          gcc_assert (ok);