public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Hongtao Liu <hongtao.liu@intel.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"hubicka@ucw.cz" <hubicka@ucw.cz>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] x86: harmonize __builtin_ia32_psadbw*() types
Date: Mon, 6 Jun 2022 11:53:30 -0700	[thread overview]
Message-ID: <CAMe9rOo++tZ=rpKhj1Ruv0DfR903owLzbOjKd9Y5oa8JbETsjQ@mail.gmail.com> (raw)
In-Reply-To: <CAMZc-bwo9B7d60RTaOy0u7=GxnCkcQX3zFYA9o63Az2f6RBB3w@mail.gmail.com>

On Sun, Jun 5, 2022 at 7:27 PM Hongtao Liu via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Mon, Jun 6, 2022 at 3:17 AM Uros Bizjak via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Thu, Jun 2, 2022 at 5:04 PM Jan Beulich <jbeulich@suse.com> wrote:
> > >
> > > The 64-bit, 128-bit, and 512-bit variants have V<n>DI return type, in
> > > line with instruction behavior. Make the 256-bit builtin match, thus
> > > also making it match the insn it expands to (using VI8_AVX2_AVX512BW).
> > >
> > > gcc/
> > >
> > >         * config/i386/i386-builtin.def (__builtin_ia32_psadbw256):
> > >         Change type.
> > >         * config/i386/i386-builtin-types.def: New function type
> > >         (V4DI, V32QI, V32QI).
> > >         * config/i386/i386-expand.cc (ix86_expand_args_builtin): Handle
> > >         V4DI_FTYPE_V32QI_V32QI.
> >
> > LGTM, but please let HJ have the final approval.
> I think it was just a typo and not intentional, so Ok for the trunk.

LGTM too.

Thanks.

> >
> > Uros.
> >
> > >
> > > --- a/gcc/config/i386/i386-builtin.def
> > > +++ b/gcc/config/i386/i386-builtin.def
> > > @@ -1217,7 +1217,7 @@ BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_mulv8si3, "__builtin_ia32_pmulld256"  , IX86_BUILTIN_PMULLD256  , UNKNOWN, (int) V8SI_FTYPE_V8SI_V8SI)
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_vec_widen_umult_even_v8si, "__builtin_ia32_pmuludq256", IX86_BUILTIN_PMULUDQ256, UNKNOWN, (int) V4DI_FTYPE_V8SI_V8SI)
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_iorv4di3, "__builtin_ia32_por256", IX86_BUILTIN_POR256, UNKNOWN, (int) V4DI_FTYPE_V4DI_V4DI)
> > > -BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_psadbw, "__builtin_ia32_psadbw256", IX86_BUILTIN_PSADBW256, UNKNOWN, (int) V16HI_FTYPE_V32QI_V32QI)
> > > +BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_psadbw, "__builtin_ia32_psadbw256", IX86_BUILTIN_PSADBW256, UNKNOWN, (int) V4DI_FTYPE_V32QI_V32QI)
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_pshufbv32qi3, "__builtin_ia32_pshufb256", IX86_BUILTIN_PSHUFB256, UNKNOWN, (int) V32QI_FTYPE_V32QI_V32QI)
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_pshufdv3, "__builtin_ia32_pshufd256", IX86_BUILTIN_PSHUFD256, UNKNOWN, (int) V8SI_FTYPE_V8SI_INT)
> > >  BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_pshufhwv3, "__builtin_ia32_pshufhw256", IX86_BUILTIN_PSHUFHW256, UNKNOWN, (int) V16HI_FTYPE_V16HI_INT)
> > > --- a/gcc/config/i386/i386-builtin-types.def
> > > +++ b/gcc/config/i386/i386-builtin-types.def
> > > @@ -516,6 +516,7 @@ DEF_FUNCTION_TYPE (V8DI, V8DI, V2DI, INT
> > >  DEF_FUNCTION_TYPE (V8DI, V8DI, V2DI, INT, V8DI, UQI)
> > >  DEF_FUNCTION_TYPE (V8DI, V8DI, V4DI, INT, V8DI, UQI)
> > >  DEF_FUNCTION_TYPE (V4DI, V8SI, V8SI)
> > > +DEF_FUNCTION_TYPE (V4DI, V32QI, V32QI)
> > >  DEF_FUNCTION_TYPE (V8DI, V64QI, V64QI)
> > >  DEF_FUNCTION_TYPE (V4DI, V4DI, V2DI)
> > >  DEF_FUNCTION_TYPE (V4DI, PCV4DI, V4DI)
> > > --- a/gcc/config/i386/i386-expand.cc
> > > +++ b/gcc/config/i386/i386-expand.cc
> > > @@ -10359,6 +10359,7 @@ ix86_expand_args_builtin (const struct b
> > >      case V8SI_FTYPE_V16HI_V16HI:
> > >      case V4DI_FTYPE_V4DI_V4DI:
> > >      case V4DI_FTYPE_V8SI_V8SI:
> > > +    case V4DI_FTYPE_V32QI_V32QI:
> > >      case V8DI_FTYPE_V64QI_V64QI:
> > >        if (comparison == UNKNOWN)
> > >         return ix86_expand_binop_builtin (icode, exp, target);
> > >
>
>
>
> --
> BR,
> Hongtao



-- 
H.J.

      reply	other threads:[~2022-06-06 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:04 Jan Beulich
2022-06-05 19:16 ` Uros Bizjak
2022-06-06  2:26   ` Hongtao Liu
2022-06-06 18:53     ` H.J. Lu [this message]

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='CAMe9rOo++tZ=rpKhj1Ruv0DfR903owLzbOjKd9Y5oa8JbETsjQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=hubicka@ucw.cz \
    --cc=jbeulich@suse.com \
    --cc=ubizjak@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).