Merge pull request #59132 from HarryLeeIBM/hlee-arm64-hash

Fix aggregation issue in mixed x86_64 and ARM clusters
This commit is contained in:
Robert Schulze 2024-01-29 20:37:52 +01:00 committed by GitHub
commit 80066118d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,6 +71,28 @@ struct StringHashTableHash
res = _mm_crc32_u64(res, key.c);
return res;
}
#elif defined(__aarch64__) && defined(__ARM_FEATURE_CRC32)
size_t ALWAYS_INLINE operator()(StringKey8 key) const
{
size_t res = -1ULL;
res = __crc32cd(static_cast<UInt32>(res), key);
return res;
}
size_t ALWAYS_INLINE operator()(StringKey16 key) const
{
size_t res = -1ULL;
res = __crc32cd(static_cast<UInt32>(res), key.items[0]);
res = __crc32cd(static_cast<UInt32>(res), key.items[1]);
return res;
}
size_t ALWAYS_INLINE operator()(StringKey24 key) const
{
size_t res = -1ULL;
res = __crc32cd(static_cast<UInt32>(res), key.a);
res = __crc32cd(static_cast<UInt32>(res), key.b);
res = __crc32cd(static_cast<UInt32>(res), key.c);
return res;
}
#elif defined(__s390x__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
size_t ALWAYS_INLINE operator()(StringKey8 key) const
{