From: Uros Bizjak <ubizjak@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [x86_64 PATCH] PR target/106231: Optimize (any_extend:DI (ctz:SI ...)).
Date: Mon, 18 Jul 2022 08:10:24 +0200 [thread overview]
Message-ID: <CAFULd4bg0zRB+BK0t_NQgbq6+1J-b2F+o8dfRmyu6v2vghVDbw@mail.gmail.com> (raw)
In-Reply-To: <036601d89947$c425d0d0$4c717270$@nextmovesoftware.com>
On Sat, Jul 16, 2022 at 9:10 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch resolves PR target/106231 by providing insns that recognize
> (zero_extend:DI (ctz:SI ...)) and (sign_extend:DI (ctz:SI ...)). The
> result of ctz:SI is always between 0 and 32 (or undefined), so
> sign_extension is the same as zero_extension, and the result is already
> extended in the destination register.
>
> Things are a little complicated, because the existing implementation
> of *ctzsi2 handles multiple cases, including false dependencies, which
> we continue to support in this patch.
>
> 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-07-16 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> PR target/106231
> * config/i386/i386.md (*ctzsidi2_<s>ext): New insn_and_split
> to recognize any_extend:DI of ctz:SI which is implicitly extended.
> (*ctzsidi2_<s>ext_falsedep): New define_insn to model a DImode
> extended ctz:SI that has preceding xor to break false dependency.
>
> gcc/testsuite/ChangeLog
> PR target/106231
> * gcc.target/i386/pr106231-1.c: New test case.
> * gcc.target/i386/pr106231-2.c: New test case.
OK.
Thanks,
Uros.
>
> Thanks in advance,
> Roger
> --
>
prev parent reply other threads:[~2022-07-18 6:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-16 19:10 Roger Sayle
2022-07-18 6:10 ` 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=CAFULd4bg0zRB+BK0t_NQgbq6+1J-b2F+o8dfRmyu6v2vghVDbw@mail.gmail.com \
--to=ubizjak@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).