public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111698] New: Narrow memory access of compare to byte width Date: Wed, 04 Oct 2023 20:52:34 +0000 [thread overview] Message-ID: <bug-111698-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111698 Bug ID: 111698 Summary: Narrow memory access of compare to byte width Product: gcc Version: 12.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ubizjak at gmail dot com Target Milestone: --- Following testcase: --cut here-- int m; _Bool foo (void) { return m & 0x0f0000; } --cut here-- compiles to: 0: f7 05 00 00 00 00 00 testl $0xf0000,0x0(%rip) 7: 00 0f 00 The test instruction can be demoted to byte test from addr+2. Currently, the demotion works for lowest byte, so the testcase: --cut here-- int m; _Bool foo (void) { return m & 0x0f; } --cut here-- compiles to: 0: f6 05 00 00 00 00 0f testb $0xf,0x0(%rip) which is three bytes shorter. Any half-way modern Intel and AMD cores will forward any fully contained load, so there is no danger of forwarding stall with recent CPU cores.
next reply other threads:[~2023-10-04 20:52 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-04 20:52 ubizjak at gmail dot com [this message] 2023-10-05 7:51 ` [Bug target/111698] " rguenth at gcc dot gnu.org 2023-10-05 11:29 ` ubizjak at gmail dot com 2023-10-24 12:12 ` ubizjak at gmail dot com 2023-10-25 14:28 ` cvs-commit at gcc dot gnu.org 2023-10-25 14:30 ` ubizjak at gmail dot com
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-111698-4@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).