From: Uros Bizjak <ubizjak@gmail.com>
To: Ilya Tocar <tocarip.intel@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
Kirill Yukhin <kirill.yukhin@gmail.com>,
Richard Henderson <rth@redhat.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH i386 AVX512] [63.1/n] Add vpshufb, perm autogen (except for v64qi).
Date: Fri, 10 Oct 2014 16:39:00 -0000 [thread overview]
Message-ID: <CAFULd4bGehNdNGtZOt+UE50ShHxbL-Xxfv4rNhwPD1sByDjyag@mail.gmail.com> (raw)
In-Reply-To: <20141010154719.GA121201@msticlxl7.ims.intel.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.
next prev parent reply other threads:[~2014-10-10 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 12:55 [PATCH i386 AVX512] [63/n] Add vpshufb, perm autogen Kirill Yukhin
2014-10-06 14:10 ` Jakub Jelinek
2014-10-09 12:19 ` [PATCH i386 AVX512] [63.1/n] Add vpshufb, perm autogen (except for v64qi) Ilya Tocar
2014-10-09 18:51 ` Jakub Jelinek
2014-10-10 15:49 ` Ilya Tocar
2014-10-10 15:59 ` Jakub Jelinek
2014-10-10 16:39 ` Uros Bizjak [this message]
2014-10-16 10:25 ` Ilya Tocar
2014-10-16 11:18 ` Jakub Jelinek
2014-10-20 15:20 ` Ilya Tocar
2014-10-20 16:59 ` Uros Bizjak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFULd4bGehNdNGtZOt+UE50ShHxbL-Xxfv4rNhwPD1sByDjyag@mail.gmail.com \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=kirill.yukhin@gmail.com \
--cc=rth@redhat.com \
--cc=tocarip.intel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).