public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/78904] zero-extracts are not effective
Date: Sat, 24 Jun 2023 22:12:58 +0000	[thread overview]
Message-ID: <bug-78904-4-ButZe4dYo9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-78904-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78904

--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:8f6c747c8638d4c3c47ba2d4c8be86909e183132

commit r14-2065-g8f6c747c8638d4c3c47ba2d4c8be86909e183132
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Sat Jun 24 23:05:25 2023 +0100

    i386: Add alternate representation for {and,or,xor}b %ah,%dh.

    A patch that I'm working on to improve RTL simplifications in the
    middle-end results in the regression of pr78904-1b.c, due to changes in
    the canonical representation of high-byte (%ah, %bh, %ch, %dh) logic.
    See also PR target/78904.

    This patch avoids/prevents those failures by adding support for the
    alternate representation, duplicating the existing *<code>qi_ext<mode>_2
    as *<code>qi_ext<mode>_3 (the new version also replacing any_or with
    any_logic to provide *andqi_ext<mode>_3 in the same pattern).  Removing
    the original pattern isn't trivial, as it's generated by define_split,
    but this can be investigated after the other pieces are approved.

    The current representation of this instruction is:

    (set (zero_extract:DI (reg/v:DI 87 [ aD.2763 ])
            (const_int 8 [0x8])
            (const_int 8 [0x8]))
        (subreg:DI (xor:QI (subreg:QI (zero_extract:DI (reg:DI 94)
                        (const_int 8 [0x8])
                        (const_int 8 [0x8])) 0)
                (subreg:QI (zero_extract:DI (reg/v:DI 87 [ aD.2763 ])
                        (const_int 8 [0x8])
                        (const_int 8 [0x8])) 0)) 0))

    after my proposed middle-end improvement, we attempt to recognize:

    (set (zero_extract:DI (reg/v:DI 87 [ aD.2763 ])
            (const_int 8 [0x8])
            (const_int 8 [0x8]))
        (zero_extract:DI (xor:DI (reg:DI 94)
                (reg/v:DI 87 [ aD.2763 ]))
            (const_int 8 [0x8])
            (const_int 8 [0x8])))

    2023-06-24  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            * config/i386/i386.md (*<code>qi_ext<mode>_3): New define_insn.

  parent reply	other threads:[~2023-06-24 22:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-78904-4@http.gcc.gnu.org/bugzilla/>
2023-04-19 15:04 ` cvs-commit at gcc dot gnu.org
2023-06-23  8:22 ` roger at nextmovesoftware dot com
2023-06-23 17:47 ` segher at gcc dot gnu.org
2023-06-24 22:12 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-14 17:36 ` cvs-commit at gcc dot gnu.org
2023-11-15 21:22 ` cvs-commit at gcc dot gnu.org
2023-11-16 18:13 ` cvs-commit at gcc dot gnu.org

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=bug-78904-4-ButZe4dYo9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).