mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-05 04:55:06 +01:00
24 lines
370 B
C
24 lines
370 B
C
|
#ifdef _MSC_VER
|
||
|
#include <nmmintrin.h>
|
||
|
#else
|
||
|
#include <popcntintrin.h>
|
||
|
#endif
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
long long a = 0;
|
||
|
int b;
|
||
|
#ifdef _MSC_VER
|
||
|
#ifdef _M_X64
|
||
|
a = _mm_popcnt_u64(1);
|
||
|
#endif
|
||
|
b = _mm_popcnt_u32(1);
|
||
|
#else
|
||
|
#ifdef __x86_64__
|
||
|
a = __builtin_popcountll(1);
|
||
|
#endif
|
||
|
b = __builtin_popcount(1);
|
||
|
#endif
|
||
|
return (int)a + b;
|
||
|
}
|