Reverse the bytes in a 64-bit word. */
| 69 | |
| 70 | /* Reverse the bytes in a 64-bit word. */ |
| 71 | static inline uint64_t rev8(uint64_t a) { |
| 72 | #if defined(__GNUC__) || defined(__clang__) |
| 73 | return __builtin_bswap64(a); |
| 74 | #else |
| 75 | uint64_t m; |
| 76 | |
| 77 | m = UINT64_C(0xff00ff00ff00ff); |
| 78 | a = ((a >> 8) & m) | (a & m) << 8; |
| 79 | m = UINT64_C(0xffff0000ffff); |
| 80 | a = ((a >> 16) & m) | (a & m) << 16; |
| 81 | return a >> 32 | a << 32; |
| 82 | #endif |
| 83 | } |
| 84 | |
| 85 | /* This function is called once to initialize the CRC table for use on a |
| 86 | big-endian architecture. */ |
no outgoing calls
no test coverage detected