public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Noah Goldstein <goldstein.w.n@gmail.com>,
	Hongtao Liu <crazylht@gmail.com>
Subject: Re: [GCC 12] [PATCH] x86: Support 2/4/8 byte constant vector stores
Date: Sun, 31 Jul 2022 19:00:38 +0200	[thread overview]
Message-ID: <CAFULd4ZEuNFJbQQvKbt89zCh3cj75=0GucQ4d+PgOdLyyv55iQ@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOqUm245pzyjb8Q=fTekvarbRg9-myJg5xWPkBTX27m6pw@mail.gmail.com>

On Wed, Jul 27, 2022 at 4:24 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Jul 1, 2022 at 8:31 AM Uros Bizjak <ubizjak@gmail.com> wrote:
> >
> > On Thu, Jun 30, 2022 at 4:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > 1. Add a predicate for constant vectors which can be converted to integer
> > > constants suitable for constant integer stores.  For a 8-byte constant
> > > vector, the converted 64-bit integer must be valid for store with 64-bit
> > > immediate, which is a 64-bit integer sign-extended from a 32-bit integer.
> > > 2. Add a new pattern to allow 2-byte, 4-byte and 8-byte constant vector
> > > stores, like
> > >
> > > (set (mem:V2HI (reg:DI 84))
> > >      (const_vector:V2HI [(const_int 0 [0]) (const_int 1 [0x1])]))
> > >
> > > 3. After reload, convert constant vector stores to constant integer
> > > stores, like
> > >
> > > (set (mem:SI (reg:DI 5 di [84]))
> > >      (const_int 65536 [0x10000]))
> > >
> > > For
> > >
> > > void
> > > foo (short * c)
> > > {
> > >   c[0] = 0;
> > >   c[1] = 1;
> > > }
> > >
> > > it generates
> > >
> > >         movl    $65536, (%rdi)
> > >
> > > instead of
> > >
> > >         movl    .LC0(%rip), %eax
> > >         movl    %eax, (%rdi)
> > >
> > > gcc/
> > >
> > >         PR target/106022
> > >         * config/i386/i386-protos.h (ix86_convert_const_vector_to_integer):
> > >         New.
> > >         * config/i386/i386.cc (ix86_convert_const_vector_to_integer):
> > >         New.
> > >         * config/i386/mmx.md (V_16_32_64): New.
> > >         (*mov<mode>_imm): New patterns for stores with 16-bit, 32-bit
> > >         and 64-bit constant vector.
> > >         * config/i386/predicates.md (x86_64_const_vector_operand): New.
> > >
> > > gcc/testsuite/
> > >
> > >         PR target/106022
> > >         * gcc.target/i386/pr106022-1.c: New test.
> > >         * gcc.target/i386/pr106022-2.c: Likewise.
> > >         * gcc.target/i386/pr106022-3.c: Likewise.
> > >         * gcc.target/i386/pr106022-4.c: Likewise.
> >
> > OK.
>
> OK to backport to GCC 12 branch?

Lets keep this in mainline only. It isn't something that makes a lot
of difference.

Uros.

      reply	other threads:[~2022-07-31 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 14:50 H.J. Lu
2022-07-01 15:31 ` Uros Bizjak
2022-07-27 14:24   ` [GCC 12] " H.J. Lu
2022-07-31 17:00     ` Uros Bizjak [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='CAFULd4ZEuNFJbQQvKbt89zCh3cj75=0GucQ4d+PgOdLyyv55iQ@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=goldstein.w.n@gmail.com \
    --cc=hjl.tools@gmail.com \
    --cc=richard.guenther@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).