__popcnt4, __builtin_popcount, __popcnt8, __builtin_popcountll

Purpose

Population Count, 4-byte or 8-byte integer

Returns the number of bits set for a 32-bit or 64-bit integer.

Prototype

int __builtin_popcount (unsigned int);

int __builtin_popcountll (unsigned long long);

int __popcnt4 (unsigned int);

int __popcnt8 (unsigned long long);

Note:
  • The built-in function __popcnt4 is a synonym of __builtin_popcount and the built-in function __popcnt8 is a synonym of __builtin_popcountll.
  • The built-in functions __popcnt4 and __popcnt8 are provided for compatibility with IBM® XL C/C++ for AIX® 16.1 or earlier releases. This built-in function might be deprecated in the future.