Hacker News new | ask | show | jobs
by secondcoming 1840 days ago
Both clang and gcc have __builtin_popcnt variants.
1 comments

But both will issue actual popcount instructions only if they have been assured the program will be run on a machine that implements the instruction, which is not the default on, in particular, amd64/x86_64.