[Bug target/66174] [6 Regression] ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat May 16 17:38:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66174

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Untested patch:

--cut here--
Index: i386.c
===================================================================
--- i386.c      (revision 223231)
+++ i386.c      (working copy)
@@ -46780,12 +46780,14 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d
   machine_mode vmode = d->vmode;
   unsigned i, mask, nelt = d->nelt;
   rtx target, op0, op1, x;
+  rtx maskop;
   rtx rperm[32], vperm;

   if (d->one_operand_p)
     return false;
   if (TARGET_AVX512F && GET_MODE_SIZE (vmode) == 64
-      && GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4)
+      && (TARGET_AVX512BW
+         || GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4))
     ;
   else if (TARGET_AVX2 && GET_MODE_SIZE (vmode) == 32)
     ;
@@ -46959,8 +46961,28 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d
       gcc_unreachable ();
     }

+  switch (vmode)
+    {
+    case V8DFmode:
+    case V8DImode:
+      maskop = force_reg (QImode, gen_int_mode (mask, QImode));
+      break;
+    case V16SFmode:
+    case V16SImode:
+      maskop = force_reg (HImode, gen_int_mode (mask, HImode));
+      break;
+    case V32HImode:
+      maskop = force_reg (SImode, gen_int_mode (mask, SImode));
+      break;
+    case V64QImode:
+      maskop = force_reg (DImode, gen_int_mode (mask, DImode));
+      break;
+    default:
+      maskop = GEN_INT (mask);
+    }
+
   /* This matches five different patterns with the different modes.  */
-  x = gen_rtx_VEC_MERGE (vmode, op1, op0, GEN_INT (mask));
+  x = gen_rtx_VEC_MERGE (vmode, op1, op0, maskop);
   x = gen_rtx_SET (target, x);
   emit_insn (x);
   if (target != d->target)
--cut here--


More information about the Gcc-bugs mailing list