We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
_popcnt(n) or _popcnt64(n) when compiled on a 64 bit CPU supporting SSE4.1 instructions, generate intrinsics which definitely run(s) in constant time.
However GCC compiler generates a look-up table implementation if -mpopcnt is NOT passed as a parameter during compile. Although I guess it is fixed in latest versions.
Counter game
You are viewing a single comment's thread. Return to all comments →
_popcnt(n) or _popcnt64(n) when compiled on a 64 bit CPU supporting SSE4.1 instructions, generate intrinsics which definitely run(s) in constant time.
However GCC compiler generates a look-up table implementation if -mpopcnt is NOT passed as a parameter during compile. Although I guess it is fixed in latest versions.
Generic ASM implementation that uses intrinsics :