Re: [PATCH] Improve __builtin_popcount* (x) == 1 generation if x is known != 0 [PR90693]

2024-01-04 Thread Jeff Law
On 1/4/24 02:11, Jakub Jelinek wrote: Hi! We expand __builtin_popcount* (x) == 1 as x ^ (x - 1) > x - 1, either unconditionally in tree-ssa-math-opts.cc if we don't have a direct optab support for popcount, or during expansion where we compare the costs of comparison of the popcount against

[PATCH] Improve __builtin_popcount* (x) == 1 generation if x is known != 0 [PR90693]

2024-01-04 Thread Jakub Jelinek
Hi! We expand __builtin_popcount* (x) == 1 as x ^ (x - 1) > x - 1, either unconditionally in tree-ssa-math-opts.cc if we don't have a direct optab support for popcount, or during expansion where we compare the costs of comparison of the popcount against one vs. the above expression. As mentioned