compiler.h: add popcount

This commit is contained in:
Yuxuan Shui 2019-08-08 00:47:12 +01:00
parent 4e915837a4
commit b2ff4eb2c9
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 0 deletions

View File

@ -106,3 +106,7 @@
typedef unsigned long ulong;
typedef unsigned int uint;
static inline int popcount(uint x) {
return __builtin_popcount(x);
}