public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111078] New: csneg is not used for (cset) * 2 - 1
@ 2023-08-19 21:13 pinskia at gcc dot gnu.org
  2023-08-19 21:24 ` [Bug target/111078] " pinskia at gcc dot gnu.org
  2023-11-18  7:20 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-19 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111078
           Summary: csneg is not used for (cset) * 2 - 1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

Take:
```
int f(int a, int b)
{
        return a == b ? 1 : -1;
}


int f0(int a, int b)
{
        int t = a == b;
        return t * 2 - 1;
}
```

These 2 should produce the same code on aarch64 but currently only the first
one produces:
```
        cmp     w0, w1
        mov     w0, 1
        csneg   w0, w0, w0, eq
        ret
```

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

end of thread, other threads:[~2023-11-18  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19 21:13 [Bug target/111078] New: csneg is not used for (cset) * 2 - 1 pinskia at gcc dot gnu.org
2023-08-19 21:24 ` [Bug target/111078] " pinskia at gcc dot gnu.org
2023-11-18  7: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).