From 8c7bcf951d60dfb897089bc182d01d0cf4664e97 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 17 May 2015 17:08:16 +0200 Subject: [PATCH] re PR target/66174 (ICE: in extract_insn, at recog.c:2341 (unrecognizable insns) with -ftree-vectorize -mavx512ifma) PR target/66174 * config/i386/i386.c (expand_vec_perm_blend): Enable HImode and QImode inner modes for TARGET_AVX512BW. Force mask operand to a register for AVX512F modes. testsuite/ChangeLog: PR target/66174 * gcc.target/i386/pr66174.c: New test. From-SVN: r223269 --- gcc/ChangeLog | 13 ++++++++++--- gcc/config/i386/i386.c | 34 ++++++++++++++++++++++++++++++---- gcc/testsuite/ChangeLog | 7 ++++++- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87d792d1214..a19c15863c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,9 +1,16 @@ -2015-05-16 Jan HUbicka +2015-05-17 Uros Bizjak + + PR target/66174 + * config/i386/i386.c (expand_vec_perm_blend): Enable HImode and + QImode inner modes for TARGET_AVX512BW. Force mask operand + to a register for AVX512F modes. + +2015-05-16 Jan Hubicka * toplev.c (emit_debug_global_declarations): Do not output debug info when doing slim LTO objects. -2015-05-16 Jan HUbicka +2015-05-16 Jan Hubicka * ipa-utils.h (warn_types_mismatch, odr_or_derived_type_p, odr_types_equivalent_p): Declare. @@ -21,7 +28,7 @@ * tree.h (type_in_anonymous_namespace_p): Remove. * doc/invoke.texi (-Wlto-type-mismatch): Document -2015-05-16 Jan HUbicka +2015-05-16 Jan Hubicka * tree.c (verify_type_variant): Verify tree_base and type_common flags. (verify_type): Verify STRING_FLAG. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index de333d88a88..8d918610567 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -46777,15 +46777,16 @@ expand_vselect_vconcat (rtx target, rtx op0, rtx op1, static bool expand_vec_perm_blend (struct expand_vec_perm_d *d) { - machine_mode vmode = d->vmode; + machine_mode mmode, vmode = d->vmode; unsigned i, mask, nelt = d->nelt; - rtx target, op0, op1, x; + rtx target, op0, op1, maskop, x; rtx rperm[32], vperm; if (d->one_operand_p) return false; if (TARGET_AVX512F && GET_MODE_SIZE (vmode) == 64 - && GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4) + && (TARGET_AVX512BW + || GET_MODE_SIZE (GET_MODE_INNER (vmode)) >= 4)) ; else if (TARGET_AVX2 && GET_MODE_SIZE (vmode) == 32) ; @@ -46959,8 +46960,33 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d) gcc_unreachable (); } + switch (vmode) + { + case V8DFmode: + case V8DImode: + mmode = QImode; + break; + case V16SFmode: + case V16SImode: + mmode = HImode; + break; + case V32HImode: + mmode = SImode; + break; + case V64QImode: + mmode = DImode; + break; + default: + mmode = VOIDmode; + } + + if (mmode != VOIDmode) + maskop = force_reg (mmode, gen_int_mode (mask, mmode)); + else + maskop = GEN_INT (mask); + /* This matches five different patterns with the different modes. */ - x = gen_rtx_VEC_MERGE (vmode, op1, op0, GEN_INT (mask)); + x = gen_rtx_VEC_MERGE (vmode, op1, op0, maskop); x = gen_rtx_SET (target, x); emit_insn (x); if (target != d->target) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5a36566b0e4..552076f9c14 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,10 +1,15 @@ +2015-05-17 Uros Bizjak + + PR target/66174 + * gcc.target/i386/pr66174.c: New test. + 2015-05-17 Thomas Koenig PR fortran/37131 * gfortran.dg/matmul_bounds_6.f90: New test. * gfortran.dg/matmul_bounds_7.f90: New test. -2015-05-16 Jan Hubica +2015-05-16 Jan Hubicka * gfortran.dg/lto/20091028-2_1.c: Fix return value. * gfortran.dg/lto/pr41576_1.f90: Add interface. -- 2.30.2