mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
bitCount performance: special handling for Int16 and Int8
This commit is contained in:
parent
1e72b37a21
commit
f5f36f0199
@ -20,6 +20,10 @@ struct BitCountImpl
|
||||
return __builtin_popcountll(a);
|
||||
if constexpr (std::is_same_v<A, UInt32> || std::is_same_v<A, Int32> || std::is_unsigned_v<A>)
|
||||
return __builtin_popcount(a);
|
||||
if constexpr (std::is_same_v<A, Int16>)
|
||||
return __builtin_popcount(static_cast<UInt16>(a));
|
||||
if constexpr (std::is_same_v<A, Int8>)
|
||||
return __builtin_popcount(static_cast<UInt8>(a));
|
||||
else
|
||||
return __builtin_popcountll(ext::bit_cast<unsigned long long>(a));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user