修改pods
This commit is contained in:
3
Pods/abseil/absl/numeric/int128.cc
generated
3
Pods/abseil/absl/numeric/int128.cc
generated
@@ -29,9 +29,6 @@
|
||||
namespace absl {
|
||||
ABSL_NAMESPACE_BEGIN
|
||||
|
||||
ABSL_DLL const uint128 kuint128max = MakeUint128(
|
||||
std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max());
|
||||
|
||||
namespace {
|
||||
|
||||
// Returns the 0-based position of the last set bit (i.e., most significant bit)
|
||||
|
||||
40
Pods/abseil/absl/numeric/int128.h
generated
40
Pods/abseil/absl/numeric/int128.h
generated
@@ -38,6 +38,7 @@
|
||||
#include "absl/base/config.h"
|
||||
#include "absl/base/macros.h"
|
||||
#include "absl/base/port.h"
|
||||
#include "absl/types/compare.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// In very old versions of MSVC and when the /Zc:wchar_t flag is off, wchar_t is
|
||||
@@ -244,11 +245,6 @@ class
|
||||
#endif // byte order
|
||||
};
|
||||
|
||||
// Prefer to use the constexpr `Uint128Max()`.
|
||||
//
|
||||
// TODO(absl-team) deprecate kuint128max once migration tool is released.
|
||||
ABSL_DLL extern const uint128 kuint128max;
|
||||
|
||||
// allow uint128 to be logged
|
||||
std::ostream& operator<<(std::ostream& os, uint128 v);
|
||||
|
||||
@@ -274,7 +270,9 @@ class numeric_limits<absl::uint128> {
|
||||
static constexpr bool has_infinity = false;
|
||||
static constexpr bool has_quiet_NaN = false;
|
||||
static constexpr bool has_signaling_NaN = false;
|
||||
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
|
||||
static constexpr float_denorm_style has_denorm = denorm_absent;
|
||||
ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
|
||||
static constexpr bool has_denorm_loss = false;
|
||||
static constexpr float_round_style round_style = round_toward_zero;
|
||||
static constexpr bool is_iec559 = false;
|
||||
@@ -517,7 +515,9 @@ class numeric_limits<absl::int128> {
|
||||
static constexpr bool has_infinity = false;
|
||||
static constexpr bool has_quiet_NaN = false;
|
||||
static constexpr bool has_signaling_NaN = false;
|
||||
ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
|
||||
static constexpr float_denorm_style has_denorm = denorm_absent;
|
||||
ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
|
||||
static constexpr bool has_denorm_loss = false;
|
||||
static constexpr float_round_style round_style = round_toward_zero;
|
||||
static constexpr bool is_iec559 = false;
|
||||
@@ -824,6 +824,36 @@ constexpr bool operator<=(uint128 lhs, uint128 rhs) { return !(rhs < lhs); }
|
||||
|
||||
constexpr bool operator>=(uint128 lhs, uint128 rhs) { return !(lhs < rhs); }
|
||||
|
||||
#ifdef __cpp_impl_three_way_comparison
|
||||
constexpr absl::strong_ordering operator<=>(uint128 lhs, uint128 rhs) {
|
||||
#if defined(ABSL_HAVE_INTRINSIC_INT128)
|
||||
if (auto lhs_128 = static_cast<unsigned __int128>(lhs),
|
||||
rhs_128 = static_cast<unsigned __int128>(rhs);
|
||||
lhs_128 < rhs_128) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_128 > rhs_128) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else {
|
||||
return absl::strong_ordering::equal;
|
||||
}
|
||||
#else
|
||||
if (uint64_t lhs_high = Uint128High64(lhs), rhs_high = Uint128High64(rhs);
|
||||
lhs_high < rhs_high) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_high > rhs_high) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else if (uint64_t lhs_low = Uint128Low64(lhs), rhs_low = Uint128Low64(rhs);
|
||||
lhs_low < rhs_low) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_low > rhs_low) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else {
|
||||
return absl::strong_ordering::equal;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unary operators.
|
||||
|
||||
constexpr inline uint128 operator+(uint128 val) { return val; }
|
||||
|
||||
14
Pods/abseil/absl/numeric/int128_have_intrinsic.inc
generated
14
Pods/abseil/absl/numeric/int128_have_intrinsic.inc
generated
@@ -220,6 +220,20 @@ constexpr bool operator>=(int128 lhs, int128 rhs) {
|
||||
return static_cast<__int128>(lhs) >= static_cast<__int128>(rhs);
|
||||
}
|
||||
|
||||
#ifdef __cpp_impl_three_way_comparison
|
||||
constexpr absl::strong_ordering operator<=>(int128 lhs, int128 rhs) {
|
||||
if (auto lhs_128 = static_cast<__int128>(lhs),
|
||||
rhs_128 = static_cast<__int128>(rhs);
|
||||
lhs_128 < rhs_128) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_128 > rhs_128) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else {
|
||||
return absl::strong_ordering::equal;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unary operators.
|
||||
|
||||
constexpr int128 operator-(int128 v) { return -static_cast<__int128>(v); }
|
||||
|
||||
18
Pods/abseil/absl/numeric/int128_no_intrinsic.inc
generated
18
Pods/abseil/absl/numeric/int128_no_intrinsic.inc
generated
@@ -186,6 +186,24 @@ constexpr bool operator<=(int128 lhs, int128 rhs) { return !(lhs > rhs); }
|
||||
|
||||
constexpr bool operator>=(int128 lhs, int128 rhs) { return !(lhs < rhs); }
|
||||
|
||||
#ifdef __cpp_impl_three_way_comparison
|
||||
constexpr absl::strong_ordering operator<=>(int128 lhs, int128 rhs) {
|
||||
if (int64_t lhs_high = Int128High64(lhs), rhs_high = Int128High64(rhs);
|
||||
lhs_high < rhs_high) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_high > rhs_high) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else if (uint64_t lhs_low = Uint128Low64(lhs), rhs_low = Uint128Low64(rhs);
|
||||
lhs_low < rhs_low) {
|
||||
return absl::strong_ordering::less;
|
||||
} else if (lhs_low > rhs_low) {
|
||||
return absl::strong_ordering::greater;
|
||||
} else {
|
||||
return absl::strong_ordering::equal;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unary operators.
|
||||
|
||||
constexpr int128 operator-(int128 v) {
|
||||
|
||||
8
Pods/abseil/absl/numeric/internal/bits.h
generated
8
Pods/abseil/absl/numeric/internal/bits.h
generated
@@ -167,7 +167,9 @@ CountLeadingZeroes32(uint32_t x) {
|
||||
|
||||
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int
|
||||
CountLeadingZeroes16(uint16_t x) {
|
||||
#if ABSL_HAVE_BUILTIN(__builtin_clzs)
|
||||
#if ABSL_HAVE_BUILTIN(__builtin_clzg)
|
||||
return x == 0 ? 16 : __builtin_clzg(x);
|
||||
#elif ABSL_HAVE_BUILTIN(__builtin_clzs)
|
||||
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int)
|
||||
"__builtin_clzs does not take 16-bit arg");
|
||||
return x == 0 ? 16 : __builtin_clzs(x);
|
||||
@@ -303,7 +305,9 @@ CountTrailingZeroesNonzero64(uint64_t x) {
|
||||
|
||||
ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int
|
||||
CountTrailingZeroesNonzero16(uint16_t x) {
|
||||
#if ABSL_HAVE_BUILTIN(__builtin_ctzs)
|
||||
#if ABSL_HAVE_BUILTIN(__builtin_ctzg)
|
||||
return __builtin_ctzg(x);
|
||||
#elif ABSL_HAVE_BUILTIN(__builtin_ctzs)
|
||||
static_assert(sizeof(unsigned short) == sizeof(x), // NOLINT(runtime/int)
|
||||
"__builtin_ctzs does not take 16-bit arg");
|
||||
return __builtin_ctzs(x);
|
||||
|
||||
Reference in New Issue
Block a user