public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96226] New: Failure to optimize shift+not to rotate
@ 2020-07-16 21:06 gabravier at gmail dot com
  2020-07-17 12:24 ` [Bug tree-optimization/96226] " ubizjak at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2020-07-16 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96226
           Summary: Failure to optimize shift+not to rotate
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int32_t f(int32_t x)
{
    return ~(1 << (x & 0x1F));
}

This can be transformed to doing a rotate of -2 and x. This transformation is
done by LLVM, but not by GCC.

PS: GCC seems capable of doing this optimization, but only if `x & 0x1F` is
replaced with `x`, which either means that GCC is underoptimizing this or that
LLVM is somehow wrong.

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

end of thread, other threads:[~2020-12-05  0:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 21:06 [Bug tree-optimization/96226] New: Failure to optimize shift+not to rotate gabravier at gmail dot com
2020-07-17 12:24 ` [Bug tree-optimization/96226] " ubizjak at gmail dot com
2020-12-04 14:49 ` jakub at gcc dot gnu.org
2020-12-04 17:45 ` cvs-commit at gcc dot gnu.org
2020-12-04 17:46 ` jakub at gcc dot gnu.org
2020-12-05  0:32 ` cvs-commit 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).