From: Uros Bizjak <ubizjak@gmail.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: liuhongt <hongtao.liu@intel.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Allocate general register(memory/immediate) for 16/32/64-bit vector bit_op patterns.
Date: Tue, 12 Jul 2022 09:15:06 +0200 [thread overview]
Message-ID: <CAFULd4a2im9GfjFo8X5u79SinBU1WiTLOAThsmELyG__y3Pxvg@mail.gmail.com> (raw)
In-Reply-To: <CAMZc-byJLfLdQ8RdpwHiW35ZVBxKnmv8poT=1J0mGGiHCi-RXA@mail.gmail.com>
On Tue, Jul 12, 2022 at 8:37 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> On Mon, Jul 11, 2022 at 4:03 PM Uros Bizjak via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Mon, Jul 11, 2022 at 3:15 AM liuhongt <hongtao.liu@intel.com> wrote:
> > >
> > > And split it to GPR-version instruction after reload.
> > >
> > > This will enable below optimization for 16/32/64-bit vector bit_op
> > >
> > > - movd (%rdi), %xmm0
> > > - movd (%rsi), %xmm1
> > > - pand %xmm1, %xmm0
> > > - movd %xmm0, (%rdi)
> > > + movl (%rsi), %eax
> > > + andl %eax, (%rdi)
> > >
> > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
> > > Ok for trunk?
> >
> > The patch will create many interunit moves (xmm <-> gpr) for anything
> > but the most simple logic sequences, because operations with
> > memory/immediate will be forced into GPR registers, while reg/reg
> > operations will remain in XMM registers.
> Agree not to deal with mem/immediate at first.
> >
> > I tried to introduce GPR registers to MMX logic insns in the past and
> > observed the above behavior, but perhaps RA evolved in the mean time
> > to handle different register sets better (especially under register
> > pressure). However, I would advise to be careful with this
> > functionality.
> >
> > Perhaps this problem should be attacked in stages. First, please
> > introduce GPR registers to MMX logic instructions (similar to how
> > VI_16_32 mode instructions are handled). After RA effects will be
> There's "?r" in VI_16_32 logic instructions which prevent RA allocate
> gpr for testcase in the patch.
> Is it ok to remove "?" for them(Also add alternative "r" instead of
> "?r" in mmx logic insns)?
> If there's other instructions that prefer "v to "r", then RA will
> allocate "v", but for logic instructions, "r" and “v" should be
> treated equally, just as in the 16/32/64-bit vector
> mov<mode>_internal.
?r was introduced under the assumption that we want vector values
mostly in vector registers. Currently there are no instructions with
memory or immediate operand, so that made sense at the time. Let's
keep ?r until logic instructions with mem/imm operands are introduced.
So, for the patch that adds 64-bit vector logic in GPR, I would advise
to first introduce only register operands. mem/imm operands should be
added in a follow-up patch when the "?r" constraint will also be
relaxed.
Uros.
next prev parent reply other threads:[~2022-07-12 7:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 1:15 liuhongt
2022-07-11 8:02 ` Uros Bizjak
2022-07-12 6:37 ` Hongtao Liu
2022-07-12 7:15 ` Uros Bizjak [this message]
2022-07-14 5:33 ` [PATCH] Extend 64-bit vector bit_op patterns with ?r alternative liuhongt
2022-07-14 7:22 ` Uros Bizjak
2022-07-14 9:32 ` Hongtao Liu
2022-07-14 9:46 ` Uros Bizjak
2022-07-18 1:59 ` [PATCH] Extend 16/32-bit vector bit_op patterns with (m, 0, i)(vertical) alternative liuhongt
2022-07-18 6:28 ` [PATCH] Extend 16/32-bit vector bit_op patterns with (m,0,i)(vertical) alternative Uros Bizjak
2022-07-19 6:07 ` [PATCH V2] Extend 16/32-bit vector bit_op patterns with (m, 0, i) alternative liuhongt
2022-07-19 6:34 ` Uros Bizjak
2022-07-19 6:56 ` Hongtao Liu
2022-07-19 9:37 ` Uros Bizjak
2022-07-20 2:37 ` Hongtao Liu
2022-07-20 6:14 ` Uros Bizjak
2022-07-20 6:18 ` Uros Bizjak
2022-07-20 6:54 ` Hongtao Liu
2022-07-20 7:18 ` Uros Bizjak
2022-07-20 7:22 ` Hongtao Liu
2022-07-21 5:18 ` [PATCH V3] " liuhongt
2022-07-21 5:55 ` 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=CAFULd4a2im9GfjFo8X5u79SinBU1WiTLOAThsmELyG__y3Pxvg@mail.gmail.com \
--to=ubizjak@gmail.com \
--cc=crazylht@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hongtao.liu@intel.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).