[Bug target/111078] csneg is not used for (cset) * 2 - 1

2023-11-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111078

Andrew Pinski  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  ---
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 [0x])))

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

[Bug target/111078] csneg is not used for (cset) * 2 - 1

2023-08-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111078

--- Comment #1 from Andrew Pinski  ---
Another form:
```
int f1(int a, int b)
{
  int t = a != b;
  return (-t)|1;
}
```