This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH i386 AVX512] [63.1/n] Add vpshufb, perm autogen (except for v64qi).
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Ilya Tocar <tocarip dot intel at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Richard Henderson <rth at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 10 Oct 2014 18:37:07 +0200
- Subject: Re: [PATCH i386 AVX512] [63.1/n] Add vpshufb, perm autogen (except for v64qi).
- Authentication-results: sourceware.org; auth=none
- References: <20141006125527 dot GC13369 at msticlxl57 dot ims dot intel dot com> <20141006141035 dot GZ1986 at tucnak dot redhat dot com> <20141009121523 dot GB81768 at msticlxl7 dot ims dot intel dot com> <20141009185105 dot GM1986 at tucnak dot redhat dot com> <20141010154719 dot GA121201 at msticlxl7 dot ims dot intel dot com>
On Fri, Oct 10, 2014 at 5:47 PM, Ilya Tocar <tocarip.intel@gmail.com> wrote:
>> My strong preference would be:
>> enum machine_mode maskmode = mode;
>> rtx (*gen) (rtx, rtx, rtx, rtx);
>> right below the enum machine_mode mode = GET_MODE (d ? d->op0 : op0);
>> line and then inside of the first switch just do:
>> ...
>> case V16SImode:
>> if (!TARGET_AVX512F)
>> return false;
>> gen = gen_avx512f_vpermi2varv16si3;
>> break;
>> case V4SFmode:
>> if (!TARGET_AVX512VL)
>> return false;
>> gen = gen_avx512vl_vpermi2varv4sf3;
>> maskmode = V4SImode;
>> break;
>> ...
>> etc., then in the mask = line use:
>> mask = gen_rtx_CONST_VECTOR (maskmode, gen_rtvec_v (d->nelt, vec));
>> and finally instead of the second switch do:
>> emit_insn (gen (target, op0, force_reg (maskmode, mask), op1));
>> return true;
>>
> Updated patch below.
Please recode that horrible first switch statement to:
--cut here--
rtx (*gen) (rtx, rtx, rtx, rtx) = NULL;
switch (mode)
{
case V8HImode:
if (TARGET_AVX512VL && TARGET_AVX152BW)
gen = gen_avx512vl_vpermi2varv8hi3;
break;
...
case V2DFmode:
if (TARGET_AVX512VL)
{
gen = gen_avx512vl_vpermi2varv2df3;
maskmode = V2DImode;
}
break;
default:
break;
}
if (gen == NULL)
return false;
--cut here--
The patch is OK with the above improvement.
(Please also note that the patch has a bunch of i386.md changes that
will clash with followup patch series).
Thanks,
Uros.