File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_clz(__uint128_t __x)
62
62
template <class _Tp >
63
63
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero (_Tp __t ) _NOEXCEPT {
64
64
static_assert (__libcpp_is_unsigned_integer<_Tp>::value, " __countl_zero requires an unsigned integer type" );
65
+ #if __has_builtin(__builtin_clzg)
66
+ return __builtin_clzg (__t , numeric_limits<_Tp>::digits);
67
+ #else // __has_builtin(__builtin_clzg)
65
68
if (__t == 0 )
66
69
return numeric_limits<_Tp>::digits;
67
70
68
- #if __has_builtin(__builtin_clzg)
69
- return __builtin_clzg (__t );
70
- #else // __has_builtin(__builtin_clzg)
71
71
if (sizeof (_Tp) <= sizeof (unsigned int ))
72
72
return std::__libcpp_clz (static_cast <unsigned int >(__t )) -
73
73
(numeric_limits<unsigned int >::digits - numeric_limits<_Tp>::digits);
Original file line number Diff line number Diff line change @@ -40,12 +40,11 @@ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __libcpp_ct
40
40
41
41
template <class _Tp >
42
42
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countr_zero (_Tp __t ) _NOEXCEPT {
43
- if (__t == 0 )
44
- return numeric_limits<_Tp>::digits;
45
-
46
43
#if __has_builtin(__builtin_ctzg)
47
- return __builtin_ctzg (__t );
44
+ return __builtin_ctzg (__t , numeric_limits<_Tp>::digits );
48
45
#else // __has_builtin(__builtin_ctzg)
46
+ if (__t == 0 )
47
+ return numeric_limits<_Tp>::digits;
49
48
if (sizeof (_Tp) <= sizeof (unsigned int ))
50
49
return std::__libcpp_ctz (static_cast <unsigned int >(__t ));
51
50
else if (sizeof (_Tp) <= sizeof (unsigned long ))
You can’t perform that action at this time.
0 commit comments