Lines Matching +full:x +full:- +full:mask +full:-
9 #include <asm-generic/bitops/__ffs.h>
29 * resulted in errors from egcs. Things may be OK with gcc-2.95.
34 unsigned long mask = 1 << (nr & 0x1f); in set_bit() local
44 : "r" (mask), "r" (p), "m" (*p) in set_bit()
51 unsigned long mask = 1 << (nr & 0x1f); in clear_bit() local
61 : "r" (mask), "r" (p), "m" (*p) in clear_bit()
68 unsigned long mask = 1 << (nr & 0x1f); in change_bit() local
78 : "r" (mask), "r" (p), "m" (*p) in change_bit()
85 unsigned int mask = 1 << (nr & 0x1f); in test_and_set_bit() local
95 : "r" (mask), "r" (p), "m" (*p) in test_and_set_bit()
98 return (old & mask) != 0; in test_and_set_bit()
104 unsigned int mask = 1 << (nr & 0x1f); in test_and_clear_bit() local
114 : "r" (mask), "r" (p), "m" (*p) in test_and_clear_bit()
117 return (old & mask) != 0; in test_and_clear_bit()
123 unsigned int mask = 1 << (nr & 0x1f); in test_and_change_bit() local
133 : "r" (mask), "r" (p), "m" (*p) in test_and_change_bit()
136 return (old & mask) != 0; in test_and_change_bit()
148 /* - the result is undefined when x == 0 */
149 static __inline__ int __ilog2(unsigned int x) in __ilog2() argument
153 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); in __ilog2()
154 return 31 - lz; in __ilog2()
157 static __inline__ int ffz(unsigned int x) in ffz() argument
159 if ((x = ~x) == 0) in ffz()
161 return __ilog2(x & -x); in ffz()
165 * fls: find last (most-significant) bit set.
168 * On powerpc, __ilog2(0) returns -1, but this is not safe in general
170 static __inline__ int fls(unsigned int x) in fls() argument
172 return __ilog2(x) + 1; in fls()
177 * fls64 - find last set bit in a 64-bit word
178 * @x: the word to search
188 static inline int fls64(__u64 x) in fls64() argument
190 __u32 h = x >> 32; in fls64()
193 return fls(x); in fls64()
196 static inline int fls64(__u64 x) in fls64() argument
198 if (x == 0) in fls64()
200 return __ilog2(x) + 1; in fls64()
213 static __inline__ int ffs(int x) in ffs() argument
215 return __ilog2(x & -x) + 1; in ffs()
221 * of bits set) of a N-bit word
224 #define hweight32(x) generic_hweight32(x) argument
225 #define hweight16(x) generic_hweight16(x) argument
226 #define hweight8(x) generic_hweight8(x) argument
232 * Linus' asm-alpha/bitops.h.
246 size -= result; in find_next_zero_bit()
250 tmp |= ~0UL >> (32-offset); in find_next_zero_bit()
255 size -= 32; in find_next_zero_bit()
262 size -= 32; in find_next_zero_bit()
287 int mask; in ext2_set_bit() local
292 mask = 1 << (nr & 0x07); in ext2_set_bit()
293 oldbit = (*ADDR & mask) ? 1 : 0; in ext2_set_bit()
294 *ADDR |= mask; in ext2_set_bit()
300 int mask; in ext2_clear_bit() local
305 mask = 1 << (nr & 0x07); in ext2_clear_bit()
306 oldbit = (*ADDR & mask) ? 1 : 0; in ext2_clear_bit()
307 *ADDR = *ADDR & ~mask; in ext2_clear_bit()
321 * Linus' asm-alpha/bitops.h and modified for a big-endian machine.
336 size -= result; in ext2_find_next_zero_bit()
340 tmp |= ~0UL >> (32-offset); in ext2_find_next_zero_bit()
345 size -= 32; in ext2_find_next_zero_bit()
352 size -= 32; in ext2_find_next_zero_bit()