This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix MMX/SSE/AVX* shifts by non-immediate scalar (PR target/80286)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Kirill Yukhin <kirill dot yukhin at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Apr 2017 11:55:57 +0200
- Subject: Re: [PATCH] Fix MMX/SSE/AVX* shifts by non-immediate scalar (PR target/80286)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CEB8BEEF21
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CEB8BEEF21
- References: <20170403203437.GF17461@tucnak> <CAFULd4bHKjsF-i_uhDXb0AaCw2qtV3JzQSf5wabadnX-FTft-Q@mail.gmail.com> <20170404120039.GG17461@tucnak> <CAFULd4aRw2xdbk0QtOhtuxamnb87bQvASnF5H6W-EO6PZ5GPVw@mail.gmail.com> <20170404150905.GI17461@tucnak> <CAFULd4Ym8wjf1t___oS8+4_F=8ja0-GJgWXSP8kb=yK_jciTqw@mail.gmail.com> <20170406084007.GB17461@tucnak> <CAFULd4bu6GrVJLgmDxQVeLM=PaLvf84crzL51eOUEOxFjS=-gw@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Apr 06, 2017 at 10:47:03AM +0200, Uros Bizjak wrote:
> > +(define_insn_and_split "*<shift_insn><mode>3<mask_name>_1"
> > + [(set (match_operand:VI2_AVX2_AVX512BW 0 "register_operand")
> > + (any_lshift:VI2_AVX2_AVX512BW
> > + (match_operand:VI2_AVX2_AVX512BW 1 "register_operand")
> > + (sign_extend:DI (match_operand:SI 2 "nonmemory_operand"))))]
> > + "TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>
> > + && can_create_pseudo_p ()"
> > + "#"
> > + "&& 1"
> > + [(set (match_dup 3) (zero_extend:DI (match_dup 2)))
> > + (set (match_dup 0) (any_lshift:VI2_AVX2_AVX512BW
> > + (match_dup 1) (match_dup 3)))]
> > +{
> > + operands[3] = gen_reg_rtx (DImode);
> > +})
> >
> Yes, something like this. You ca use any_extend instead of
> sign_extend, so the pattern will also remove possible zero_extend of
> count operand.
The pattern splits it immediately (during split1) into a zext + shift,
so unless we let the pattern survive in this form (but then we need
constraints and it is unclear which ones) after reload, I don't see
advantage in matching it for zext, it is split exactly to what there
used to be before.
> > (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))])
> > that is a transformation we want to do on the define_insn part of
> > define_insn_and_split, but not exactly what we want to do on the split
> > part of the insn - there we want literaly match_dup 0, match_dup 1,
> > and instead of the 2 other match_operand match_dup 2 and match_dup 3.
>
> Hm, I'm not that versed in define_subst, but that looks quite a
> drawback of define_subst to me.
Perhaps, but we'd need to define what it means to subst a
define_insn_and_split.
Jakub