diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/tile/include/asm/bitops.h | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h index bd186c4eaa50..d5a206865036 100644 --- a/arch/tile/include/asm/bitops.h +++ b/arch/tile/include/asm/bitops.h | |||
@@ -29,17 +29,6 @@ | |||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * __ffs - find first set bit in word | ||
33 | * @word: The word to search | ||
34 | * | ||
35 | * Undefined if no set bit exists, so code should check against 0 first. | ||
36 | */ | ||
37 | static inline unsigned long __ffs(unsigned long word) | ||
38 | { | ||
39 | return __builtin_ctzl(word); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * ffz - find first zero bit in word | 32 | * ffz - find first zero bit in word |
44 | * @word: The word to search | 33 | * @word: The word to search |
45 | * | 34 | * |
@@ -50,33 +39,6 @@ static inline unsigned long ffz(unsigned long word) | |||
50 | return __builtin_ctzl(~word); | 39 | return __builtin_ctzl(~word); |
51 | } | 40 | } |
52 | 41 | ||
53 | /** | ||
54 | * __fls - find last set bit in word | ||
55 | * @word: The word to search | ||
56 | * | ||
57 | * Undefined if no set bit exists, so code should check against 0 first. | ||
58 | */ | ||
59 | static inline unsigned long __fls(unsigned long word) | ||
60 | { | ||
61 | return (sizeof(word) * 8) - 1 - __builtin_clzl(word); | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * ffs - find first set bit in word | ||
66 | * @x: the word to search | ||
67 | * | ||
68 | * This is defined the same way as the libc and compiler builtin ffs | ||
69 | * routines, therefore differs in spirit from the other bitops. | ||
70 | * | ||
71 | * ffs(value) returns 0 if value is 0 or the position of the first | ||
72 | * set bit if value is nonzero. The first (least significant) bit | ||
73 | * is at position 1. | ||
74 | */ | ||
75 | static inline int ffs(int x) | ||
76 | { | ||
77 | return __builtin_ffs(x); | ||
78 | } | ||
79 | |||
80 | static inline int fls64(__u64 w) | 42 | static inline int fls64(__u64 w) |
81 | { | 43 | { |
82 | return (sizeof(__u64) * 8) - __builtin_clzll(w); | 44 | return (sizeof(__u64) * 8) - __builtin_clzll(w); |
@@ -118,6 +80,9 @@ static inline unsigned long __arch_hweight64(__u64 w) | |||
118 | return __builtin_popcountll(w); | 80 | return __builtin_popcountll(w); |
119 | } | 81 | } |
120 | 82 | ||
83 | #include <asm-generic/bitops/builtin-__ffs.h> | ||
84 | #include <asm-generic/bitops/builtin-__fls.h> | ||
85 | #include <asm-generic/bitops/builtin-ffs.h> | ||
121 | #include <asm-generic/bitops/const_hweight.h> | 86 | #include <asm-generic/bitops/const_hweight.h> |
122 | #include <asm-generic/bitops/lock.h> | 87 | #include <asm-generic/bitops/lock.h> |
123 | #include <asm-generic/bitops/find.h> | 88 | #include <asm-generic/bitops/find.h> |