Skip to content

Commit

Permalink
target-i386: Inline bitops_flsl
Browse files Browse the repository at this point in the history
Use clz32 directly.  Which makes slightly more sense given
that the input is type "int" and not type "long".

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
rth7680 authored and blueswirl committed Feb 16, 2013
1 parent 0cfa6ad commit 14e5342
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions target-i386/topology.h
Expand Up @@ -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
Expand Down

0 comments on commit 14e5342

Please sign in to comment.