public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/94795] New: Failure to use fast sbb method on x86 for spreading any set bit to all bits
@ 2020-04-27 11:27 gabravier at gmail dot com
  2020-04-27 13:07 ` [Bug rtl-optimization/94795] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gabravier at gmail dot com @ 2020-04-27 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94795
           Summary: Failure to use fast sbb method on x86 for spreading
                    any set bit to all bits
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int isNonzero(int x)
{
    if (x == 0)
        return 0x00000000;
    else
        return 0xFFFFFFFF;
}

On x86, this can be simplified to a `neg`+`sbb`. LLVM does this transformation,
but GCC doesn't

Comparison here : https://godbolt.org/z/QFz9to

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-03  0:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 11:27 [Bug rtl-optimization/94795] New: Failure to use fast sbb method on x86 for spreading any set bit to all bits 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
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

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).