[PATCH] D68189: [InstCombine] recognize popcount implemented in hacker's delight.
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 29 04:30:44 PDT 2019
xbolva00 added a comment.
Maybe this pattern is also interesting? ICC catches it.
int popcount (unsigned long long a)
{
unsigned long long b = a;
b -= ((b>>1) & 0x5555555555555555ULL);
b = ((b>>2) & 0x3333333333333333ULL) + (b & 0x3333333333333333ULL);
b = ((b>>4) + b) & 0x0F0F0F0F0F0F0F0FULL;
b *= 0x0101010101010101ULL;
return (int)(b >> 56);
}
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68189/new/
https://reviews.llvm.org/D68189
More information about the llvm-commits
mailing list