• Home
  • Raw
  • Download

Lines Matching +full:zero +full:- +full:based

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
25 * Hardware assisted Atomic-R-M-W
91 * Non hardware assisted Atomic-R-M-W
92 * Locking would change to irq-disabling only (UP) and spinlocks (SMP)
94 * There's "significant" micro-optimization in writing our own variants of
99 * is "not sure" that index is NOT -ve
205 * This is a pure count, so (1-32) or (0-31) doesn't apply
206 * It could be 0 to 32, based on num of 0's in there
232 r -= 16; in constant_fls()
236 r -= 8; in constant_fls()
240 r -= 4; in constant_fls()
244 r -= 2; in constant_fls()
247 r -= 1; in constant_fls()
253 * @result: [1-32]
261 return 32 - clz(x); in fls()
265 * __fls: Similar to fls, but zero based (0-31)
272 return fls(x) - 1; in __fls()
277 * @result: [1-32], 0 if all 0's
279 #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
282 * __ffs: Similar to ffs, but zero based (0-31)
289 return ffs(word) - 1; in __ffs()
296 * @result: [1-32]
305 " add.nz %0, %0, 1 \n" /* 0:31 -> 1:32 */ in fls()
314 * __fls: Similar to fls, but zero based (0-31). Also 0 if no bit set
324 * @result: [1-32], 0 if all 0's
332 " add.nz %0, %0, 1 \n" /* 0:31 -> 1:32 */ in ffs()
333 " mov.z %0, 0 \n" /* 31(Z)-> 0 */ in ffs()
342 * __ffs: Similar to ffs, but zero based (0-31)
350 " mov.z %0, 0 \n" /* 31(Z)-> 0 */ in __ffs()
362 * ffz = Find First Zero in word.
363 * @return:[0-31], 32 if all 1's
367 #include <asm-generic/bitops/hweight.h>
368 #include <asm-generic/bitops/fls64.h>
369 #include <asm-generic/bitops/sched.h>
370 #include <asm-generic/bitops/lock.h>
372 #include <asm-generic/bitops/find.h>
373 #include <asm-generic/bitops/le.h>
374 #include <asm-generic/bitops/ext2-atomic-setbit.h>