| 92 | // Swap bytes. |
| 93 | template<typename T> |
| 94 | constexpr T BSWAP(T x) { |
| 95 | if (sizeof(T) == sizeof(uint16_t)) { |
| 96 | return __builtin_bswap16(x); |
| 97 | } else if (sizeof(T) == sizeof(uint32_t)) { |
| 98 | return __builtin_bswap32(x); |
| 99 | } else { |
| 100 | return __builtin_bswap64(x); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // Find the bit position of the most significant bit (0-based), or -1 if there were no bits set. |
| 105 | template <typename T> |
nothing calls this directly
no outgoing calls
no test coverage detected