未验证 提交 c4e2d71b 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #8749 from ikopylov/function-bitCount-Int16-Int8-perf

bitCount performance: special handling for Int16 and Int8
......@@ -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));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册