https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #10 from Andrew Pinski ---
Here is some more optimizations where the inner CMP is not EQ/NE:
signed:
x == (x <= CST) -> CST == 0 ? false : CST < 0 ? x == 0 : x == 1
x == (x < CST) -> CST == 1 ? false : CST <= 0 ? x == 0 : x == 1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #9 from Andrew Pinski ---
Actually here is the rest for the non-zero comparisons.
Note for the below case, s can be swapped around with unsigned and the CST
comparisons become unsigned comparisons too.
s < (s == CST) -> CST == 0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #8 from Andrew Pinski ---
Created attachment 55889
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55889=edit
Runtime test
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #7 from Andrew Pinski ---
Half of this is fixed now.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #6 from CVS Commits ---
The trunk branch has been updated by Andrew Pinski :
https://gcc.gnu.org/g:285c9d042e90a7425b37697edc9ec93a1b03b486
commit r14-2501-g285c9d042e90a7425b37697edc9ec93a1b03b486
Author: Andrew Pinski
Date:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #5 from Andrew Pinski ---
Part 1 of the patch to fix this:
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624293.html
This weekend I will handle the outer != NE/EQ cases.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #4 from Andrew Pinski ---
Created attachment 55527
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55527=edit
the eq/ne based functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #2 from Andrew Pinski ---
Some more generally for the ==/!= cases for CSTs:
x == (x == CST) -> CST == 0 ? 0 : (CST == 1 ? (x==0||x==1) : x != 0)
x == (x != CST) -> CST == 1 ? 0 : (CST == 0 ? (x==0||x==1) : x != 1)
x != (x == CST) ->
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293
--- Comment #1 from Andrew Pinski ---
Here are the signed versions of />=:
`s < (s != 0)` is `s < 0`
`s <= (s != 0)` is `s <= 1`
`s > (s != 0)` is `s > 1`
`s >= (s != 0)` is `s >= 0`
`s < (s == 0)` is `s <= 0`
`s <= (s == 0)` is `s <= 0`
10 matches
Mail list logo