Go to the documentation of this file.
30 #ifndef GOOGLE_PROTOBUF_STUBS_INT128_H_
31 #define GOOGLE_PROTOBUF_STUBS_INT128_H_
37 #include <google/protobuf/port_def.inc>
46 #ifdef GOOGLE_PROTOBUF_HAS_CONSTEXPR
47 # define UINT128_CONSTEXPR constexpr
49 # define UINT128_CONSTEXPR
89 PROTOBUF_EXPORT
friend std::ostream&
operator<<(std::ostream& o,
124 PROTOBUF_EXPORT
extern std::ostream&
operator<<(std::ostream& o,
143 return !(lhs == rhs);
150 : lo_(
v.lo), hi_(
v.hi) {}
160 #undef UINT128_CONSTEXPR
170 inline bool operator op(const uint128& lhs, const uint128& rhs) { \
171 return (Uint128High64(lhs) == Uint128High64(rhs)) ? \
172 (Uint128Low64(lhs) op Uint128Low64(rhs)) : \
173 (Uint128High64(lhs) op Uint128High64(rhs)); \
188 const uint64 lo_add = lo_flip + 1;
189 if (lo_add < lo_flip) {
190 return uint128(hi_flip + 1, lo_add);
192 return uint128(hi_flip, lo_add);
205 #define LOGIC128(op) \
206 inline uint128 operator op(const uint128& lhs, const uint128& rhs) { \
207 return uint128(Uint128High64(lhs) op Uint128High64(rhs), \
208 Uint128Low64(lhs) op Uint128Low64(rhs)); \
217 #define LOGICASSIGN128(op) \
218 inline uint128& uint128::operator op(const uint128& other) { \
228 #undef LOGICASSIGN128
241 return uint128(new_hi, new_lo);
242 }
else if (amount < 128) {
258 return uint128(new_hi, new_lo);
259 }
else if (amount < 128) {
270 hi_ = (
hi_ << amount) | (
lo_ >> (64 - amount));
273 }
else if (amount < 128) {
274 hi_ =
lo_ << (amount - 64);
287 lo_ = (
lo_ >> amount) | (
hi_ << (64 - amount));
290 }
else if (amount < 128) {
291 lo_ =
hi_ >> (amount - 64);
343 uint64 b64 =
b.hi_ & 0xffffffffu;
345 uint64 b00 =
b.lo_ & 0xffffffffu;
349 uint64 c96 = a96 * b00 + a64 * b32 + a32 * b64 + a00 * b96;
350 uint64 c64 = a64 * b00 + a32 * b32 + a00 * b64;
351 this->
hi_ = (c96 << 32) + c64;
354 *
this +=
uint128(a32 * b00) << 32;
355 *
this +=
uint128(a00 * b32) << 32;
385 #include <google/protobuf/port_undef.inc>
387 #endif // GOOGLE_PROTOBUF_STUBS_INT128_H_
#define UINT128_CONSTEXPR
uint64 Uint128Low64(const uint128 &v)
Duration & operator%=(Duration &d1, const Duration &d2)
uint128 operator*(const uint128 &lhs, const uint128 &rhs)
uint128 operator>>(const uint128 &val, int amount)
Duration & operator+=(Duration &d1, const Duration &d2)
uint128 & operator>>=(int)
uint128 operator/(const uint128 &lhs, const uint128 &rhs)
uint64 Uint128High64(const uint128 &v)
uint128 operator-(const uint128 &val)
GLboolean GLboolean GLboolean b
uint128 & operator*=(const uint128 &b)
UINT128_CONSTEXPR uint128()
uint128 & operator<<=(int)
uint128 operator%(const uint128 &lhs, const uint128 &rhs)
std::ostream & operator<<(std::ostream &o, const uint128 &b)
uint128 & operator+=(const uint128 &b)
uint128 & operator-=(const uint128 &b)
Duration & operator/=(Duration &d, int64 r)
uint128 operator~(const uint128 &val)
#define LOGICASSIGN128(op)
bool operator==(const uint128 &lhs, const uint128 &rhs)
bool operator!=(const uint128 &lhs, const uint128 &rhs)
IMGUI_API void Initialize(ImGuiContext *context)
Duration & operator*=(Duration &d, int64 r)
bool operator!(const uint128 &val)
static upb_pb_encoder_segment * top(upb_pb_encoder *e)
const uint128_pod kuint128max
void Initialize(uint64 top, uint64 bottom)
Duration & operator-=(Duration &d1, const Duration &d2)
uint128 operator+(const uint128 &lhs, const uint128 &rhs)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:54