public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [x86 PATCH] Support *testdi_not_doubleword during STV pass.
Date: Fri, 8 Jul 2022 08:48:09 +0200	[thread overview]
Message-ID: <CAFULd4a2b950wEO1Ap7h3bScOK57RcGo1+QWXxXPYySO3hR9DA@mail.gmail.com> (raw)
In-Reply-To: <043a01d89220$6bb82a70$43287f50$@nextmovesoftware.com>

On Thu, Jul 7, 2022 at 6:41 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch fixes the current two FAILs of pr65105-5.c on x86 when
> compiled with -m32.  These (temporary) breakages were fallout from my
> patches to improve/upgrade (scalar) double word comparisons.
> On mainline, the i386 backend currently represents a critical comparison
> using (compare (and (not reg1) reg2) (const_int 0)) which isn't/wasn't
> recognized by the STV pass' convertible_comparison_p.  This simple STV
> patch adds support for this pattern (*testdi_not_doubleword) and
> generates the vector pandn and ptest instructions expected in the
> existing (failing) test case.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, where with --target_board=unix{-m32} there are two
> fewer failures, and without, there are no new failures.
> Ok for mainline?
>
>
> 2022-07-07  Roger Sayle  <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
>         * config/i386/i386-features.cc (convert_compare): Add support
>         for *testdi_not_doubleword pattern (i.e. "(compare (and (not ...")
>         by generating a pandn followed by ptest.
>         (convertible_comparison_p): Recognize both *cmpdi_doubleword and
>         recent *testdi_not_doubleword comparison patterns.

OK, I think this is the correct approach to ANDN handling.

Thanks,
Uros.

>
> Thanks in advance,
> Roger
> --
>

      reply	other threads:[~2022-07-08  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 16:41 Roger Sayle
2022-07-08  6:48 ` 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=CAFULd4a2b950wEO1Ap7h3bScOK57RcGo1+QWXxXPYySO3hR9DA@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).