Lines Matching +full:high +full:- +full:end
1 // SPDX-License-Identifier: GPL-2.0
21 pub fn [<checked_bit_ $ty>](n: u32) -> Option<$ty> {
25 /// Computes `1 << n` by performing a compile-time assertion that `n` is
31 pub const fn [<bit_ $ty>](n: u32) -> $ty {
55 /// greater than the end or if the range is outside of the
59 pub fn [<genmask_checked_ $ty>](range: RangeInclusive<u32>) -> Option<$ty> {
61 let end = *range.end(); localVariable
63 if start > end {
67 let high = [<checked_bit_ $ty>](end)?; localVariable
69 Some((high | (high - 1)) & !(low - 1))
72 /// Creates a compile-time contiguous bitmask for the given range by
73 /// performing a compile-time assertion that the range is valid.
79 pub const fn [<genmask_ $ty>](range: RangeInclusive<u32>) -> $ty {
81 let end = *range.end(); localVariable
83 build_assert!(start <= end);
85 let high = [<bit_ $ty>](end); localVariable
87 (high | (high - 1)) & !(low - 1)
107 /// // Invalid range where the start is bigger than the end.
135 /// // Invalid range where the start is bigger than the end.
163 /// // Invalid range where the start is bigger than the end.
191 /// // Invalid range where the start is bigger than the end.