From 4262839e12747458dddc905525271e115e3bfe83 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 3 Oct 2014 20:19:12 +0200 Subject: [PATCH] i386.c (ix86_expand_vec_perm_vpermi2): Fix up formatting. * config/i386/i386.c (ix86_expand_vec_perm_vpermi2): Fix up formatting. (ix86_expand_vec_perm): Only call ix86_expand_vec_perm_vpermi2 if TARGET_AVX512F. (expand_vec_perm_1): Likewise. From-SVN: r215868 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 42 ++++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 708dca159b7..7e1272c82c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-10-03 Jakub Jelinek + + * config/i386/i386.c (ix86_expand_vec_perm_vpermi2): Fix up formatting. + (ix86_expand_vec_perm): Only call ix86_expand_vec_perm_vpermi2 if + TARGET_AVX512F. + (expand_vec_perm_1): Likewise. + 2014-10-03 Jakub Jelinek Uros Bizjak diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2f36c52507d..ed8fe2d9209 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -21373,21 +21373,23 @@ ix86_expand_vec_perm_vpermi2 (rtx target, rtx op0, rtx mask, rtx op1) { case V16SImode: emit_insn (gen_avx512f_vpermi2varv16si3 (target, op0, - force_reg (V16SImode, mask), - op1)); + force_reg (V16SImode, mask), + op1)); return true; case V16SFmode: emit_insn (gen_avx512f_vpermi2varv16sf3 (target, op0, - force_reg (V16SImode, mask), - op1)); + force_reg (V16SImode, mask), + op1)); return true; case V8DImode: emit_insn (gen_avx512f_vpermi2varv8di3 (target, op0, - force_reg (V8DImode, mask), op1)); + force_reg (V8DImode, mask), + op1)); return true; case V8DFmode: emit_insn (gen_avx512f_vpermi2varv8df3 (target, op0, - force_reg (V8DImode, mask), op1)); + force_reg (V8DImode, mask), + op1)); return true; default: return false; @@ -21414,7 +21416,8 @@ ix86_expand_vec_perm (rtx operands[]) e = GET_MODE_UNIT_SIZE (mode); gcc_assert (w <= 64); - if (ix86_expand_vec_perm_vpermi2 (target, op0, mask, op1)) + if (TARGET_AVX512F + && ix86_expand_vec_perm_vpermi2 (target, op0, mask, op1)) return; if (TARGET_AVX2) @@ -43231,17 +43234,20 @@ expand_vec_perm_1 (struct expand_vec_perm_d *d) return true; /* Try the AVX512F vpermi2 instructions. */ - rtx vec[64]; - enum machine_mode mode = d->vmode; - if (mode == V8DFmode) - mode = V8DImode; - else if (mode == V16SFmode) - mode = V16SImode; - for (i = 0; i < nelt; ++i) - vec[i] = GEN_INT (d->perm[i]); - rtx mask = gen_rtx_CONST_VECTOR (mode, gen_rtvec_v (nelt, vec)); - if (ix86_expand_vec_perm_vpermi2 (d->target, d->op0, mask, d->op1)) - return true; + if (TARGET_AVX512F) + { + rtx vec[64]; + enum machine_mode mode = d->vmode; + if (mode == V8DFmode) + mode = V8DImode; + else if (mode == V16SFmode) + mode = V16SImode; + for (i = 0; i < nelt; ++i) + vec[i] = GEN_INT (d->perm[i]); + rtx mask = gen_rtx_CONST_VECTOR (mode, gen_rtvec_v (nelt, vec)); + if (ix86_expand_vec_perm_vpermi2 (d->target, d->op0, mask, d->op1)) + return true; + } return false; } -- 2.30.2