public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/gccgo] x86: Check TARGET_AVX512VL when enabling FMA
@ 2020-07-12 20:33 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2020-07-12 20:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a6645a826f58b68f68dff30e6e6e78542099d0cc

commit a6645a826f58b68f68dff30e6e6e78542099d0cc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 14:56:48 2020 -0700

    x86: Check TARGET_AVX512VL when enabling FMA
    
    Check TARGET_AVX512VL when enabling FMA to avoid
    
    gcc.target/i386/avx512er-vrsqrt28ps-3.c:25:1: error: unrecognizable insn:
    (insn 29 28 30 6 (set (reg:V8SF 108)
            (fma:V8SF (reg:V8SF 106)
                (reg:V8SF 105)
                (reg:V8SF 110)))
    
    when TARGET_AVX512VL isn't enabled.
    
            PR target/96144
            * config/i386/i386-expand.c (ix86_emit_swsqrtsf): Check
            TARGET_AVX512VL when enabling FMA.

Diff:
---
 gcc/config/i386/i386-expand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 49718b7a41c..e194214804b 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -15540,7 +15540,10 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, machine_mode mode, bool recip)
   /* e0 = x0 * a */
   emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, a)));
 
-  if (TARGET_FMA || TARGET_AVX512F)
+  unsigned vector_size = GET_MODE_SIZE (mode);
+  if (TARGET_FMA
+      || (TARGET_AVX512F && vector_size == 64)
+      || (TARGET_AVX512VL && (vector_size == 32 || vector_size == 16)))
     emit_insn (gen_rtx_SET (e2,
 			    gen_rtx_FMA (mode, e0, x0, mthree)));
   else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-12 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 20:33 [gcc/devel/gccgo] x86: Check TARGET_AVX512VL when enabling FMA Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).