Lines Matching refs:__t

82 _Tp __rotl(_Tp __t, unsigned int __cnt) _NOEXCEPT
87 return __t;
88 return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig)));
93 _Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
98 return __t;
99 return (__t >> (__cnt % __dig)) | (__t << (__dig - (__cnt % __dig)));
104 int __countr_zero(_Tp __t) _NOEXCEPT
107 if (__t == 0)
111 return __libcpp_ctz(static_cast<unsigned int>(__t));
113 return __libcpp_ctz(static_cast<unsigned long>(__t));
115 return __libcpp_ctz(static_cast<unsigned long long>(__t));
120 while (static_cast<unsigned long long>(__t) == 0uLL)
123 __t >>= __ulldigits;
125 return __ret + __libcpp_ctz(static_cast<unsigned long long>(__t));
131 int __countl_zero(_Tp __t) _NOEXCEPT
134 if (__t == 0)
138 return __libcpp_clz(static_cast<unsigned int>(__t))
141 return __libcpp_clz(static_cast<unsigned long>(__t))
144 return __libcpp_clz(static_cast<unsigned long long>(__t))
152 __t = __rotr(__t, __ulldigits);
153 if ((__iter = __countl_zero(static_cast<unsigned long long>(__t))) != __ulldigits)
163 int __countl_one(_Tp __t) _NOEXCEPT
166 return __t != numeric_limits<_Tp>::max()
167 ? __countl_zero(static_cast<_Tp>(~__t))
173 int __countr_one(_Tp __t) _NOEXCEPT
176 return __t != numeric_limits<_Tp>::max()
177 ? __countr_zero(static_cast<_Tp>(~__t))
183 int __popcount(_Tp __t) _NOEXCEPT
187 return __libcpp_popcount(static_cast<unsigned int>(__t));
189 return __libcpp_popcount(static_cast<unsigned long>(__t));
191 return __libcpp_popcount(static_cast<unsigned long long>(__t));
195 while (__t != 0)
197 __ret += __libcpp_popcount(static_cast<unsigned long long>(__t));
198 __t >>= numeric_limits<unsigned long long>::digits;
207 unsigned __bit_log2(_Tp __t) _NOEXCEPT
210 return numeric_limits<_Tp>::digits - 1 - __countl_zero(__t);
215 bool __has_single_bit(_Tp __t) _NOEXCEPT
218 return __t != 0 && (((__t & (__t - 1)) == 0));
226 rotl(_Tp __t, unsigned int __cnt) noexcept
228 return __rotl(__t, __cnt);
234 rotr(_Tp __t, unsigned int __cnt) noexcept
236 return __rotr(__t, __cnt);
242 countl_zero(_Tp __t) noexcept
244 return __countl_zero(__t);
250 countl_one(_Tp __t) noexcept
252 return __countl_one(__t);
258 countr_zero(_Tp __t) noexcept
260 return __countr_zero(__t);
266 countr_one(_Tp __t) noexcept
268 return __countr_one(__t);
274 popcount(_Tp __t) noexcept
276 return __popcount(__t);
282 has_single_bit(_Tp __t) noexcept
284 return __has_single_bit(__t);
290 bit_floor(_Tp __t) noexcept
292 return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t);
298 bit_ceil(_Tp __t) noexcept
300 if (__t < 2) return 1;
301 const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u));
317 bit_width(_Tp __t) noexcept
319 return __t == 0 ? 0 : __bit_log2(__t) + 1;