moved HAVE_BUILTIN_POPCOUNT def to cmake

This commit is contained in:
G.E.
2024-03-12 14:22:39 +02:00
parent 226645eaf1
commit 0045a2bdc7
4 changed files with 16 additions and 6 deletions

View File

@@ -44,7 +44,6 @@
#endif
#ifdef __NetBSD__
#include <strings.h>
#define HAVE_LOCAL_POPCOUNT
#endif
#endif // UTIL_ARCH_X86_H_

View File

@@ -37,7 +37,7 @@
#include "ue2common.h"
#include "util/arch.h"
#ifndef HAVE_LOCAL_POPCOUNT
#ifndef HAVE_BUILTIN_POPCOUNT
static really_inline
u32 popcount32(u32 x) {
return __builtin_popcount(x);
@@ -52,7 +52,7 @@ u32 popcount32(u32 x) {
// return (((x + (x >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;
// #endif
}
#endif /* HAVE_LOCAL_POPCOUNT */
#endif /* HAVE_BUILTIN_POPCOUNT */
static really_inline
u32 popcount32x4(u32 const *x) {
@@ -63,7 +63,7 @@ u32 popcount32x4(u32 const *x) {
return sum;
}
#ifndef HAVE_LOCAL_POPCOUNT
#ifndef HAVE_BUILTIN_POPCOUNT
static really_inline
u32 popcount64(u64a x) {
return __builtin_popcountll(x);
@@ -84,7 +84,7 @@ u32 popcount64(u64a x) {
// return popcount32(x >> 32) + popcount32(x);
// #endif
}
#endif /* HAVE_LOCAL_POPCOUNT */
#endif /* HAVE_BUILTIN_POPCOUNT */
static really_inline
u32 popcount64x4(u64a const *x) {