Lines Matching +full:two +full:-

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
15 * non-constant log of base 2 calculators
16 * - the arch may override these in asm/bitops.h if they can be implemented
18 * - the arch is not required to handle n==0 if implementing the fallback
23 return fls(n) - 1; in __ilog2_u32()
29 return fls64(n) - 1; in __ilog2_u64()
33 * Determine whether some value is a power of two, where zero is
34 * *not* considered a power of two.
40 return (n != 0 && ((n & (n - 1)) == 0)); in is_power_of_2()
44 * round up to nearest power of two
49 return 1UL << fls_long(n - 1); in __roundup_pow_of_two()
53 * round down to nearest power of two
58 return 1UL << (fls_long(n) - 1); in __rounddown_pow_of_two()
62 * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
63 * @n - parameter
65 * constant-capable log of base 2 calculation
66 * - this can be used to initialise global variables from constant data, hence
69 * selects the appropriately-sized optimised version depending on sizeof(n)
144 * roundup_pow_of_two - round the given value up to nearest power of two
145 * @n - parameter
147 * round the given value up to the nearest power of two
148 * - the result is undefined when n == 0
149 * - this can be used to initialise global variables from constant data
155 (1UL << (ilog2((n) - 1) + 1)) \
161 * rounddown_pow_of_two - round the given value down to nearest power of two
162 * @n - parameter
164 * round the given value down to the nearest power of two
165 * - the result is undefined when n == 0
166 * - this can be used to initialise global variables from constant data