summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-22 08:14:24 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-22 08:14:24 +0000
commitb6436f79be2592584b911fa8393e26980058d086 (patch)
tree3ced0e28bf89f76feeb6fa38480fa88f1ba0ee69
parent3d78ea44f3ba437bb5cedca8e3ddaad1bd69eb87 (diff)
downloadgcc-b6436f79be2592584b911fa8393e26980058d086.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234393 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.md21
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70300.c25
4 files changed, 50 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5193c97ecb7..f5687a507e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 90fec1b2894..dcaef843900 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -4229,17 +4229,28 @@
{
/* 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],
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 25a36ddbc20..aad5d3f241e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..ddfadfb5957
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70300.c
@@ -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;
+}