Re: [PATCH] x86: merge the simple bitops and move them to bitops.h

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander van Heukelum
Date: Friday, March 14, 2008 - 3:01 pm

On Fri, 14 Mar 2008 22:42:05 +0100, "Andi Kleen" <andi@firstfloor.org>
said:

I agree that it should end up using bsr. It would look like this in
the end, I guess. Might be familiar.

#if BITS_PER_LONG == 32
static inline int fls64(__u64 x)
{
        __u32 h = x >> 32;
        if (h)
                return __fls(h) + 33;
        return fls(x);
}
#else
static inline int fls64(__u64 x)
{
        if (x == 0)
                return 0;
        return __fls(x) + 1;
}
#endif


This is the only reason that this define exists. With another
name it would be fine. HWEIGHT_USE_MULTIPLIER?


And my feeling is that this is exactly the reason why this is
not a good version for a generic implementation in bitops.h. But
I don't care much.

Greetings,
    Alexander

-- 
  Alexander van Heukelum
  heukelum@fastmail.fm

-- 
http://www.fastmail.fm - Accessible with your email software
                          or over the web

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: merge the simple bitops and move them to bitops.h, Alexander van Heukelum, (Wed Mar 12, 1:01 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Jeremy Fitzhardinge, (Fri Mar 14, 11:07 am)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 12:43 pm)
[PATCH v2] x86: merge the simple bitops and move them to b ..., Alexander van Heukelum, (Fri Mar 14, 1:35 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Jeremy Fitzhardinge, (Fri Mar 14, 2:15 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 2:33 pm)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Fri Mar 14, 3:01 pm)
[PATCH v3] x86: merge the simple bitops and move them to b ..., Alexander van Heukelum, (Sat Mar 15, 5:04 am)
Re: [PATCH] x86: merge the simple bitops and move them to ..., Alexander van Heukelum, (Sat Mar 15, 10:54 am)
K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 12:19 pm)
Re: K8, EFFICEON and CORE2 support the cmovxx instructions., Alexander van Heukelum, (Sat Mar 15, 2:06 pm)
[PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 supp ..., Alexander van Heukelum, (Sun Mar 16, 6:16 am)