1 #ifndef INCLUDED_volk_64u_popcnt_a_H
2 #define INCLUDED_volk_64u_popcnt_a_H
11 static inline void volk_64u_popcnt_generic(
uint64_t* ret,
const uint64_t value) {
19 retVal = (retVal & 0x55555555) + (retVal >> 1 & 0x55555555);
20 retVal = (retVal & 0x33333333) + (retVal >> 2 & 0x33333333);
21 retVal = (retVal + (retVal >> 4)) & 0x0F0F0F0F;
22 retVal = (retVal + (retVal >> 8));
23 retVal = (retVal + (retVal >> 16)) & 0x0000003F;
27 retVal = (
uint32_t)((value & 0xFFFFFFFF00000000) >> 31);
28 retVal = (retVal & 0x55555555) + (retVal >> 1 & 0x55555555);
29 retVal = (retVal & 0x33333333) + (retVal >> 2 & 0x33333333);
30 retVal = (retVal + (retVal >> 4)) & 0x0F0F0F0F;
31 retVal = (retVal + (retVal >> 8));
32 retVal = (retVal + (retVal >> 16)) & 0x0000003F;
41 #if LV_HAVE_SSE4_2 && LV_HAVE_64
43 #include <nmmintrin.h>
45 static inline void volk_64u_popcnt_a_sse4_2(
uint64_t* ret,
const uint64_t value) {
46 *ret = _mm_popcnt_u64(value);
unsigned int uint32_t
Definition: stdint.h:80
unsigned __int64 uint64_t
Definition: stdint.h:90