[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/10] target-i386: Inline bitops_flsl
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 07/10] target-i386: Inline bitops_flsl |
Date: |
Wed, 13 Feb 2013 17:47:40 -0800 |
Use clz32 directly. Which makes slightly more sense given
that the input is type "int" and not type "long".
Signed-off-by: Richard Henderson <address@hidden>
---
target-i386/topology.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/target-i386/topology.h b/target-i386/topology.h
index 24ed525..07a6c5f 100644
--- a/target-i386/topology.h
+++ b/target-i386/topology.h
@@ -52,10 +52,8 @@ typedef uint32_t apic_id_t;
static unsigned apicid_bitwidth_for_count(unsigned count)
{
g_assert(count >= 1);
- if (count == 1) {
- return 0;
- }
- return bitops_flsl(count - 1) + 1;
+ count -= 1;
+ return count ? 32 - clz32(count) : 0;
}
/* Bit width of the SMT_ID (thread ID) field on the APIC ID
--
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, 2013/02/13
- [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 <=
- [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
- Re: [Qemu-devel] [PATCH v2 00/10] Cleanup bitops vs host-utils, Peter Maydell, 2013/02/14
- Re: [Qemu-devel] [PATCH v2 00/10] Cleanup bitops vs host-utils, Eric Blake, 2013/02/14
- Re: [Qemu-devel] [PATCH v2 00/10] Cleanup bitops vs host-utils, Blue Swirl, 2013/02/16