Lines Matching +full:even +full:- +full:numbered
1 /* SPDX-License-Identifier: GPL-2.0 */
9 * Within a word, bits are numbered LSB first. Lot's of places make
12 * big-endian system because, unlike little endian, the number of each
16 * end up numbered:
20 * The bits are numbered:
23 * The main difference is that bit 0-63 in the bit number field needs to be
42 #define __BITOPS_WORDS(bits) (((bits) + BITS_PER_LONG - 1) / BITS_PER_LONG)
49 addr = (unsigned long)ptr + ((nr ^ (nr & (BITS_PER_LONG - 1))) >> 3); in __bitops_word()
55 return 1UL << (nr & (BITS_PER_LONG - 1)); in __bitops_mask()
214 #include <asm-generic/bitops/instrumented-atomic.h>
215 #include <asm-generic/bitops/instrumented-non-atomic.h>
216 #include <asm-generic/bitops/instrumented-lock.h>
220 * The bits are numbered:
234 return set_bit(nr ^ (BITS_PER_LONG - 1), ptr); in set_bit_inv()
239 return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in clear_bit_inv()
245 return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in test_and_clear_bit_inv()
250 return __set_bit(nr ^ (BITS_PER_LONG - 1), ptr); in __set_bit_inv()
255 return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr); in __clear_bit_inv()
261 return test_bit(nr ^ (BITS_PER_LONG - 1), ptr); in test_bit_inv()
265 * __flogr - find leftmost one
266 * @word - The word to search
307 rp.even = word; in __flogr()
311 return rp.even; in __flogr()
316 * __ffs - find first bit in word.
323 return __flogr(-word & word) ^ (BITS_PER_LONG - 1); in __ffs()
327 * ffs - find first bit set
335 unsigned long mask = 2 * BITS_PER_LONG - 1; in ffs()
338 return (1 + (__flogr(-val & val) ^ (BITS_PER_LONG - 1))) & mask; in ffs()
342 * __fls - find last (most-significant) set bit in a long word
349 return __flogr(word) ^ (BITS_PER_LONG - 1); in __fls()
353 * fls64 - find last set bit in a 64-bit word
365 unsigned long mask = 2 * BITS_PER_LONG - 1; in fls64()
367 return (1 + (__flogr(word) ^ (BITS_PER_LONG - 1))) & mask; in fls64()
371 * fls - find last (most-significant) bit set
383 #include <asm-generic/bitops/const_hweight.h>
384 #include <asm-generic/bitops/ffz.h>
385 #include <asm-generic/bitops/sched.h>
386 #include <asm-generic/bitops/le.h>
387 #include <asm-generic/bitops/ext2-atomic-setbit.h>