summaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/vulkan/tu_util.h')
-rw-r--r--src/freedreno/vulkan/tu_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_util.h b/src/freedreno/vulkan/tu_util.h
new file mode 100644
index 00000000000..b013079d518
--- /dev/null
+++ b/src/freedreno/vulkan/tu_util.h
@@ -0,0 +1,11 @@
+#ifndef TU_UTIL_H
+#define TU_UTIL_H
+
+#ifdef HAVE___BUILTIN_POPCOUNT
+#define util_bitcount(i) __builtin_popcount(i)
+#else
+extern unsigned int
+util_bitcount(unsigned int n);
+#endif
+
+#endif /* TU_UTIL_H */