public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114252] Introducing bswapsi reduces code performance Date: Thu, 07 Mar 2024 07:45:22 +0000 [thread overview] Message-ID: <bug-114252-4-FCid5gxave@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114252-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114252 --- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Note I do understand what you are saying, just the middle-end in detecting and using __builtin_bswap32 does what it does everywhere else - it checks whether the target implements the operation. The middle-end doesn't try to actually compare costs (it has no idea of the bswapsi costs), and it most definitely doesn't see how AVR is special in having only QImode registers and thus the created SImode load (which the target supports!) will end up as four registers. To me a 'bswap' on AVR never makes sense since whatever is swapped will be _always_ available as a set of byte registers. That's why I question AVR exposing bswapsi to the middle-end rather than suggesting the middle-end should maybe see whether AVR has any regs of HImode or larger. Note that would break for targets that could eventually do a load-multiple byteswapped to a set of QImode regs (guess there's no such one in GCC at least), but it's the only heuristic that might work here. The only thing that maybe would make sense with AVR exposing bswapsi is users calling __builtin_bswap but since it always expands as a libcall even that makes no sense. So my preferred fix would be to remove bswapsi from avr.md? Does it benefit from recognizing bswap done with shifts on an int?
next prev parent reply other threads:[~2024-03-07 7:45 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-06 10:01 [Bug tree-optimization/114252] New: " gjl at gcc dot gnu.org 2024-03-06 11:55 ` [Bug target/114252] " rguenth at gcc dot gnu.org 2024-03-06 11:59 ` rguenth at gcc dot gnu.org 2024-03-06 12:15 ` gjl at gcc dot gnu.org 2024-03-06 12:37 ` rguenth at gcc dot gnu.org 2024-03-06 16:12 ` gjl at gcc dot gnu.org 2024-03-06 17:18 ` rguenther at suse dot de 2024-03-07 7:45 ` rguenth at gcc dot gnu.org [this message] 2024-03-07 8:45 ` gjl at gcc dot gnu.org 2024-03-07 9:05 ` gjl at gcc dot gnu.org 2024-03-07 9:14 ` rguenth at gcc dot gnu.org 2024-03-07 9:42 ` rguenth at gcc dot gnu.org 2024-03-07 10:47 ` gjl at gcc dot gnu.org 2024-03-07 10:56 ` rguenth at gcc dot gnu.org 2024-03-07 14:12 ` gjl at gcc dot gnu.org 2024-03-07 15:02 ` pinskia at gcc dot gnu.org 2024-03-07 17:52 ` rguenther at suse dot de
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-114252-4-FCid5gxave@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: linkBe 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).