Lines Matching +full:lsb +full:- +full:first
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
23 * This is a pure count, so (1-32) or (0-31) doesn't apply
50 r -= 16; in constant_fls()
54 r -= 8; in constant_fls()
58 r -= 4; in constant_fls()
62 r -= 2; in constant_fls()
65 r -= 1; in constant_fls()
71 * @result: [1-32]
79 return 32 - clz(x); in fls()
83 * __fls: Similar to fls, but zero based (0-31)
90 return fls(x) - 1; in __fls()
94 * ffs = Find First Set in word (LSB to MSB)
95 * @result: [1-32], 0 if all 0's
97 #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
100 * __ffs: Similar to ffs, but zero based (0-31)
107 return ffs(word) - 1; in __ffs()
114 * @result: [1-32]
123 " add.nz %0, %0, 1 \n" /* 0:31 -> 1:32 */ in fls()
132 * __fls: Similar to fls, but zero based (0-31). Also 0 if no bit set
141 * ffs = Find First Set in word (LSB to MSB)
142 * @result: [1-32], 0 if all 0's
150 " add.nz %0, %0, 1 \n" /* 0:31 -> 1:32 */ in ffs()
151 " mov.z %0, 0 \n" /* 31(Z)-> 0 */ in ffs()
160 * __ffs: Similar to ffs, but zero based (0-31)
168 " mov.z %0, 0 \n" /* 31(Z)-> 0 */ in __ffs()
180 * ffz = Find First Zero in word.
181 * @return:[0-31], 32 if all 1's
185 #include <asm-generic/bitops/hweight.h>
186 #include <asm-generic/bitops/fls64.h>
187 #include <asm-generic/bitops/sched.h>
188 #include <asm-generic/bitops/lock.h>
189 #include <asm-generic/bitops/atomic.h>
190 #include <asm-generic/bitops/non-atomic.h>
192 #include <asm-generic/bitops/le.h>
193 #include <asm-generic/bitops/ext2-atomic-setbit.h>