https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
--- Comment #7 from Andrew Pinski ---
Note we don't need to do y&-y only if we keep track of popcount of the
SSA_NAME. But we don't have that yet.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
Andrew Pinski changed:
What|Removed |Added
Ever confirmed|0 |1
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
--- Comment #5 from Thomas Koenig ---
(In reply to Jakub Jelinek from comment #4)
> What about a version that still sets lowest_bit to value & -value; rather
> than 1 < ctz?
I think this would be ideal, or close to it.
> Also, I'm not sure you
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
--- Comment #3 from Thomas Koenig ---
Even faster code:
ctz = __builtin_ctz (value);
lowest_bit = value & - value;
left_bits = value + lowest_bit;
changed_bits = value ^ left_bits;
right_bits = changed_bits >> (ctz + 2);
return left_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
--- Comment #2 from Thomas Koenig ---
Created attachment 49516
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49516&action=edit
Small benchmark
Here's a small benchmark for counting all 32-bit numbers with 16 bits set
according to the HAKM
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97738
Richard Biener changed:
What|Removed |Added
Keywords||missed-optimization
Component|