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 take #3] PR target/91681: zero_extendditi2 pattern for more optimizations.
Date: Sun, 24 Jul 2022 13:03:11 +0200	[thread overview]
Message-ID: <CAFULd4ZCY37KU7jo+ASCDkskXDMJhx4VGaP-vqxuvFn35F-bJg@mail.gmail.com> (raw)
In-Reply-To: <06bb01d89e71$5d6283a0$18278ae0$@nextmovesoftware.com>

On Sat, Jul 23, 2022 at 10:51 AM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
>
> Hi Uros,
>
> This is the next iteration of the zero_extendditi2 patch last reviewed here:
>
> https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596204.html
>
>
>
> [1] The sse.md changes were split out, reviewed, approved and committed.
>
> [2] The *concat splitters have been moved post-reload matching what we
>
> now do for many/most of the double word functionality.
>
> [3] As you recommend, these *concat splitters now use split_double_mode
>
> to “subreg” operand[0] into parts, via a new helper function that can also
>
> handle overlapping registers, and even use xchg for the rare case that a
>
> double word is constructed from its high and low parts, but the wrong
>
> way around.
>
>
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
>
> and make -k check, both with and without –target_board=unix{-m32},
>
> with no new failures.  Ok for mainline?
>
>
>
> 2022-07-23  Roger Sayle  <roger@nextmovesoftware.com>
>
>             Uroš Bizjak  <ubizjak@gmail.com>
>
>
>
> gcc/ChangeLog
>
>         PR target/91681
>
>         * config/i386/i386-expand.cc (split_double_concat): A new helper
>
>         function for setting a double word value from two word values.
>
>         * config/i386/i386-protos.h (split_double_concat): Prototype here.
>
>         * config/i386/i386.md (zero_extendditi2): New define_insn_and_split.
>
>         (*add<dwi>3_doubleword_zext): New define_insn_and_split.
>
>         (*sub<dwi>3_doubleword_zext): New define_insn_and_split.
>
>         (*concat<mode><dwi>3_1): New define_insn_and_split replacing
>
>         previous define_split for implementing DST = (HI<<32)|LO as
>
>         pair of move instructions, setting lopart and hipart.
>
>         (*concat<mode><dwi>3_2): Likewise.
>
>         (*concat<mode><dwi>3_3): Likewise, where HI is zero_extended.
>
>         (*concat<mode><dwi>3_4): Likewise, where HI is zero_extended.
>
>
>
> gcc/testsuite/ChangeLog
>
>         PR target/91681
>
>         * g++.target/i386/pr91681.C: New test case (from the PR).
>
>         * gcc.target/i386/pr91681-1.c: New int128 test case.
>
>         * gcc.target/i386/pr91681-2.c: Likewise.
>
>         * gcc.target/i386/pr91681-3.c: Likewise, but for ia32.

OK with two small adjustments:

+(define_insn_and_split "zero_extendditi2"
+  [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
+ (zero_extend:TI (match_operand:DI 1 "nonimmediate_operand" "rm,r")))]

Please put the new pattern above zero_extendsidi2.

+(define_insn_and_split "*add<dwi>3_doubleword_zext"
+  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=r,o")

And this one after *add<dwi>3_doubleword, to keep all _doubleword
patterns together.

Thanks,
Uros.

      reply	other threads:[~2022-07-24 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  8:51 Roger Sayle
2022-07-24 11:03 ` 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=CAFULd4ZCY37KU7jo+ASCDkskXDMJhx4VGaP-vqxuvFn35F-bJg@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).