On Mon, Jan 4, 2021 at 8:52 AM Hongtao Liu <crazy...@gmail.com> wrote:
>
> On Mon, Jan 4, 2021 at 3:40 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Mon, Jan 4, 2021 at 6:54 AM Hongtao Liu <crazy...@gmail.com> wrote:
> > >
> > > Hi:
> > >   The following patch adds define_insn_and_split to optimize
> > >
> > >        vpmovmskb       %xmm0, %eax
> > > -       movzwl  %ax, %eax
> > >         notl    %eax
> > >
> > >   Bootstrapped/regtested on x86_64-linux-gnu {,-m32}.
> > >   Ok for trunk?
> > >
> > > gcc/ChangeLog
> > >         PR target/98461
> > >         * config/i386/sse.md (*sse2_pmovskb_zexthisi): New
> > >         define_insn_and_split for zero_extend of subreg HI of pmovskb
> > >         result.
> > >
> > > gcc/testsuite/ChangeLog
> > >         * gcc.target/i386/sse-pr98461-2.c: New test.
> > > ---
> > >  gcc/config/i386/sse.md                         | 11 +++++++++++
> > >  gcc/testsuite/gcc.target/i386/sse2-pr98461-2.c | 13 +++++++++++++
> > >  2 files changed, 24 insertions(+)
> > >  create mode 100644 gcc/testsuite/gcc.target/i386/sse2-pr98461-2.c
> > >
> > > diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> > > index d84103807ff..4ed6b9ae476 100644
> > > --- a/gcc/config/i386/sse.md
> > > +++ b/gcc/config/i386/sse.md
> > > @@ -16099,6 +16099,17 @@ (define_insn "*sse2_pmovmskb_ext"
> > >     (set_attr "prefix" "maybe_vex")
> > >     (set_attr "mode" "SI")])
> > >
> > > +(define_insn_and_split "*sse2_pmovskb_zexthisi"
> > > +  [(set (match_operand:SI 0 "register_operand")
> > > +       (zero_extend:SI (subreg:HI (unspec:SI
> > > +         [(match_operand:V16QI 1 "register_operand")]
> > > +          UNSPEC_MOVMSK) 0)))]
> > > +  "TARGET_SSE2"
> >
> > This needs ix86_pre_reload_split () in insn predicate.
> >
>
> Yes, there's subreg in the pattern.

Also the insn pattern does not have operand constraints.

> Assume patch is pre-approved with that change and
> regtested/bootstrapped on x86_64-linux-gnu{-m32,}.

LGTM with the above addition.

Uros.

Reply via email to