diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f91bb11053..b7140a60545 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,10 @@ -2016-03-08 Jakub Jelinek +2016-03-09 Jakub Jelinek + + PR target/70086 + * config/i386/i386.md (truncdfsf2 splitter): Use gen_vec_concatv2df + instead of gen_sse2_loadlpd. + * config/i386/sse.md (*vec_concatv2df): Rename to... + (vec_concatv2df): ... this. PR tree-optimization/70127 * fold-const.c (operand_equal_p): Revert the 2015-10-28 change. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index cb8bcecf630..554e6239fda 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4393,8 +4393,8 @@ emit_insn (gen_vec_dupv2df (operands[4], operands[1])); } else - emit_insn (gen_sse2_loadlpd (operands[4], - CONST0_RTX (V2DFmode), operands[1])); + emit_insn (gen_vec_concatv2df (operands[4], operands[1], + CONST0_RTX (DFmode))); }) ;; It's more profitable to split and then extend in the same register. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 00e385aee2a..3c521b367f9 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -8951,7 +8951,7 @@ (set_attr "prefix" "orig,maybe_vex,evex") (set_attr "mode" "V2DF,DF,DF")]) -(define_insn "*vec_concatv2df" +(define_insn "vec_concatv2df" [(set (match_operand:V2DF 0 "register_operand" "=x,x,v,x,v,x,x,v,x,x") (vec_concat:V2DF (match_operand:DF 1 "nonimmediate_operand" " 0,x,v,m,m,0,x,m,0,0") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e611b29be0f..e2db34d170e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2016-03-08 Jakub Jelinek +2016-03-09 Jakub Jelinek + + PR target/70086 + * gcc.target/i386/pr70086-1.c: New test. + * gcc.target/i386/pr70086-2.c: New test. + * gcc.target/i386/pr70086-3.c: New test. PR tree-optimization/70127 * gcc.c-torture/execute/pr70127.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr70086-1.c b/gcc/testsuite/gcc.target/i386/pr70086-1.c new file mode 100644 index 00000000000..7289798a4f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70086-1.c @@ -0,0 +1,11 @@ +/* PR target/70086 */ +/* { dg-do compile } */ +/* { dg-options "-mtune=barcelona -mavx512vl -ffloat-store" } */ + +float +foo (float a, float b, double c, float d, double e, float f) +{ + e -= d; + d *= e; + return e + d; +} diff --git a/gcc/testsuite/gcc.target/i386/pr70086-2.c b/gcc/testsuite/gcc.target/i386/pr70086-2.c new file mode 100644 index 00000000000..b613d5441c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70086-2.c @@ -0,0 +1,21 @@ +/* PR target/70086 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -mtune=barcelona -mavx512vl" } */ + +float +foo (double *p) +{ + register float xmm16 __asm ("xmm16"); + xmm16 = *p; + asm volatile ("" : "+v" (xmm16)); + return xmm16; +} + +float +bar (double x) +{ + register float xmm16 __asm ("xmm16"); + xmm16 = x; + asm volatile ("" : "+v" (xmm16)); + return xmm16; +} diff --git a/gcc/testsuite/gcc.target/i386/pr70086-3.c b/gcc/testsuite/gcc.target/i386/pr70086-3.c new file mode 100644 index 00000000000..ae523a95b49 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70086-3.c @@ -0,0 +1,21 @@ +/* PR target/70086 */ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -mtune=barcelona -mavx512f -mno-avx512vl" } */ + +float +foo (double *p) +{ + register float xmm16 __asm ("xmm16"); + xmm16 = *p; + asm volatile ("" : "+v" (xmm16)); + return xmm16; +} + +float +bar (double x) +{ + register float xmm16 __asm ("xmm16"); + xmm16 = x; + asm volatile ("" : "+v" (xmm16)); + return xmm16; +}