[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/10] host-utils: Add host long specific aliases fo
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 01/10] host-utils: Add host long specific aliases for clz, ctz, ctpop |
Date: |
Wed, 13 Feb 2013 17:47:34 -0800 |
We will standardize on these names, rather than the similar routines
currently residing in qemu/bitops.h.
Signed-off-by: Richard Henderson <address@hidden>
---
include/qemu/host-utils.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 81c9a75..d72b72d 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -26,6 +26,7 @@
#define HOST_UTILS_H 1
#include "qemu/compiler.h" /* QEMU_GNUC_PREREQ */
+#include <limits.h>
#if defined(__x86_64__)
#define __HAVE_FAST_MULU64__
@@ -237,4 +238,22 @@ static inline int ctpop64(uint64_t val)
#endif
}
+/* Host type specific sizes of these routines. */
+
+#if ULONG_MAX == UINT32_MAX
+# define clzl clz32
+# define ctzl ctz32
+# define clol clo32
+# define ctol cto32
+# define ctpopl ctpop32
+#elif ULONG_MAX == UINT64_MAX
+# define clzl clz64
+# define ctzl ctz64
+# define clol clo64
+# define ctol cto64
+# define ctpopl ctpop64
+#else
+# error Unknown sizeof long
+#endif
+
#endif
--
1.8.1.2
- [Qemu-devel] [PATCH v2 00/10] Cleanup bitops vs host-utils, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 01/10] host-utils: Add host long specific aliases for clz, ctz, ctpop,
Richard Henderson <=
- [Qemu-devel] [PATCH 02/10] host-utils: Fix coding style and add comments, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 03/10] hbitmap: Use non-bitops ctzl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 04/10] bitops: Use non-bitops ctzl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 05/10] memory: Use non-bitops ctzl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 06/10] bitops: Write bitops_flsl in terms of clzl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 07/10] target-i386: Inline bitops_flsl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 08/10] bitops: Inline bitops_flsl, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 10/10] bitops: Remove routines redundant with host-utils, Richard Henderson, 2013/02/13
- [Qemu-devel] [PATCH 09/10] bitops: Replace bitops_ctol with ctzl, Richard Henderson, 2013/02/13