| 45 | } |
| 46 | |
| 47 | static inline uint16_t Pack(uint8_t index, uint8_t leading_zero, uint8_t significant_bits) { |
| 48 | static constexpr uint8_t BIT_SIZE = (sizeof(CHIMP_TYPE) * 8); |
| 49 | |
| 50 | uint16_t result = 0; |
| 51 | result += ((uint32_t)BIT_SIZE << 3) * (ChimpConstants::BUFFER_SIZE + index); |
| 52 | result += BIT_SIZE * (leading_zero & 7); |
| 53 | if (BIT_SIZE == 32) { |
| 54 | // Shift the result by 1 to occupy the 16th bit |
| 55 | result <<= 1; |
| 56 | } |
| 57 | result += (significant_bits & 63); |
| 58 | |
| 59 | return result; |
| 60 | } |
| 61 | }; |
| 62 | |
| 63 | template <bool EMPTY> |
nothing calls this directly
no outgoing calls
no test coverage detected