Use compiler intrinsic instead of inline assembly for popcnt

This time, do not break compatibility with some AMD machines that have SSE3 and popcnt, but do
not have SSE4.2.

No functional change.