diff --git a/src/Common/HashTable/StringHashTable.h b/src/Common/HashTable/StringHashTable.h index bfa369ef8e4..f3ba54e7d6e 100644 --- a/src/Common/HashTable/StringHashTable.h +++ b/src/Common/HashTable/StringHashTable.h @@ -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(res), key); + return res; + } + size_t ALWAYS_INLINE operator()(StringKey16 key) const + { + size_t res = -1ULL; + res = __crc32cd(static_cast(res), key.items[0]); + res = __crc32cd(static_cast(res), key.items[1]); + return res; + } + size_t ALWAYS_INLINE operator()(StringKey24 key) const + { + size_t res = -1ULL; + res = __crc32cd(static_cast(res), key.a); + res = __crc32cd(static_cast(res), key.b); + res = __crc32cd(static_cast(res), key.c); + return res; + } #elif defined(__s390x__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ size_t ALWAYS_INLINE operator()(StringKey8 key) const {