public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "roger at nextmovesoftware dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106594] [13 Regression] sign-extensions no longer merged into addressing mode Date: Fri, 12 Aug 2022 14:01:46 +0000 [thread overview] Message-ID: <bug-106594-4-irJCB4SFKi@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106594-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106594 Roger Sayle <roger at nextmovesoftware dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-08-12 Status|UNCONFIRMED |NEW CC| |roger at nextmovesoftware dot com Ever confirmed|0 |1 --- Comment #3 from Roger Sayle <roger at nextmovesoftware dot com> --- Ah interesting. Because index is a char, the tree-level optimizers realize that the shift by 4 can be an 8-bit shift instead of an int-sized shift. What's interesting is that because of (x & 3) << 4, is used, the optimizers realize that because index can never be negative, that in the array memory reference expression constellation_64qam[index], when the 8-bit index is being sign extended, it is effectively being zero-extended. I think that the aarch64 backend needs to be taught that in this case (because of the AND), the zero extension is the same as (can be implemented using) a sign-extension, i.e. restoring the original code generation. Practically, the sxtw;ldr[..lsl 2] above can legitimately be optimized to ldr[..sxtw 2] (or ldr[..uxtw 2] like LLVM) in this case [cases like this]. (sign_extend:DI (and:SI x (const_int 3))) and (zero_extend:DI (and:SI x (const_int 3))) should (ideally) produce the exact same code [the more efficient if two implementations are possible].
next prev parent reply other threads:[~2022-08-12 14:01 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-12 11:23 [Bug tree-optimization/106594] New: " tnfchris at gcc dot gnu.org 2022-08-12 12:04 ` [Bug tree-optimization/106594] " rguenth at gcc dot gnu.org 2022-08-12 12:44 ` tnfchris at gcc dot gnu.org 2022-08-12 14:01 ` roger at nextmovesoftware dot com [this message] 2022-08-12 14:48 ` tnfchris at gcc dot gnu.org 2022-08-12 17:01 ` roger at nextmovesoftware dot com 2022-08-13 11:34 ` [Bug rtl-optimization/106594] " roger at nextmovesoftware dot com 2022-08-14 12:07 ` tnfchris at gcc dot gnu.org 2022-08-17 1:05 ` hp at gcc dot gnu.org 2022-10-19 7:11 ` rguenth at gcc dot gnu.org 2022-10-19 7:52 ` roger at nextmovesoftware dot com 2023-01-17 4:06 ` roger at nextmovesoftware dot com 2023-02-27 10:00 ` tnfchris at gcc dot gnu.org 2023-02-27 10:03 ` ktkachov at gcc dot gnu.org 2023-03-04 22:26 ` segher at gcc dot gnu.org 2023-03-05 8:06 ` roger at nextmovesoftware dot com 2023-03-05 12:00 ` roger at nextmovesoftware dot com 2023-03-05 15:23 ` segher at gcc dot gnu.org 2023-03-05 19:23 ` tnfchris at gcc dot gnu.org 2023-03-06 7:51 ` rguenth at gcc dot gnu.org 2023-03-06 10:38 ` rsandifo at gcc dot gnu.org 2023-03-06 11:07 ` jakub at gcc dot gnu.org 2023-03-07 11:32 ` roger at nextmovesoftware dot com 2023-03-13 9:30 ` roger at nextmovesoftware dot com 2023-04-17 11:41 ` jakub at gcc dot gnu.org 2023-04-17 12:58 ` jakub at gcc dot gnu.org 2023-04-26 6:56 ` [Bug rtl-optimization/106594] [13/14 " rguenth at gcc dot gnu.org 2023-07-27 9:23 ` rguenth at gcc dot gnu.org 2023-10-30 16:19 ` segher at gcc dot gnu.org 2024-05-21 9:12 ` [Bug rtl-optimization/106594] [13/14/15 " jakub 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-106594-4-irJCB4SFKi@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).