1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[Support] fix countLeadingZeros for types shorter than int

llvm-svn: 330762
This commit is contained in:
Sam McCall 2018-04-24 20:08:05 +00:00
parent 8601096ed0
commit d55fa2c558

View File

@ -455,7 +455,7 @@ std::size_t countLeadingOnes(T Value, ZeroBehavior ZB = ZB_Width) {
static_assert(std::numeric_limits<T>::is_integer &&
!std::numeric_limits<T>::is_signed,
"Only unsigned integral types are allowed.");
return countLeadingZeros(~Value, ZB);
return countLeadingZeros<T>(~Value, ZB);
}
/// \brief Count the number of ones from the least significant bit to the first
@ -471,7 +471,7 @@ std::size_t countTrailingOnes(T Value, ZeroBehavior ZB = ZB_Width) {
static_assert(std::numeric_limits<T>::is_integer &&
!std::numeric_limits<T>::is_signed,
"Only unsigned integral types are allowed.");
return countTrailingZeros(~Value, ZB);
return countTrailingZeros<T>(~Value, ZB);
}
namespace detail {