re PR target/70300 (ICE: in extract_constrain_insn, at recog.c:2190 (insn does not...
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Mar 2016 08:14:24 +0000 (09:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 22 Mar 2016 08:14:24 +0000 (09:14 +0100)
PR target/70300
* config/i386/i386.md (cvtsd2ss splitter): Unpack in destination
instead of source if operands[1] is xmm16 and above and
!TARGET_AVX512VL.  Use avx512f_vec_dupv16sf_1 instead of
vec_interleave_lowv4sf if we need to unpack xmm16 and above.

* gcc.target/i386/pr70300.c: New test.

From-SVN: r234393

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr70300.c [new file with mode: 0644]

index 5193c97ecb71f15c5cd68aa0098dbfde6179742d..f5687a507e53578f6cbb01c67cda646af746484b 100644 (file)
@@ -1,5 +1,11 @@
 2016-03-22  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/70300
+       * config/i386/i386.md (cvtsd2ss splitter): Unpack in destination
+       instead of source if operands[1] is xmm16 and above and
+       !TARGET_AVX512VL.  Use avx512f_vec_dupv16sf_1 instead of
+       vec_interleave_lowv4sf if we need to unpack xmm16 and above.
+
        PR c++/70295
        * gimplify.c (gimplify_modify_expr): Call gimple_set_no_warning
        on assign if (*from_p) is a comparison, set it to
index 90fec1b289401501bf41e1bfa41ee2f2a6d059e5..dcaef8439004831901479f30e8ea17ef75196e68 100644 (file)
     {
       /* If it is unsafe to overwrite upper half of source, we need
         to move to destination and unpack there.  */
-      if ((ORIGINAL_REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
-          || PSEUDO_REGNO_BYTES (ORIGINAL_REGNO (operands[1])) > 4)
-         && true_regnum (operands[0]) != true_regnum (operands[1]))
+      if (((ORIGINAL_REGNO (operands[1]) < FIRST_PSEUDO_REGISTER
+           || PSEUDO_REGNO_BYTES (ORIGINAL_REGNO (operands[1])) > 4)
+          && true_regnum (operands[0]) != true_regnum (operands[1]))
+         || (EXT_REX_SSE_REG_P (operands[1])
+             && !TARGET_AVX512VL))
        {
          rtx tmp = gen_rtx_REG (SFmode, true_regnum (operands[0]));
          emit_move_insn (tmp, operands[1]);
        }
       else
        operands[3] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0);
-      emit_insn (gen_vec_interleave_lowv4sf (operands[3], operands[3],
-                                            operands[3]));
+      /* FIXME: vec_interleave_lowv4sf for AVX512VL should allow
+        =v, v, then vbroadcastss will be only needed for AVX512F without
+        AVX512VL.  */
+      if (!EXT_REX_SSE_REGNO_P (true_regnum (operands[3])))
+       emit_insn (gen_vec_interleave_lowv4sf (operands[3], operands[3],
+                                              operands[3]));
+      else
+       {
+         rtx tmp = simplify_gen_subreg (V16SFmode, operands[3], V4SFmode, 0);
+         emit_insn (gen_avx512f_vec_dupv16sf_1 (tmp, tmp));
+       }
     }
   else
     emit_insn (gen_vec_setv4sf_0 (operands[3],
index 25a36ddbc207885f591e77c8bd86c60d288f6929..aad5d3f241eb179231a3c5abf938ea84a3ca06b0 100644 (file)
@@ -1,5 +1,8 @@
 2016-03-22  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/70300
+       * gcc.target/i386/pr70300.c: New test.
+
        PR c++/70295
        * c-c++-common/nonnull-1.c (func): Remove parens around cp4 != 0.
        (func2): New function for cond with parens, xfail warning for c++.
diff --git a/gcc/testsuite/gcc.target/i386/pr70300.c b/gcc/testsuite/gcc.target/i386/pr70300.c
new file mode 100644 (file)
index 0000000..ddfadfb
--- /dev/null
@@ -0,0 +1,25 @@
+/* PR target/70300 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=amdfam10 -mavx512f" } */
+
+typedef _Complex A __attribute__ ((mode (SC)));
+typedef _Complex B __attribute__ ((mode (DC)));
+typedef _Complex C __attribute__ ((mode (TC)));
+
+C
+foo (A a, B b, C c, A d, B e, C f)
+{
+  b -= a;
+  d += a;
+  a += f;
+  return a + b + d + e;
+}
+
+__attribute__((target ("avx512vl"))) C
+bar (A a, B b, C c, A d, B e, C f)
+{
+  b -= a;
+  d += a;
+  a += f;
+  return a + b + d + e;
+}