Lines Matching +full:v +full:- +full:bit
1 /* SPDX-License-Identifier: GPL-2.0 */
10 * XFS bit manipulation routines.
14 * masks with n high/low bits set, 64-bit values
18 return (uint64_t)-1 << (64 - (n)); in xfs_mask64hi()
22 return ((uint32_t)1 << (n)) - 1; in xfs_mask32lo()
26 return ((uint64_t)1 << (n)) - 1; in xfs_mask64lo()
29 /* Get high bit set out of 32-bit argument, -1 if none set */
30 static inline int xfs_highbit32(uint32_t v) in xfs_highbit32() argument
32 return fls(v) - 1; in xfs_highbit32()
35 /* Get high bit set out of 64-bit argument, -1 if none set */
36 static inline int xfs_highbit64(uint64_t v) in xfs_highbit64() argument
38 return fls64(v) - 1; in xfs_highbit64()
41 /* Get low bit set out of 32-bit argument, -1 if none set */
42 static inline int xfs_lowbit32(uint32_t v) in xfs_lowbit32() argument
44 return ffs(v) - 1; in xfs_lowbit32()
47 /* Get low bit set out of 64-bit argument, -1 if none set */
48 static inline int xfs_lowbit64(uint64_t v) in xfs_lowbit64() argument
50 uint32_t w = (uint32_t)v; in xfs_lowbit64()
56 w = (uint32_t)(v >> 32); in xfs_lowbit64()
63 return n - 1; in xfs_lowbit64()
72 /* Find next set bit in map */