diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
commit | b61be8e632d1cafa8afb229ea0a5b6117ca7125b (patch) | |
tree | 96a36f21d4064f32d1912cbc85e4135788ff70b3 /contrib/restricted/abseil-cpp-tstring/y_absl/numeric | |
parent | 7ce58bf82abf75fdc15c2e6fa3aceadcfecfdca1 (diff) | |
download | ydb-b61be8e632d1cafa8afb229ea0a5b6117ca7125b.tar.gz |
intermediate changes
ref:c67faec740b4d59ed47c6dfdc7076c904650af60
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/numeric')
7 files changed, 165 insertions, 165 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h index 92cb0c3a91..a4dcd71f7a 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/bits.h @@ -31,8 +31,8 @@ // When using a standard library that implements these functions, we use the // standard library's implementation. -#ifndef ABSL_NUMERIC_BITS_H_ -#define ABSL_NUMERIC_BITS_H_ +#ifndef Y_ABSL_NUMERIC_BITS_H_ +#define Y_ABSL_NUMERIC_BITS_H_ #include <cstdint> #include <limits> @@ -48,19 +48,19 @@ #include "y_absl/numeric/internal/bits.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN #if !(defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L) // rotating template <class T> -ABSL_MUST_USE_RESULT constexpr +Y_ABSL_MUST_USE_RESULT constexpr typename std::enable_if<std::is_unsigned<T>::value, T>::type rotl(T x, int s) noexcept { return numeric_internal::RotateLeft(x, s); } template <class T> -ABSL_MUST_USE_RESULT constexpr +Y_ABSL_MUST_USE_RESULT constexpr typename std::enable_if<std::is_unsigned<T>::value, T>::type rotr(T x, int s) noexcept { return numeric_internal::RotateRight(x, s); @@ -72,14 +72,14 @@ ABSL_MUST_USE_RESULT constexpr // not be marked as constexpr due to constraints of the compiler/available // intrinsics. template <class T> -ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, int>::type countl_zero(T x) noexcept { return numeric_internal::CountLeadingZeroes(x); } template <class T> -ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, int>::type countl_one(T x) noexcept { // Avoid integer promotion to a wider type @@ -87,14 +87,14 @@ ABSL_INTERNAL_CONSTEXPR_CLZ inline } template <class T> -ABSL_INTERNAL_CONSTEXPR_CTZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline typename std::enable_if<std::is_unsigned<T>::value, int>::type countr_zero(T x) noexcept { return numeric_internal::CountTrailingZeroes(x); } template <class T> -ABSL_INTERNAL_CONSTEXPR_CTZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline typename std::enable_if<std::is_unsigned<T>::value, int>::type countr_one(T x) noexcept { // Avoid integer promotion to a wider type @@ -102,7 +102,7 @@ ABSL_INTERNAL_CONSTEXPR_CTZ inline } template <class T> -ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline +Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline typename std::enable_if<std::is_unsigned<T>::value, int>::type popcount(T x) noexcept { return numeric_internal::Popcount(x); @@ -130,7 +130,7 @@ has_single_bit(T x) noexcept { // Returns: If x == 0, 0; otherwise one plus the base-2 logarithm of x, with any // fractional part discarded. template <class T> -ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_width(T x) noexcept { return std::numeric_limits<T>::digits - countl_zero(x); @@ -139,7 +139,7 @@ ABSL_INTERNAL_CONSTEXPR_CLZ inline // Returns: If x == 0, 0; otherwise the maximal value y such that // has_single_bit(y) is true and y <= x. template <class T> -ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_floor(T x) noexcept { return x == 0 ? 0 : T{1} << (bit_width(x) - 1); @@ -149,7 +149,7 @@ ABSL_INTERNAL_CONSTEXPR_CLZ inline // // Preconditions: N is representable as a value of type T. template <class T> -ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_ceil(T x) { // If T is narrower than unsigned, T{1} << bit_width will be promoted. We @@ -171,7 +171,7 @@ using std::has_single_bit; #endif -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_NUMERIC_BITS_H_ +#endif // Y_ABSL_NUMERIC_BITS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.cc index 6172372d75..90b7181c7b 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.cc @@ -27,9 +27,9 @@ #include "y_absl/numeric/bits.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN -ABSL_DLL const uint128 kuint128max = MakeUint128( +Y_ABSL_DLL const uint128 kuint128max = MakeUint128( std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max()); namespace { @@ -40,13 +40,13 @@ namespace { // For example: // Given: 5 (decimal) == 101 (binary) // Returns: 2 -inline ABSL_ATTRIBUTE_ALWAYS_INLINE int Fls128(uint128 n) { +inline Y_ABSL_ATTRIBUTE_ALWAYS_INLINE int Fls128(uint128 n) { if (uint64_t hi = Uint128High64(n)) { - ABSL_INTERNAL_ASSUME(hi != 0); + Y_ABSL_INTERNAL_ASSUME(hi != 0); return 127 - countl_zero(hi); } const uint64_t low = Uint128Low64(n); - ABSL_INTERNAL_ASSUME(low != 0); + Y_ABSL_INTERNAL_ASSUME(low != 0); return 63 - countl_zero(low); } @@ -138,7 +138,7 @@ uint128::uint128(float v) : uint128(MakeUint128FromFloat(v)) {} uint128::uint128(double v) : uint128(MakeUint128FromFloat(v)) {} uint128::uint128(long double v) : uint128(MakeUint128FromFloat(v)) {} -#if !defined(ABSL_HAVE_INTRINSIC_INT128) +#if !defined(Y_ABSL_HAVE_INTRINSIC_INT128) uint128 operator/(uint128 lhs, uint128 rhs) { uint128 quotient = 0; uint128 remainder = 0; @@ -152,7 +152,7 @@ uint128 operator%(uint128 lhs, uint128 rhs) { DivModImpl(lhs, rhs, "ient, &remainder); return remainder; } -#endif // !defined(ABSL_HAVE_INTRINSIC_INT128) +#endif // !defined(Y_ABSL_HAVE_INTRINSIC_INT128) namespace { @@ -233,7 +233,7 @@ uint128 UnsignedAbsoluteValue(int128 v) { } // namespace -#if !defined(ABSL_HAVE_INTRINSIC_INT128) +#if !defined(Y_ABSL_HAVE_INTRINSIC_INT128) namespace { template <typename T> @@ -282,7 +282,7 @@ int128 operator%(int128 lhs, int128 rhs) { return MakeInt128(int128_internal::BitCastToSigned(Uint128High64(remainder)), Uint128Low64(remainder)); } -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 std::ostream& operator<<(std::ostream& os, int128 v) { std::ios_base::fmtflags flags = os.flags(); @@ -329,7 +329,7 @@ std::ostream& operator<<(std::ostream& os, int128 v) { return os << rep; } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl namespace std { diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.h b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.h index b54d614ce9..ef5ff99c78 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128.h @@ -23,8 +23,8 @@ // are defined in this file, while many inline `int128` methods are defined in // the `int128_*_intrinsic.inc` files. -#ifndef ABSL_NUMERIC_INT128_H_ -#define ABSL_NUMERIC_INT128_H_ +#ifndef Y_ABSL_NUMERIC_INT128_H_ +#define Y_ABSL_NUMERIC_INT128_H_ #include <cassert> #include <cmath> @@ -43,17 +43,17 @@ // a typedef for unsigned short. Otherwise wchar_t is mapped to the __wchar_t // builtin type. We need to make sure not to define operator wchar_t() // alongside operator unsigned short() in these instances. -#define ABSL_INTERNAL_WCHAR_T __wchar_t +#define Y_ABSL_INTERNAL_WCHAR_T __wchar_t #if defined(_M_X64) #include <intrin.h> #pragma intrinsic(_umul128) #endif // defined(_M_X64) #else // defined(_MSC_VER) -#define ABSL_INTERNAL_WCHAR_T wchar_t +#define Y_ABSL_INTERNAL_WCHAR_T wchar_t #endif // defined(_MSC_VER) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN class int128; @@ -77,7 +77,7 @@ class int128; // // Additionally, if your compiler supports `__int128`, `uint128` is // interoperable with that type. (Abseil checks for this compatibility through -// the `ABSL_HAVE_INTRINSIC_INT128` macro.) +// the `Y_ABSL_HAVE_INTRINSIC_INT128` macro.) // // However, a `uint128` differs from intrinsic integral types in the following // ways: @@ -102,9 +102,9 @@ class int128; // uint64_t i = static_cast<uint64_t>(v); // OK // class -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) alignas(unsigned __int128) -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 uint128 { public: uint128() = default; @@ -116,10 +116,10 @@ class constexpr uint128(unsigned long v); // NOLINT(runtime/int) constexpr uint128(long long v); // NOLINT(runtime/int) constexpr uint128(unsigned long long v); // NOLINT(runtime/int) -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128(__int128 v); // NOLINT(runtime/explicit) constexpr uint128(unsigned __int128 v); // NOLINT(runtime/explicit) -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128(int128 v); // NOLINT(runtime/explicit) explicit uint128(float v); explicit uint128(double v); @@ -132,10 +132,10 @@ class uint128& operator=(unsigned long v); // NOLINT(runtime/int) uint128& operator=(long long v); // NOLINT(runtime/int) uint128& operator=(unsigned long long v); // NOLINT(runtime/int) -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 uint128& operator=(__int128 v); uint128& operator=(unsigned __int128 v); -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 uint128& operator=(int128 v); // Conversion operators to other arithmetic types @@ -145,7 +145,7 @@ class constexpr explicit operator unsigned char() const; constexpr explicit operator char16_t() const; constexpr explicit operator char32_t() const; - constexpr explicit operator ABSL_INTERNAL_WCHAR_T() const; + constexpr explicit operator Y_ABSL_INTERNAL_WCHAR_T() const; constexpr explicit operator short() const; // NOLINT(runtime/int) // NOLINTNEXTLINE(runtime/int) constexpr explicit operator unsigned short() const; @@ -158,10 +158,10 @@ class constexpr explicit operator long long() const; // NOLINTNEXTLINE(runtime/int) constexpr explicit operator unsigned long long() const; -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr explicit operator __int128() const; constexpr explicit operator unsigned __int128() const; -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 explicit operator float() const; explicit operator double() const; explicit operator long double() const; @@ -224,10 +224,10 @@ class // uint128 are fixed to not depend on alignof(uint128) == 8. Also add // alignas(16) to class definition to keep alignment consistent across // platforms. -#if defined(ABSL_IS_LITTLE_ENDIAN) +#if defined(Y_ABSL_IS_LITTLE_ENDIAN) uint64_t lo_; uint64_t hi_; -#elif defined(ABSL_IS_BIG_ENDIAN) +#elif defined(Y_ABSL_IS_BIG_ENDIAN) uint64_t hi_; uint64_t lo_; #else // byte order @@ -238,7 +238,7 @@ class // Prefer to use the constexpr `Uint128Max()`. // // TODO(y_absl-team) deprecate kuint128max once migration tool is released. -ABSL_DLL extern const uint128 kuint128max; +Y_ABSL_DLL extern const uint128 kuint128max; // allow uint128 to be logged std::ostream& operator<<(std::ostream& os, uint128 v); @@ -250,7 +250,7 @@ constexpr uint128 Uint128Max() { (std::numeric_limits<uint64_t>::max)()); } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl // Specialized numeric_limits for uint128. @@ -279,11 +279,11 @@ class numeric_limits<y_absl::uint128> { static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool traps = numeric_limits<unsigned __int128>::traps; -#else // ABSL_HAVE_INTRINSIC_INT128 +#else // Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool traps = numeric_limits<uint64_t>::traps; -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool tinyness_before = false; static constexpr y_absl::uint128 (min)() { return 0; } @@ -299,7 +299,7 @@ class numeric_limits<y_absl::uint128> { } // namespace std namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // int128 // @@ -321,7 +321,7 @@ ABSL_NAMESPACE_BEGIN // Additionally, if your compiler supports `__int128`, `int128` is // interoperable with that type. (Abseil checks for this compatibility through -// the `ABSL_HAVE_INTRINSIC_INT128` macro.) +// the `Y_ABSL_HAVE_INTRINSIC_INT128` macro.) // // The design goal for `int128` is that it will be compatible with a future // `int128_t`, if that type becomes a part of the standard. @@ -346,10 +346,10 @@ class int128 { constexpr int128(unsigned long v); // NOLINT(runtime/int) constexpr int128(long long v); // NOLINT(runtime/int) constexpr int128(unsigned long long v); // NOLINT(runtime/int) -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr int128(__int128 v); // NOLINT(runtime/explicit) constexpr explicit int128(unsigned __int128 v); -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 constexpr explicit int128(uint128 v); explicit int128(float v); explicit int128(double v); @@ -362,9 +362,9 @@ class int128 { int128& operator=(unsigned long v); // NOLINT(runtime/int) int128& operator=(long long v); // NOLINT(runtime/int) int128& operator=(unsigned long long v); // NOLINT(runtime/int) -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 int128& operator=(__int128 v); -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 // Conversion operators to other arithmetic types constexpr explicit operator bool() const; @@ -373,7 +373,7 @@ class int128 { constexpr explicit operator unsigned char() const; constexpr explicit operator char16_t() const; constexpr explicit operator char32_t() const; - constexpr explicit operator ABSL_INTERNAL_WCHAR_T() const; + constexpr explicit operator Y_ABSL_INTERNAL_WCHAR_T() const; constexpr explicit operator short() const; // NOLINT(runtime/int) // NOLINTNEXTLINE(runtime/int) constexpr explicit operator unsigned short() const; @@ -386,10 +386,10 @@ class int128 { constexpr explicit operator long long() const; // NOLINTNEXTLINE(runtime/int) constexpr explicit operator unsigned long long() const; -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr explicit operator __int128() const; constexpr explicit operator unsigned __int128() const; -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 explicit operator float() const; explicit operator double() const; explicit operator long double() const; @@ -457,19 +457,19 @@ class int128 { private: constexpr int128(int64_t high, uint64_t low); -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) __int128 v_; -#else // ABSL_HAVE_INTRINSIC_INT128 -#if defined(ABSL_IS_LITTLE_ENDIAN) +#else // Y_ABSL_HAVE_INTRINSIC_INT128 +#if defined(Y_ABSL_IS_LITTLE_ENDIAN) uint64_t lo_; int64_t hi_; -#elif defined(ABSL_IS_BIG_ENDIAN) +#elif defined(Y_ABSL_IS_BIG_ENDIAN) int64_t hi_; uint64_t lo_; #else // byte order #error "Unsupported byte order: must be little-endian or big-endian." #endif // byte order -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 }; std::ostream& operator<<(std::ostream& os, int128 v); @@ -485,7 +485,7 @@ constexpr int128 Int128Min() { return int128((std::numeric_limits<int64_t>::min)(), 0); } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl // Specialized numeric_limits for int128. @@ -514,11 +514,11 @@ class numeric_limits<y_absl::int128> { static constexpr int min_exponent10 = 0; static constexpr int max_exponent = 0; static constexpr int max_exponent10 = 0; -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool traps = numeric_limits<__int128>::traps; -#else // ABSL_HAVE_INTRINSIC_INT128 +#else // Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool traps = numeric_limits<uint64_t>::traps; -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 static constexpr bool tinyness_before = false; static constexpr y_absl::int128 (min)() { return y_absl::Int128Min(); } @@ -537,7 +537,7 @@ class numeric_limits<y_absl::int128> { // Implementation details follow // -------------------------------------------------------------------------- namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN constexpr uint128 MakeUint128(uint64_t high, uint64_t low) { return uint128(high, low); @@ -570,7 +570,7 @@ inline uint128& uint128::operator=(unsigned long long v) { return *this = uint128(v); } -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 inline uint128& uint128::operator=(__int128 v) { return *this = uint128(v); } @@ -578,7 +578,7 @@ inline uint128& uint128::operator=(__int128 v) { inline uint128& uint128::operator=(unsigned __int128 v) { return *this = uint128(v); } -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 inline uint128& uint128::operator=(int128 v) { return *this = uint128(v); @@ -635,7 +635,7 @@ constexpr uint64_t Uint128High64(uint128 v) { return v.hi_; } // Constructors from integer types. -#if defined(ABSL_IS_LITTLE_ENDIAN) +#if defined(Y_ABSL_IS_LITTLE_ENDIAN) constexpr uint128::uint128(uint64_t high, uint64_t low) : lo_{low}, hi_{high} {} @@ -656,19 +656,19 @@ constexpr uint128::uint128(unsigned long v) : lo_{v}, hi_{0} {} // NOLINTNEXTLINE(runtime/int) constexpr uint128::uint128(unsigned long long v) : lo_{v}, hi_{0} {} -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128::uint128(__int128 v) : lo_{static_cast<uint64_t>(v & ~uint64_t{0})}, hi_{static_cast<uint64_t>(static_cast<unsigned __int128>(v) >> 64)} {} constexpr uint128::uint128(unsigned __int128 v) : lo_{static_cast<uint64_t>(v & ~uint64_t{0})}, hi_{static_cast<uint64_t>(v >> 64)} {} -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128::uint128(int128 v) : lo_{Int128Low64(v)}, hi_{static_cast<uint64_t>(Int128High64(v))} {} -#elif defined(ABSL_IS_BIG_ENDIAN) +#elif defined(Y_ABSL_IS_BIG_ENDIAN) constexpr uint128::uint128(uint64_t high, uint64_t low) : hi_{high}, lo_{low} {} @@ -689,14 +689,14 @@ constexpr uint128::uint128(unsigned long v) : hi_{0}, lo_{v} {} // NOLINTNEXTLINE(runtime/int) constexpr uint128::uint128(unsigned long long v) : hi_{0}, lo_{v} {} -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128::uint128(__int128 v) : hi_{static_cast<uint64_t>(static_cast<unsigned __int128>(v) >> 64)}, lo_{static_cast<uint64_t>(v & ~uint64_t{0})} {} constexpr uint128::uint128(unsigned __int128 v) : hi_{static_cast<uint64_t>(v >> 64)}, lo_{static_cast<uint64_t>(v & ~uint64_t{0})} {} -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128::uint128(int128 v) : hi_{static_cast<uint64_t>(Int128High64(v))}, lo_{Int128Low64(v)} {} @@ -727,8 +727,8 @@ constexpr uint128::operator char32_t() const { return static_cast<char32_t>(lo_); } -constexpr uint128::operator ABSL_INTERNAL_WCHAR_T() const { - return static_cast<ABSL_INTERNAL_WCHAR_T>(lo_); +constexpr uint128::operator Y_ABSL_INTERNAL_WCHAR_T() const { + return static_cast<Y_ABSL_INTERNAL_WCHAR_T>(lo_); } // NOLINTNEXTLINE(runtime/int) @@ -759,7 +759,7 @@ constexpr uint128::operator unsigned long long() const { // NOLINT(runtime/int) return static_cast<unsigned long long>(lo_); // NOLINT(runtime/int) } -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 constexpr uint128::operator __int128() const { return (static_cast<__int128>(hi_) << 64) + lo_; } @@ -767,7 +767,7 @@ constexpr uint128::operator __int128() const { constexpr uint128::operator unsigned __int128() const { return (static_cast<unsigned __int128>(hi_) << 64) + lo_; } -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 // Conversion operators to floating point types. @@ -787,7 +787,7 @@ inline uint128::operator long double() const { // Comparison operators. constexpr bool operator==(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) == static_cast<unsigned __int128>(rhs); #else @@ -799,7 +799,7 @@ constexpr bool operator==(uint128 lhs, uint128 rhs) { constexpr bool operator!=(uint128 lhs, uint128 rhs) { return !(lhs == rhs); } constexpr bool operator<(uint128 lhs, uint128 rhs) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 return static_cast<unsigned __int128>(lhs) < static_cast<unsigned __int128>(rhs); #else @@ -826,7 +826,7 @@ constexpr inline int128 operator+(int128 val) { } constexpr uint128 operator-(uint128 val) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return -static_cast<unsigned __int128>(val); #else return MakeUint128( @@ -836,7 +836,7 @@ constexpr uint128 operator-(uint128 val) { } constexpr inline bool operator!(uint128 val) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return !static_cast<unsigned __int128>(val); #else return !Uint128High64(val) && !Uint128Low64(val); @@ -846,7 +846,7 @@ constexpr inline bool operator!(uint128 val) { // Logical operators. constexpr inline uint128 operator~(uint128 val) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return ~static_cast<unsigned __int128>(val); #else return MakeUint128(~Uint128High64(val), ~Uint128Low64(val)); @@ -854,7 +854,7 @@ constexpr inline uint128 operator~(uint128 val) { } constexpr inline uint128 operator|(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) | static_cast<unsigned __int128>(rhs); #else @@ -864,7 +864,7 @@ constexpr inline uint128 operator|(uint128 lhs, uint128 rhs) { } constexpr inline uint128 operator&(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) & static_cast<unsigned __int128>(rhs); #else @@ -874,7 +874,7 @@ constexpr inline uint128 operator&(uint128 lhs, uint128 rhs) { } constexpr inline uint128 operator^(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) ^ static_cast<unsigned __int128>(rhs); #else @@ -901,7 +901,7 @@ inline uint128& uint128::operator^=(uint128 other) { // Arithmetic operators. constexpr uint128 operator<<(uint128 lhs, int amount) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 return static_cast<unsigned __int128>(lhs) << amount; #else // uint64_t shifts of >= 64 are undefined, so we will need some @@ -915,7 +915,7 @@ constexpr uint128 operator<<(uint128 lhs, int amount) { } constexpr uint128 operator>>(uint128 lhs, int amount) { -#ifdef ABSL_HAVE_INTRINSIC_INT128 +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 return static_cast<unsigned __int128>(lhs) >> amount; #else // uint64_t shifts of >= 64 are undefined, so we will need some @@ -928,7 +928,7 @@ constexpr uint128 operator>>(uint128 lhs, int amount) { #endif } -#if !defined(ABSL_HAVE_INTRINSIC_INT128) +#if !defined(Y_ABSL_HAVE_INTRINSIC_INT128) namespace int128_internal { constexpr uint128 AddResult(uint128 result, uint128 lhs) { // check for carry @@ -940,7 +940,7 @@ constexpr uint128 AddResult(uint128 result, uint128 lhs) { #endif constexpr uint128 operator+(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) + static_cast<unsigned __int128>(rhs); #else @@ -951,7 +951,7 @@ constexpr uint128 operator+(uint128 lhs, uint128 rhs) { #endif } -#if !defined(ABSL_HAVE_INTRINSIC_INT128) +#if !defined(Y_ABSL_HAVE_INTRINSIC_INT128) namespace int128_internal { constexpr uint128 SubstructResult(uint128 result, uint128 lhs, uint128 rhs) { // check for carry @@ -963,7 +963,7 @@ constexpr uint128 SubstructResult(uint128 result, uint128 lhs, uint128 rhs) { #endif constexpr uint128 operator-(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) return static_cast<unsigned __int128>(lhs) - static_cast<unsigned __int128>(rhs); #else @@ -975,7 +975,7 @@ constexpr uint128 operator-(uint128 lhs, uint128 rhs) { } inline uint128 operator*(uint128 lhs, uint128 rhs) { -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) // TODO(strel) Remove once alignment issues are resolved and unsigned __int128 // can be used for uint128 storage. return static_cast<unsigned __int128>(lhs) * @@ -986,7 +986,7 @@ inline uint128 operator*(uint128 lhs, uint128 rhs) { return MakeUint128(Uint128Low64(lhs) * Uint128High64(rhs) + Uint128High64(lhs) * Uint128Low64(rhs) + carry, low); -#else // ABSL_HAVE_INTRINSIC128 +#else // Y_ABSL_HAVE_INTRINSIC128 uint64_t a32 = Uint128Low64(lhs) >> 32; uint64_t a00 = Uint128Low64(lhs) & 0xffffffff; uint64_t b32 = Uint128Low64(rhs) >> 32; @@ -998,10 +998,10 @@ inline uint128 operator*(uint128 lhs, uint128 rhs) { result += uint128(a32 * b00) << 32; result += uint128(a00 * b32) << 32; return result; -#endif // ABSL_HAVE_INTRINSIC128 +#endif // Y_ABSL_HAVE_INTRINSIC128 } -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) inline uint128 operator/(uint128 lhs, uint128 rhs) { return static_cast<unsigned __int128>(lhs) / static_cast<unsigned __int128>(rhs); @@ -1151,15 +1151,15 @@ constexpr int64_t BitCastToSigned(uint64_t v) { } // namespace int128_internal -#if defined(ABSL_HAVE_INTRINSIC_INT128) +#if defined(Y_ABSL_HAVE_INTRINSIC_INT128) #include "y_absl/numeric/int128_have_intrinsic.inc" // IWYU pragma: export -#else // ABSL_HAVE_INTRINSIC_INT128 +#else // Y_ABSL_HAVE_INTRINSIC_INT128 #include "y_absl/numeric/int128_no_intrinsic.inc" // IWYU pragma: export -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#undef ABSL_INTERNAL_WCHAR_T +#undef Y_ABSL_INTERNAL_WCHAR_T -#endif // ABSL_NUMERIC_INT128_H_ +#endif // Y_ABSL_NUMERIC_INT128_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_have_intrinsic.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_have_intrinsic.inc index 3945fa2983..55f2026785 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_have_intrinsic.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_have_intrinsic.inc @@ -14,8 +14,8 @@ // limitations under the License. // This file contains :int128 implementation details that depend on internal -// representation when ABSL_HAVE_INTRINSIC_INT128 is defined. This file is -// included by int128.h and relies on ABSL_INTERNAL_WCHAR_T being defined. +// representation when Y_ABSL_HAVE_INTRINSIC_INT128 is defined. This file is +// included by int128.h and relies on Y_ABSL_INTERNAL_WCHAR_T being defined. namespace int128_internal { @@ -107,8 +107,8 @@ constexpr int128::operator char32_t() const { return static_cast<char32_t>(v_); } -constexpr int128::operator ABSL_INTERNAL_WCHAR_T() const { - return static_cast<ABSL_INTERNAL_WCHAR_T>(v_); +constexpr int128::operator Y_ABSL_INTERNAL_WCHAR_T() const { + return static_cast<Y_ABSL_INTERNAL_WCHAR_T>(v_); } constexpr int128::operator short() const { // NOLINT(runtime/int) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_no_intrinsic.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_no_intrinsic.inc index 8834804cec..8354bd5615 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_no_intrinsic.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/int128_no_intrinsic.inc @@ -14,14 +14,14 @@ // limitations under the License. // This file contains :int128 implementation details that depend on internal -// representation when ABSL_HAVE_INTRINSIC_INT128 is *not* defined. This file -// is included by int128.h and relies on ABSL_INTERNAL_WCHAR_T being defined. +// representation when Y_ABSL_HAVE_INTRINSIC_INT128 is *not* defined. This file +// is included by int128.h and relies on Y_ABSL_INTERNAL_WCHAR_T being defined. constexpr uint64_t Int128Low64(int128 v) { return v.lo_; } constexpr int64_t Int128High64(int128 v) { return v.hi_; } -#if defined(ABSL_IS_LITTLE_ENDIAN) +#if defined(Y_ABSL_IS_LITTLE_ENDIAN) constexpr int128::int128(int64_t high, uint64_t low) : lo_(low), hi_(high) {} @@ -42,7 +42,7 @@ constexpr int128::int128(unsigned long long v) : lo_{v}, hi_{0} {} constexpr int128::int128(uint128 v) : lo_{Uint128Low64(v)}, hi_{static_cast<int64_t>(Uint128High64(v))} {} -#elif defined(ABSL_IS_BIG_ENDIAN) +#elif defined(Y_ABSL_IS_BIG_ENDIAN) constexpr int128::int128(int64_t high, uint64_t low) : hi_{high}, lo_{low} {} @@ -91,9 +91,9 @@ constexpr int128::operator char32_t() const { return static_cast<char32_t>(lo_); } -constexpr int128::operator ABSL_INTERNAL_WCHAR_T() const { +constexpr int128::operator Y_ABSL_INTERNAL_WCHAR_T() const { // NOLINTNEXTLINE(runtime/int) - return static_cast<ABSL_INTERNAL_WCHAR_T>(static_cast<long long>(*this)); + return static_cast<Y_ABSL_INTERNAL_WCHAR_T>(static_cast<long long>(*this)); } constexpr int128::operator short() const { // NOLINT(runtime/int) diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/bits.h b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/bits.h index 2a517399b0..a19e3c6bbc 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/bits.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/bits.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_NUMERIC_INTERNAL_BITS_H_ -#define ABSL_NUMERIC_INTERNAL_BITS_H_ +#ifndef Y_ABSL_NUMERIC_INTERNAL_BITS_H_ +#define Y_ABSL_NUMERIC_INTERNAL_BITS_H_ #include <cstdint> #include <limits> @@ -30,40 +30,40 @@ #if defined(__GNUC__) && !defined(__clang__) // GCC -#define ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(x) 1 +#define Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(x) 1 #else -#define ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(x) ABSL_HAVE_BUILTIN(x) +#define Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(x) Y_ABSL_HAVE_BUILTIN(x) #endif -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountl) && \ - ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountll) -#define ABSL_INTERNAL_CONSTEXPR_POPCOUNT constexpr -#define ABSL_INTERNAL_HAS_CONSTEXPR_POPCOUNT 1 +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountl) && \ + Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountll) +#define Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT constexpr +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_POPCOUNT 1 #else -#define ABSL_INTERNAL_CONSTEXPR_POPCOUNT -#define ABSL_INTERNAL_HAS_CONSTEXPR_POPCOUNT 0 +#define Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_POPCOUNT 0 #endif -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clz) && \ - ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clzll) -#define ABSL_INTERNAL_CONSTEXPR_CLZ constexpr -#define ABSL_INTERNAL_HAS_CONSTEXPR_CLZ 1 +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clz) && \ + Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clzll) +#define Y_ABSL_INTERNAL_CONSTEXPR_CLZ constexpr +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_CLZ 1 #else -#define ABSL_INTERNAL_CONSTEXPR_CLZ -#define ABSL_INTERNAL_HAS_CONSTEXPR_CLZ 0 +#define Y_ABSL_INTERNAL_CONSTEXPR_CLZ +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_CLZ 0 #endif -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctz) && \ - ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctzll) -#define ABSL_INTERNAL_CONSTEXPR_CTZ constexpr -#define ABSL_INTERNAL_HAS_CONSTEXPR_CTZ 1 +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctz) && \ + Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctzll) +#define Y_ABSL_INTERNAL_CONSTEXPR_CTZ constexpr +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_CTZ 1 #else -#define ABSL_INTERNAL_CONSTEXPR_CTZ -#define ABSL_INTERNAL_HAS_CONSTEXPR_CTZ 0 +#define Y_ABSL_INTERNAL_CONSTEXPR_CTZ +#define Y_ABSL_INTERNAL_HAS_CONSTEXPR_CTZ 0 #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace numeric_internal { constexpr bool IsPowerOf2(unsigned int x) noexcept { @@ -71,7 +71,7 @@ constexpr bool IsPowerOf2(unsigned int x) noexcept { } template <class T> -ABSL_MUST_USE_RESULT ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateRight( +Y_ABSL_MUST_USE_RESULT Y_ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateRight( T x, int s) noexcept { static_assert(std::is_unsigned<T>::value, "T must be unsigned"); static_assert(IsPowerOf2(std::numeric_limits<T>::digits), @@ -82,7 +82,7 @@ ABSL_MUST_USE_RESULT ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateRight( } template <class T> -ABSL_MUST_USE_RESULT ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateLeft( +Y_ABSL_MUST_USE_RESULT Y_ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateLeft( T x, int s) noexcept { static_assert(std::is_unsigned<T>::value, "T must be unsigned"); static_assert(IsPowerOf2(std::numeric_limits<T>::digits), @@ -92,9 +92,9 @@ ABSL_MUST_USE_RESULT ABSL_ATTRIBUTE_ALWAYS_INLINE constexpr T RotateLeft( static_cast<T>(x >> ((-s) & (std::numeric_limits<T>::digits - 1))); } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int Popcount32(uint32_t x) noexcept { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcount) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcount) static_assert(sizeof(unsigned int) == sizeof(x), "__builtin_popcount does not take 32-bit arg"); return __builtin_popcount(x); @@ -105,9 +105,9 @@ Popcount32(uint32_t x) noexcept { #endif } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int Popcount64(uint64_t x) noexcept { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountll) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_popcountll) static_assert(sizeof(unsigned long long) == sizeof(x), // NOLINT(runtime/int) "__builtin_popcount does not take 64-bit arg"); return __builtin_popcountll(x); @@ -120,7 +120,7 @@ Popcount64(uint64_t x) noexcept { } template <class T> -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline int Popcount(T x) noexcept { static_assert(std::is_unsigned<T>::value, "T must be unsigned"); static_assert(IsPowerOf2(std::numeric_limits<T>::digits), @@ -129,9 +129,9 @@ Popcount(T x) noexcept { return sizeof(x) <= sizeof(uint32_t) ? Popcount32(x) : Popcount64(x); } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline int CountLeadingZeroes32(uint32_t x) { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clz) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clz) // Use __builtin_clz, which uses the following instructions: // x86: bsr, lzcnt // ARM64: clz @@ -165,9 +165,9 @@ CountLeadingZeroes32(uint32_t x) { #endif } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline int CountLeadingZeroes16(uint16_t x) { -#if ABSL_HAVE_BUILTIN(__builtin_clzs) +#if Y_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); @@ -176,9 +176,9 @@ CountLeadingZeroes16(uint16_t x) { #endif } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline int CountLeadingZeroes64(uint64_t x) { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clzll) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_clzll) // Use __builtin_clzll, which uses the following instructions: // x86: bsr, lzcnt // ARM64: clz @@ -230,7 +230,7 @@ CountLeadingZeroes64(uint64_t x) { } template <typename T> -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline int CountLeadingZeroes(T x) { static_assert(std::is_unsigned<T>::value, "T must be unsigned"); static_assert(IsPowerOf2(std::numeric_limits<T>::digits), @@ -247,9 +247,9 @@ CountLeadingZeroes(T x) { : CountLeadingZeroes64(x)); } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline int CountTrailingZeroesNonzero32(uint32_t x) { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctz) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctz) static_assert(sizeof(unsigned int) == sizeof(x), "__builtin_ctz does not take 32-bit arg"); return __builtin_ctz(x); @@ -269,9 +269,9 @@ CountTrailingZeroesNonzero32(uint32_t x) { #endif } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline int CountTrailingZeroesNonzero64(uint64_t x) { -#if ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctzll) +#if Y_ABSL_NUMERIC_INTERNAL_HAVE_BUILTIN_OR_GCC(__builtin_ctzll) static_assert(sizeof(unsigned long long) == sizeof(x), // NOLINT(runtime/int) "__builtin_ctzll does not take 64-bit arg"); return __builtin_ctzll(x); @@ -301,9 +301,9 @@ CountTrailingZeroesNonzero64(uint64_t x) { #endif } -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline int CountTrailingZeroesNonzero16(uint16_t x) { -#if ABSL_HAVE_BUILTIN(__builtin_ctzs) +#if Y_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); @@ -313,7 +313,7 @@ CountTrailingZeroesNonzero16(uint16_t x) { } template <class T> -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CTZ inline int +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CTZ inline int CountTrailingZeroes(T x) noexcept { static_assert(std::is_unsigned<T>::value, "T must be unsigned"); static_assert(IsPowerOf2(std::numeric_limits<T>::digits), @@ -332,14 +332,14 @@ CountTrailingZeroes(T x) noexcept { // want to force it to wraparound so that bit_ceil of an invalid value are not // core constant expressions. template <class T> -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, T>::type BitCeilPromotionHelper(T x, T promotion) { return (T{1} << (x + promotion)) >> promotion; } template <class T> -ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline +Y_ABSL_ATTRIBUTE_ALWAYS_INLINE Y_ABSL_INTERNAL_CONSTEXPR_CLZ inline typename std::enable_if<std::is_unsigned<T>::value, T>::type BitCeilNonPowerOf2(T x) { // If T is narrower than unsigned, it undergoes promotion to unsigned when we @@ -352,7 +352,7 @@ ABSL_ATTRIBUTE_ALWAYS_INLINE ABSL_INTERNAL_CONSTEXPR_CLZ inline } } // namespace numeric_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_NUMERIC_INTERNAL_BITS_H_ +#endif // Y_ABSL_NUMERIC_INTERNAL_BITS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/representation.h b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/representation.h index 0761cf39bc..05422c4b75 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/representation.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/numeric/internal/representation.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ -#define ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ +#ifndef Y_ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ +#define Y_ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ #include <limits> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace numeric_internal { // Returns true iff long double is represented as a pair of doubles added @@ -49,7 +49,7 @@ inline constexpr bool IsDoubleDouble() { } } // namespace numeric_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ +#endif // Y_ABSL_NUMERIC_INTERNAL_REPRESENTATION_H_ |