[lkml]   [2008]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: merge the simple bitops and move them to bitops.h
> #else
> static inline int fls64(__u64 x)
> {
> if (x == 0)
> return 0;
> return __fls(x) + 1;

That would require a polymorphic macro __fls that adapts to 32bit and 64bit
arguments. Not good C style.

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

AFAIK it only exists because some ancient sparc chips had incredibly
slow multipliers.

> 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.

I bet most different approaches who might be slightly
faster for larger bit strings would make the one bit
case slower.


 \ /
  Last update: 2008-03-14 23:19    [W:0.036 / U:7.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site