From: Hongtao Liu <crazylht@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [x86 PATCH] PR target/94680: Clear upper bits of V2DF using movq (like V2DI).
Date: Wed, 16 Mar 2022 10:55:47 +0800 [thread overview]
Message-ID: <CAMZc-bwFzuay-ZMe_JZWoyJu54zJ6eJnzQubzNz3hpBBO2qe4w@mail.gmail.com> (raw)
In-Reply-To: <022601d8387c$45a41130$d0ec3390$@nextmovesoftware.com>
On Tue, Mar 15, 2022 at 10:52 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This simple i386 patch unblocks a more significant change. The testcase
> gcc.target/i386/sse2-pr94680.c isn't quite testing what's intended, and
> alas the fix for PR target/94680 doesn't (yet) handle V2DF mode.
>
> For the first test from sse2-pr94680.c, below
>
> v2df foo_v2df (v2df x) {
> return __builtin_shuffle (x, (v2df) { 0, 0 }, (v2di) { 0, 2 });
> }
>
> GCC on x86_64-pc-linux-gnu with -O2 currently generates:
>
> movhpd .LC0(%rip), %xmm0
> ret
> .LC0:
> .long 0
> .long 0
>
> which passes the test as it contains a mov insn and no xor.
> Alas reading a zero from the constant pool isn't quite the
> desired implementation. With this patch we now generate:
>
> movq %xmm0, %xmm0
> ret
>
> The same code as we generate for V2DI, and add a stricter
> test case. My first attempt tried using VI8F_128 to generalize
> the existing sse2_movq128 define_insn to both V2DI and V2DF.
> Alas, CODE_FOR_sse2_movq128 is exposed as a builtin in
> i386-builtin.def, requiring some internal name changes, that
You can turn sse2_movq128 into a expander to avoid builtin-related
change, then use VI8F_128 in the new define_insn.
With that change, patch LGTM.
> ultimately the testsuite was unhappy with. The simpler solution
> (that works) is to clone/specialize a new V2DF *sse2_movq128_2.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check with no new failures. Ok for mainline?
>
>
> 2022-03-15 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> PR target/94680
> * config/i386/sse.md (*sse2_movq128_2): A version of sse2_movq128
> for V2DF mode.
>
> gcc/testsuite/ChangeLog
> PR target/94680
> * gcc.target/i386/sse2-pr94680-2.c: New stricter V2DF test case.
>
>
> Thanks in advance,
> Roger
> --
>
--
BR,
Hongtao
prev parent reply other threads:[~2022-03-16 2:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 14:52 Roger Sayle
2022-03-16 2:55 ` Hongtao Liu [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=CAMZc-bwFzuay-ZMe_JZWoyJu54zJ6eJnzQubzNz3hpBBO2qe4w@mail.gmail.com \
--to=crazylht@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=roger@nextmovesoftware.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).