mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 19:22:27 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
5
third_party/libcxx/__charconv/traits.h
vendored
5
third_party/libcxx/__charconv/traits.h
vendored
|
@ -10,6 +10,7 @@
|
|||
#ifndef _LIBCPP___CHARCONV_TRAITS
|
||||
#define _LIBCPP___CHARCONV_TRAITS
|
||||
|
||||
#include <__assert>
|
||||
#include <__bit/countl.h>
|
||||
#include <__charconv/tables.h>
|
||||
#include <__charconv/to_chars_base_10.h>
|
||||
|
@ -101,11 +102,11 @@ struct _LIBCPP_HIDDEN __traits_base<_Tp, __enable_if_t<sizeof(_Tp) == sizeof(__u
|
|||
/// zero is set to one. This means the first element of the lookup table is
|
||||
/// zero.
|
||||
static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
|
||||
_LIBCPP_ASSERT(
|
||||
_LIBCPP_ASSERT_INTERNAL(
|
||||
__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
|
||||
// There's always a bit set in the upper 64-bits.
|
||||
auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
|
||||
_LIBCPP_ASSERT(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
|
||||
_LIBCPP_ASSERT_INTERNAL(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
|
||||
// __t is adjusted since the lookup table misses the lower entries.
|
||||
return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue