+int popcount_builtin(unsigned int x) {
+ return __builtin_popcount(x);
+}
+
+int popcountll_builtin(unsigned long long x) {
+ return __builtin_popcountll(x);
+}
+
+#if FOLLY_HAVE_IFUNC && !defined(FOLLY_SANITIZE_ADDRESS)
+
+// Strictly speaking, these versions of popcount are usable without ifunc
+// support. However, we would have to check, via CpuId, if the processor
+// implements the popcnt instruction first, which is what we use ifunc for.