From f40b39a32027ffe76789c3d546218d5dea5ac74a Mon Sep 17 00:00:00 2001 From: Alexander Ivchenko Date: Thu, 16 Oct 2014 11:46:07 +0000 Subject: [PATCH] AVX-512. 78/n. Use blend for inserting. gcc/ * config/i386/i386.c (ix86_expand_vector_set): Handle V8DF, V8DI, V16SF, V16SI, V32HI, V64QI modes. Co-Authored-By: Andrey Turetskiy Co-Authored-By: Anna Tikhonova Co-Authored-By: Ilya Tocar Co-Authored-By: Ilya Verbin Co-Authored-By: Kirill Yukhin Co-Authored-By: Maxim Kuznetsov Co-Authored-By: Michael Zolotukhin From-SVN: r216310 --- gcc/ChangeLog | 12 +++++++ gcc/config/i386/i386.c | 73 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f79791f9ce..96356fc1e0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2014-10-16 Alexander Ivchenko + Maxim Kuznetsov + Anna Tikhonova + Ilya Tocar + Andrey Turetskiy + Ilya Verbin + Kirill Yukhin + Michael Zolotukhin + + * config/i386/i386.c (ix86_expand_vector_set): Handle V8DF, V8DI, V16SF, + V16SI, V32HI, V64QI modes. + 2014-10-16 Oleg Endo PR target/53513 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 64a5c552b4a..073e4ccc0ed 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -40854,6 +40854,79 @@ half: emit_insn (gen_insert[j][i] (target, target, tmp)); return; + case V8DFmode: + if (TARGET_AVX512F) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512f_blendmv8df (target, tmp, target, + force_reg (QImode, GEN_INT (1 << elt)))); + return; + } + else + break; + case V8DImode: + if (TARGET_AVX512F) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512f_blendmv8di (target, tmp, target, + force_reg (QImode, GEN_INT (1 << elt)))); + return; + } + else + break; + case V16SFmode: + if (TARGET_AVX512F) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512f_blendmv16sf (target, tmp, target, + force_reg (HImode, GEN_INT (1 << elt)))); + return; + } + else + break; + case V16SImode: + if (TARGET_AVX512F) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512f_blendmv16si (target, tmp, target, + force_reg (HImode, GEN_INT (1 << elt)))); + return; + } + else + break; + case V32HImode: + if (TARGET_AVX512F && TARGET_AVX512BW) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512bw_blendmv32hi (target, tmp, target, + force_reg (SImode, GEN_INT (1 << elt)))); + return; + } + else + break; + case V64QImode: + if (TARGET_AVX512F && TARGET_AVX512BW) + { + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, tmp, + gen_rtx_VEC_DUPLICATE (mode, val))); + emit_insn (gen_avx512bw_blendmv64qi (target, tmp, target, + force_reg (DImode, GEN_INT (1 << elt)))); + return; + } + else + break; + default: break; } -- 2.30.2