mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Refactor code a little bit more.
This commit is contained in:
parent
29e0b4ec40
commit
78429eca70
@ -104,6 +104,21 @@ struct Hash
|
||||
crc2 = _mm_crc32_u32(crc2, hashes[i]);
|
||||
#else
|
||||
throw Exception("hashSum is not implemented without sse4.2 support", ErrorCodes::NOT_IMPLEMENTED);
|
||||
#endif
|
||||
return crc1 | (crc2 << 32u);
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE inline UInt64 hashSum(const UInt64 * hashes, size_t K)
|
||||
{
|
||||
UInt64 crc1 = -1ULL;
|
||||
UInt64 crc2 = -1ULL;
|
||||
#ifdef __SSE4_2__
|
||||
for (size_t i = 0; i < K; i += 2)
|
||||
crc1 = _mm_crc32_u64(crc1, hashes[i]);
|
||||
for (size_t i = 1; i < K; i += 2)
|
||||
crc2 = _mm_crc32_u64(crc2, hashes[i]);
|
||||
#else
|
||||
throw Exception("hashSum is not implemented without sse4.2 support", ErrorCodes::NOT_IMPLEMENTED);
|
||||
#endif
|
||||
return crc1 | (crc2 << 32u);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user