Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91621
b: refs/heads/master
c: 9f264be
h: refs/heads/master
i:
  91619: 9c42986
v: v3
  • Loading branch information
Paul Mackerras committed Apr 18, 2008
1 parent 225a775 commit 8f89ebb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 945feb174b14e7098cc7ecf0cf4768d35bc52f9c
refs/heads/master: 9f264be6101c42cb9e471c58322fb83a5cde1461
17 changes: 17 additions & 0 deletions trunk/include/asm-powerpc/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,24 @@ static __inline__ int fls(unsigned int x)
asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
return 32 - lz;
}

/*
* 64-bit can do this using one cntlzd (count leading zeroes doubleword)
* instruction; for 32-bit we use the generic version, which does two
* 32-bit fls calls.
*/
#ifdef __powerpc64__
static __inline__ int fls64(__u64 x)
{
int lz;

asm ("cntlzd %0,%1" : "=r" (lz) : "r" (x));
return 64 - lz;
}
#else
#include <asm-generic/bitops/fls64.h>
#endif /* __powerpc64__ */

#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/find.h>

Expand Down

0 comments on commit 8f89ebb

Please sign in to comment.