Rev 1888 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1888 | Rev 2004 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | */ |
44 | */ |
45 | static inline int fnzb32(uint32_t arg) |
45 | static inline int fnzb32(uint32_t arg) |
46 | { |
46 | { |
47 | int n = 0; |
47 | int n = 0; |
48 | 48 | ||
49 | if (arg >> 16) { arg >>= 16;n += 16;} |
49 | if (arg >> 16) { |
- | 50 | arg >>= 16; |
|
- | 51 | n += 16; |
|
- | 52 | } |
|
- | 53 | ||
50 | if (arg >> 8) { arg >>= 8; n += 8;} |
54 | if (arg >> 8) { |
- | 55 | arg >>= 8; |
|
- | 56 | n += 8; |
|
- | 57 | } |
|
- | 58 | ||
51 | if (arg >> 4) { arg >>= 4; n += 4;} |
59 | if (arg >> 4) { |
- | 60 | arg >>= 4; |
|
- | 61 | n += 4; |
|
- | 62 | } |
|
- | 63 | ||
52 | if (arg >> 2) { arg >>= 2; n+=2;} |
64 | if (arg >> 2) { |
- | 65 | arg >>= 2; |
|
- | 66 | n += 2; |
|
- | 67 | } |
|
- | 68 | ||
53 | if (arg >> 1) { arg >>= 1; n+=1;} |
69 | if (arg >> 1) { |
- | 70 | arg >>= 1; |
|
- | 71 | n += 1; |
|
- | 72 | } |
|
- | 73 | ||
54 | return n; |
74 | return n; |
55 | } |
75 | } |
56 | 76 | ||
57 | static inline int fnzb64(uint64_t arg) |
77 | static inline int fnzb64(uint64_t arg) |
58 | { |
78 | { |
59 | int n = 0; |
79 | int n = 0; |
60 | 80 | ||
61 | if (arg >> 32) { arg >>= 32;n += 32;} |
81 | if (arg >> 32) { |
- | 82 | arg >>= 32; |
|
- | 83 | n += 32; |
|
- | 84 | } |
|
- | 85 | ||
62 | return n + fnzb32((uint32_t) arg); |
86 | return n + fnzb32((uint32_t) arg); |
63 | } |
87 | } |
64 | 88 | ||
65 | #define fnzb(x) fnzb32(x) |
89 | #define fnzb(x) fnzb32(x) |
66 | 90 |