public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103784] suboptimal code for returning bool value on target ppc
Date: Sun, 05 Mar 2023 19:27:16 +0000	[thread overview]
Message-ID: <bug-103784-4-LYc7MKk2Oq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103784-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #12 from Segher Boessenkool <segher at gcc dot gnu.org> ---
What David says :-)

We really could use something good for this, it has been a problem for all
GCC targets since forever; it hurts rs6000 more than most though.

Before RA this is a diamond, one side does the 0/1, the other the always 0.
After the join it gets an AND with 1 (not an extend; the effect is similar
of course).  Shrink-wrapping gets rid of the join (duplicates the tail code
to both branches) but does not optimise the result of that, which gives us
the silly li 3,0;clrldi 3,3,63 (and the other side does not need the shift
either, but doesn't look quite as silly :-) ).

It is not unlikely this would work better if we had no QImode thing for the
bool; even SImode might work better already, but DImode would be best (in
the ABI everything is passed in full registers always, so something has to
set the upper bits somewhere).

  parent reply	other threads:[~2023-03-05 19:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21  1:42 [Bug target/103784] New: " guihaoc at gcc dot gnu.org
2021-12-21  1:46 ` [Bug target/103784] " pinskia at gcc dot gnu.org
2021-12-21  2:35 ` guihaoc at gcc dot gnu.org
2021-12-21  2:43 ` pinskia at gcc dot gnu.org
2021-12-21  3:02 ` guihaoc at gcc dot gnu.org
2023-01-04 14:07 ` segher at gcc dot gnu.org
2023-01-04 14:08 ` segher at gcc dot gnu.org
2023-01-04 14:13 ` segher at gcc dot gnu.org
2023-01-05 16:34 ` jskumari at gcc dot gnu.org
2023-03-01  4:04 ` jskumari at gcc dot gnu.org
2023-03-05 11:48 ` jskumari at gcc dot gnu.org
2023-03-05 15:41 ` dje at gcc dot gnu.org
2023-03-05 19:27 ` segher at gcc dot gnu.org [this message]
2023-03-06  8:14 ` jskumari at gcc dot gnu.org
2023-03-16  9:52 ` rguenth at gcc dot gnu.org
2023-04-11 17:07 ` aagarwa at gcc dot gnu.org
2023-07-20 11:15 ` jskumari at gcc dot gnu.org
2023-08-31  8:03 ` aagarwa 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-103784-4-LYc7MKk2Oq@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).