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
* [Bug target/111078] csneg is not used for (cset) * 2 - 1 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 ` pinskia at gcc dot gnu.org 2023-11-18 7:20 ` pinskia at gcc dot gnu.org 1 sibling, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu.org @ 2023-08-19 21:24 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111078 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Another form: ``` int f1(int a, int b) { int t = a != b; return (-t)|1; } ``` ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/111078] csneg is not used for (cset) * 2 - 1 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 1 sibling, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu.org @ 2023-11-18 7:20 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111078 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Last reconfirmed| |2023-11-18 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- MIne For f0 we should be able to match: (set (reg:SI 98) (plus:SI (ashift:SI (eq:SI (reg:CC 66 cc) (const_int 0 [0])) (const_int 1 [0x1])) (const_int -1 [0xffffffffffffffff]))) here. Note -1 is important. for f1 we should be able to match: (set (reg:SI 98) (ior:SI (neg:SI (ne:SI (reg:CC 66 cc) (const_int 0 [0]))) (const_int 1 [0x1]))) Though I wonder for gimple if we should conconalization to one form or another ... ^ 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).