@@ -43,10 +43,7 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) <= sizeof(uin
43
43
// /
44
44
// / The algorithm is based on
45
45
// / http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
46
- // / Instead of using IntegerLogBase2 it uses __countl_zero. Previously, it
47
- // / used __libcpp_clz. Since that function requires its input to have at
48
- // / least one bit set the value of zero is set to one. This means the first
49
- // / element of the lookup table is zero.
46
+ // / Instead of using IntegerLogBase2 it uses __countl_zero.
50
47
static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width (_Tp __v) {
51
48
auto __t = (32 - std::__countl_zero (static_cast <type>(__v | 1 ))) * 1233 >> 12 ;
52
49
return __t - (__v < __itoa::__pow10_32[__t ]) + 1 ;
@@ -69,10 +66,7 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(uin
69
66
// /
70
67
// / The algorithm is based on
71
68
// / http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
72
- // / Instead of using IntegerLogBase2 it uses __countl_zero. Previously, it
73
- // / used __libcpp_clz. Since that function requires its input to have at
74
- // / least one bit set the value of zero is set to one. This means the first
75
- // / element of the lookup table is zero.
69
+ // / Instead of using IntegerLogBase2 it uses __countl_zero.
76
70
static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width (_Tp __v) {
77
71
auto __t = (64 - std::__countl_zero (static_cast <type>(__v | 1 ))) * 1233 >> 12 ;
78
72
return __t - (__v < __itoa::__pow10_64[__t ]) + 1 ;
@@ -96,10 +90,7 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__u
96
90
// /
97
91
// / The algorithm is based on
98
92
// / http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
99
- // / Instead of using IntegerLogBase2 it uses __countl_zero. Previously, it
100
- // / used __libcpp_clz. Since that function requires its input to have at
101
- // / least one bit set the value of zero is set to one. This means the first
102
- // / element of the lookup table is zero.
93
+ // / Instead of using IntegerLogBase2 it uses __countl_zero.
103
94
static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width (_Tp __v) {
104
95
_LIBCPP_ASSERT_INTERNAL (
105
96
__v > numeric_limits<uint64_t >::max (), " The optimizations for this algorithm fail when this isn't true." );
0 commit comments