From: H.J. Lu Date: Thu, 9 Jul 2020 21:56:48 +0000 (-0700) Subject: x86: Check TARGET_AVX512VL when enabling FMA X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6645a826f58b68f68dff30e6e6e78542099d0cc;p=gcc.git 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 --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