| 79 | // otherwise `[0, 8*sizof(Uint)[` |
| 80 | template <typename Uint, bool kAllowUpperBound = false> |
| 81 | constexpr auto LeastSignificantBitMask(Uint bit_index) { |
| 82 | if constexpr (kAllowUpperBound) { |
| 83 | if (bit_index == 8 * sizeof(Uint)) { |
| 84 | return ~Uint{0}; |
| 85 | } |
| 86 | } |
| 87 | return (Uint{1} << bit_index) - Uint{1}; |
| 88 | } |
| 89 | |
| 90 | // Returns 'value' rounded up to the nearest multiple of 'factor' |
| 91 | constexpr int64_t RoundUp(int64_t value, int64_t factor) { |
nothing calls this directly
no outgoing calls
no test coverage detected