30 #ifndef GOOGLE_PROTOBUF_STUBS_INT128_H_ 31 #define GOOGLE_PROTOBUF_STUBS_INT128_H_ 44 #ifdef GOOGLE_PROTOBUF_HAS_CONSTEXPR 45 # define UINT128_CONSTEXPR constexpr 47 # define UINT128_CONSTEXPR 75 uint128& operator<<=(
int);
76 uint128& operator>>=(
int);
77 uint128& operator&=(
const uint128& b);
79 uint128& operator^=(
const uint128& b);
91 static void DivModImpl(uint128 dividend, uint128
divisor,
92 uint128* quotient_ret, uint128* remainder_ret);
141 return !(lhs == rhs);
146 : lo_(bottom), hi_(top) {}
148 : lo_(v.lo), hi_(v.hi) {}
150 : lo_(bottom), hi_(0) {}
153 : lo_(bottom), hi_(0) {}
155 : lo_(bottom), hi_(static_cast<
int64>((bottom < 0) ? -1 : 0)) {}
158 #undef UINT128_CONSTEXPR 168 inline bool operator op(const uint128& lhs, const uint128& rhs) { \ 169 return (Uint128High64(lhs) == Uint128High64(rhs)) ? \ 170 (Uint128Low64(lhs) op Uint128Low64(rhs)) : \ 171 (Uint128High64(lhs) op Uint128High64(rhs)); \ 186 const uint64 lo_add = lo_flip + 1;
187 if (lo_add < lo_flip) {
188 return uint128(hi_flip + 1, lo_add);
190 return uint128(hi_flip, lo_add);
203 #define LOGIC128(op) \ 204 inline uint128 operator op(const uint128& lhs, const uint128& rhs) { \ 205 return uint128(Uint128High64(lhs) op Uint128High64(rhs), \ 206 Uint128Low64(lhs) op Uint128Low64(rhs)); \ 215 #define LOGICASSIGN128(op) \ 216 inline uint128& uint128::operator op(const uint128& other) { \ 226 #undef LOGICASSIGN128 239 return uint128(new_hi, new_lo);
240 }
else if (amount < 128) {
256 return uint128(new_hi, new_lo);
257 }
else if (amount < 128) {
268 hi_ = (hi_ << amount) | (lo_ >> (64 -
amount));
271 }
else if (amount < 128) {
272 hi_ = lo_ << (amount - 64);
285 lo_ = (lo_ >>
amount) | (hi_ << (64 - amount));
288 }
else if (amount < 128) {
289 lo_ = hi_ >> (amount - 64);
320 uint64 lolo = lo_ + b.lo_;
337 uint64 a64 = hi_ & 0xffffffff
u;
339 uint64 a00 = lo_ & 0xffffffff
u;
341 uint64 b64 = b.hi_ & 0xffffffff
u;
343 uint64 b00 = b.lo_ & 0xffffffff
u;
347 uint64 c96 = a96 * b00 + a64 * b32 + a32 * b64 + a00 * b96;
348 uint64 c64 = a64 * b00 + a32 * b32 + a00 * b64;
349 this->hi_ = (c96 << 32) + c64;
352 *
this +=
uint128(a32 * b00) << 32;
353 *
this +=
uint128(a00 * b32) << 32;
383 #endif // GOOGLE_PROTOBUF_STUBS_INT128_H_ Duration & operator/=(Duration &d, int64 r)
Definition: time_util.cc:461
uint128 operator*(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:306
Duration & operator+=(Duration &d1, const Duration &d2)
Definition: time_util.cc:423
Duration & operator-=(Duration &d1, const Duration &d2)
Definition: time_util.cc:429
ResourceLoadPriority & operator--(ResourceLoadPriority &priority)
Definition: ResourceLoadPriority.h:49
bool operator==(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:136
friend uint64 Uint128High64(const uint128 &v)
Definition: int128.h:129
Duration & operator%=(Duration &d1, const Duration &d2)
Definition: time_util.cc:479
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:398
bool operator!(const uint128 &val)
Definition: int128.h:193
#define CMP128(op)
Definition: int128.h:167
uint8_t uint8
Definition: port.h:133
uint128 operator+(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:298
GLuint divisor
Definition: gl2ext.h:1105
std::ostream & operator<<(std::ostream &o, const uint128 &b)
Definition: int128.cc:140
uint128 & operator>>=(int)
Definition: int128.h:281
uint128 operator/(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:310
#define LOGICASSIGN128(op)
Definition: int128.h:215
uint128 operator-(const uint128 &val)
Definition: int128.h:183
GLint GLint bottom
Definition: gl2ext.h:3063
TextDecoration & operator|=(TextDecoration &a, TextDecoration b)
Definition: RenderStyleConstants.h:440
int top
Definition: float-mm.c:109
uint128 & operator++()
Definition: int128.h:370
uint128 operator%(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:314
uint128 & operator*=(const uint128 &b)
Definition: int128.h:335
uint64 lo
Definition: int128.h:116
friend uint64 Uint128Low64(const uint128 &v)
Definition: int128.h:128
uint16_t uint16
Definition: port.h:134
Duration & operator*=(Duration &d, int64 r)
Definition: time_util.cc:435
uint32_t uint32
Definition: port.h:135
UINT128_CONSTEXPR uint128()
Definition: int128.h:144
uint128 & operator<<=(int)
Definition: int128.h:264
Definition: __init__.py:1
uint128 & operator--()
Definition: int128.h:375
uint128 operator~(const uint128 &val)
Definition: int128.h:199
uint64_t uint64
Definition: port.h:136
const GLfloat * v
Definition: gl2.h:514
uint128 & operator+=(const uint128 &b)
Definition: int128.h:318
uint128 & operator-=(const uint128 &b)
Definition: int128.h:327
LIBPROTOBUF_EXPORT friend std::ostream & operator<<(std::ostream &o, const uint128 &b)
Definition: int128.cc:140
int64_t int64
Definition: port.h:131
#define LIBPROTOBUF_EXPORT
Definition: port.h:97
GLboolean GLboolean GLboolean b
Definition: gl2ext.h:306
uint64 hi
Definition: int128.h:115
Definition: gflags_completions.h:115
#define UINT128_CONSTEXPR
Definition: int128.h:47
ANGLE_EXPORT EGLBoolean EGLAPIENTRY Initialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
Definition: entry_points_egl.cpp:48
void Initialize(uint64 top, uint64 bottom)
Definition: int128.h:160
bool operator!=(const uint128 &lhs, const uint128 &rhs)
Definition: int128.h:140
uint64 Uint128High64(const uint128 &v)
Definition: int128.h:129
SubsamplingLevel & operator++(SubsamplingLevel &subsamplingLevel)
Definition: ImageFrame.h:51
DOMString amount
Definition: ApplePayLineItem.idl:38
#define LOGIC128(op)
Definition: int128.h:203
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301
const uint128_pod kuint128max
Definition: int128.cc:40
uint64 Uint128Low64(const uint128 &v)
Definition: int128.h:128
uint128 operator>>(const uint128 &val, int amount)
Definition: int128.h:247