From 2fd70ec11c4e3661dc4313729cb1a76b1733e79e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 3 May 2016 14:18:57 +0200 Subject: [PATCH] * config/i386/i386.md (*truncdfsf_mixed, *truncdfsf_i387, *truncxfsf2_mixed, *truncxfdf2_mixed): Use v constraint instead of x. * gcc.target/i386/avx512f-cvt-1.c: New test. From-SVN: r235819 --- gcc/ChangeLog | 6 +++ gcc/config/i386/i386.md | 10 ++--- gcc/testsuite/ChangeLog | 4 ++ gcc/testsuite/gcc.target/i386/avx512f-cvt-1.c | 38 +++++++++++++++++++ 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-cvt-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba7f10d6d2a..af475b3ea38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-03 Jakub Jelinek + + * config/i386/i386.md (*truncdfsf_mixed, *truncdfsf_i387, + *truncxfsf2_mixed, *truncxfdf2_mixed): Use v constraint instead + of x. + 2016-05-03 Richard Biener * gimplify.h (get_initialized_tmp_var): Add allow_ssa parameter diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 940dc204be5..be7cfbfd64e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4487,9 +4487,9 @@ (set_attr "mode" "SF")]) (define_insn "*truncdfsf_mixed" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,x ,?f,?x,?*r") + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,v ,?f,?v,?*r") (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "f ,xm,f ,f ,f"))) + (match_operand:DF 1 "nonimmediate_operand" "f ,vm,f ,f ,f"))) (clobber (match_operand:SF 2 "memory_operand" "=X,X ,m ,m ,m"))] "TARGET_MIX_SSE_I387" { @@ -4511,7 +4511,7 @@ (set_attr "mode" "SF")]) (define_insn "*truncdfsf_i387" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?x,?*r") + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?v,?*r") (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f ,f ,f ,f"))) (clobber (match_operand:SF 2 "memory_operand" "=X,m ,m ,m"))] @@ -4573,7 +4573,7 @@ }) (define_insn "*truncxfsf2_mixed" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?x,?*r") + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?v,?*r") (float_truncate:SF (match_operand:XF 1 "register_operand" "f ,f ,f ,f"))) (clobber (match_operand:SF 2 "memory_operand" "=X,m ,m ,m"))] @@ -4587,7 +4587,7 @@ (set_attr "mode" "SF")]) (define_insn "*truncxfdf2_mixed" - [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f,?x,?*r") + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f,?v,?*r") (float_truncate:DF (match_operand:XF 1 "register_operand" "f ,f ,f ,f"))) (clobber (match_operand:DF 2 "memory_operand" "=X,m ,m ,m"))] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5eadd0cc976..020312fa643 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-03 Jakub Jelinek + + * gcc.target/i386/avx512f-cvt-1.c: New test. + 2016-05-03 H.J. Lu * gcc.dg/tree-ssa/ssa-thread-14.c: Replace -fdump-tree-vrp with diff --git a/gcc/testsuite/gcc.target/i386/avx512f-cvt-1.c b/gcc/testsuite/gcc.target/i386/avx512f-cvt-1.c new file mode 100644 index 00000000000..acfbe311aac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-cvt-1.c @@ -0,0 +1,38 @@ +/* { dg-do assemble { target { avx512f && { ! ia32 } } } } */ +/* { dg-options "-O2 -mavx512f -mfpmath=387,sse" } */ + +void +f1 (double *p) +{ + register float x __asm ("xmm16"); + x = *p; + __asm volatile ("" : "+v" (x)); +} + +void +f2 (void) +{ + double d; + register float x __asm ("xmm16"); + __asm volatile ("" : "=t" (d)); + x = d; + __asm volatile ("" : "+v" (x)); +} + +void +f3 (long double *p) +{ + register float x __asm ("xmm16"); + x = *p; + __asm volatile ("" : "+v" (x)); +} + +void +f4 (void) +{ + long double d; + register float x __asm ("xmm16"); + __asm volatile ("" : "=t" (d)); + x = d; + __asm volatile ("" : "+v" (x)); +} -- 2.30.2