lkml.org 
[lkml]   [2004]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6.6-BK] x86_64 has buggy ffs() implementation
Gabriel Paubert wrote:
>
> Either I'm asleep or you are emulating bsrl, not bsfl. It
> should rather be:
>
> if ( y & 0x00000001) return 1;
> if ( y & 0x00000002) return 2;
> if ( y & 0x00000004) return 3;
> ...
> if ( y & 0x80000000) return 32;
> return 0;
>
> No need for the else clauses either because of the return.
> But maybe even __builtin_ffs(y) would work in this case.
>

If __builtin_ffs() works *AND HAS THE RIGHT SEMANTICS* it's probably the
best thing to use.

Otherwise, yes, generic_ffs() can clearly be used inside the
__builtin_constant_p() clause.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:1.060 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site