From 568bac8c8ad9fc10a6f6b2ac191483585d07ffa5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 5 May 2016 15:29:54 +0200 Subject: [PATCH] sse.md (_fmadd__mask3): Use v constraint instead of x. * config/i386/sse.md (_fmadd__mask3): Use v constraint instead of x. * gcc.target/i386/avx512f-vfmadd-1.c: New test. From-SVN: r235921 --- gcc/ChangeLog | 5 ++++ gcc/config/i386/sse.md | 4 +-- gcc/testsuite/ChangeLog | 2 ++ .../gcc.target/i386/avx512f-vfmadd-1.c | 27 +++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-vfmadd-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba7f398b889..f807a322b1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-05 Jakub Jelinek + + * config/i386/sse.md (_fmadd__mask3): Use + v constraint instead of x. + 2016-05-05 Alan Modra PR target/68662 diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 5fd821bebb3..53de92c2f00 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -3327,10 +3327,10 @@ (set_attr "mode" "")]) (define_insn "_fmadd__mask3" - [(set (match_operand:VF_AVX512VL 0 "register_operand" "=x") + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") (vec_merge:VF_AVX512VL (fma:VF_AVX512VL - (match_operand:VF_AVX512VL 1 "register_operand" "x") + (match_operand:VF_AVX512VL 1 "register_operand" "v") (match_operand:VF_AVX512VL 2 "nonimmediate_operand" "") (match_operand:VF_AVX512VL 3 "register_operand" "0")) (match_dup 3) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7eefd9445a3..9800885e581 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2016-05-05 Jakub Jelinek + * gcc.target/i386/avx512f-vfmadd-1.c: New test. + * c-c++-common/Wdangling-else-4.c: New test. 2016-05-04 Jakub Jelinek diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vfmadd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vfmadd-1.c new file mode 100644 index 00000000000..f317ec66a3a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-vfmadd-1.c @@ -0,0 +1,27 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -mavx512f" } */ + +#include + +void +f1 (__m512d x, __m512d y, __m512d z, __mmask8 m) +{ + register __m512d a __asm ("xmm16"), b __asm ("xmm17"), c __asm ("xmm18"); + a = x; b = y; c = z; + asm volatile ("" : "+v" (a), "+v" (b), "+v" (c)); + a = _mm512_mask3_fmadd_round_pd (c, b, a, m, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + asm volatile ("" : "+v" (a)); +} + +void +f2 (__m512 x, __m512 y, __m512 z, __mmask8 m) +{ + register __m512 a __asm ("xmm16"), b __asm ("xmm17"), c __asm ("xmm18"); + a = x; b = y; c = z; + asm volatile ("" : "+v" (a), "+v" (b), "+v" (c)); + a = _mm512_mask3_fmadd_round_ps (c, b, a, m, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + asm volatile ("" : "+v" (a)); +} + +/* { dg-final { scan-assembler "vfmadd231pd\[^\n\r\]*zmm16" } } */ +/* { dg-final { scan-assembler "vfmadd231ps\[^\n\r\]*zmm16" } } */ -- 2.30.2