public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105773] New: [Aarch64] Failure to optimize and+cmp to tst
@ 2022-05-30 13:29 gabravier at gmail dot com
  2022-06-08 12:37 ` [Bug target/105773] " rearnsha at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2022-05-30 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105773
           Summary: [Aarch64] Failure to optimize and+cmp to tst
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int
baz (unsigned long x, unsigned long y)
{
  return (int) (x & y) > 0;
}

With -O3, AArch64 GCC outputs this:

baz(unsigned long, unsigned long):
        and     w0, w0, w1
        cmp     w0, 0
        cset    w0, gt
        ret

whereas LLVM outputs this:

baz(unsigned long, unsigned long):
        tst     w1, w0
        cset    w0, gt
        ret

It seems to me as though using tst should be faster (unless Aarch64 processors
are extremely weird).

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

end of thread, other threads:[~2022-10-13 13:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 13:29 [Bug target/105773] New: [Aarch64] Failure to optimize and+cmp to tst gabravier at gmail dot com
2022-06-08 12:37 ` [Bug target/105773] " rearnsha at gcc dot gnu.org
2022-06-08 12:41 ` rearnsha at gcc dot gnu.org
2022-06-22 21:34 ` pinskia at gcc dot gnu.org
2022-10-13 13:56 ` cvs-commit at gcc dot gnu.org
2022-10-13 13:58 ` wilco 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).