diff --git a/src/Columns/ColumnsCommon.h b/src/Columns/ColumnsCommon.h index 607cff75a98..814c5850d57 100644 --- a/src/Columns/ColumnsCommon.h +++ b/src/Columns/ColumnsCommon.h @@ -27,17 +27,17 @@ namespace ErrorCodes inline UInt64 bytes64MaskToBits64Mask(const UInt8 * bytes64) { #if defined(__AVX512F__) && defined(__AVX512BW__) - static const __m512i zero64 = _mm512_setzero_epi32(); - UInt64 res = _mm512_cmp_epi8_mask(_mm512_loadu_si512(reinterpret_cast(bytes64)), zero64, _MM_CMPINT_EQ); + const __m512i vbytes = _mm512_loadu_si512(reinterpret_cast(bytes64)); + UInt64 res = _mm512_testn_epi8_mask(vbytes, vbytes); #elif defined(__AVX__) && defined(__AVX2__) - static const __m256i zero32 = _mm256_setzero_si256(); + const __m256i zero32 = _mm256_setzero_si256(); UInt64 res = (static_cast(_mm256_movemask_epi8(_mm256_cmpeq_epi8( _mm256_loadu_si256(reinterpret_cast(bytes64)), zero32))) & 0xffffffff) | (static_cast(_mm256_movemask_epi8(_mm256_cmpeq_epi8( _mm256_loadu_si256(reinterpret_cast(bytes64+32)), zero32))) << 32); #elif defined(__SSE2__) - static const __m128i zero16 = _mm_setzero_si128(); + const __m128i zero16 = _mm_setzero_si128(); UInt64 res = (static_cast(_mm_movemask_epi8(_mm_cmpeq_epi8( _mm_loadu_si128(reinterpret_cast(bytes64)), zero16))) & 0xffff)