public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gabravier at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94795] Failure to use fast sbb method on x86 for spreading any set bit to all bits Date: Mon, 27 Apr 2020 15:52:41 +0000 [thread overview] Message-ID: <bug-94795-4-WAEexqeoEY@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94795-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94795 --- Comment #2 from Gabriel Ravier <gabravier at gmail dot com> --- Also, I can also provide this a very similar function for which such an optimization could be helpful : int f(int x) { return -(x == 0); } LLVM optimises that function to this : f(int): cmp edi, 1 sbb eax, eax ret Whereas GCC currently does f(int): xor eax, eax test edi, edi sete al neg eax ret instead (see also https://godbolt.org/z/5_bRCR)
next prev parent reply other threads:[~2020-04-27 15:52 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-27 11:27 [Bug rtl-optimization/94795] New: " gabravier at gmail dot com 2020-04-27 13:07 ` [Bug rtl-optimization/94795] " rguenth at gcc dot gnu.org 2020-04-27 15:52 ` gabravier at gmail dot com [this message] 2020-04-27 17:29 ` ubizjak at gmail dot com 2020-04-27 20:37 ` ubizjak at gmail dot com 2020-05-04 16:54 ` cvs-commit at gcc dot gnu.org 2020-05-04 17:02 ` [Bug target/94795] " ubizjak at gmail dot com 2021-08-03 0:20 ` pinskia 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-94795-4-WAEexqeoEY@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).