summaryrefslogtreecommitdiffstats
path: root/lib/eu-config.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eu-config.h')
-rw-r--r--lib/eu-config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/eu-config.h b/lib/eu-config.h
index 400cdc6e..88cac670 100644
--- a/lib/eu-config.h
+++ b/lib/eu-config.h
@@ -163,6 +163,17 @@ asm (".section predict_data, \"aw\"; .previous\n"
/* This macro is used by the tests conditionalize for standalone building. */
#define ELFUTILS_HEADER(name) <lib##name.h>
+#ifndef HAVE_BUILTIN_POPCOUNT
+# define __builtin_popcount hakmem_popcount
+static inline unsigned int __attribute__ ((unused))
+hakmem_popcount (unsigned int x)
+{
+ /* HAKMEM 169 */
+ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
+ return ((n + (n >> 3)) & 030707070707) % 63;
+}
+#endif /* HAVE_BUILTIN_POPCOUNT */
+
#ifdef SYMBOL_VERSIONING
# define OLD_VERSION(name, version) \