Lines Matching refs:rhs

190 inline bool SignedAddOverflow32(int32_t lhs, int32_t rhs, int32_t* val) {  in SignedAddOverflow32()  argument
192 return __builtin_sadd_overflow(lhs, rhs, val); in SignedAddOverflow32()
194 uint32_t res = static_cast<uint32_t>(lhs) + static_cast<uint32_t>(rhs); in SignedAddOverflow32()
196 return ((res ^ lhs) & (res ^ rhs) & (1U << 31)) != 0; in SignedAddOverflow32()
204 inline bool SignedSubOverflow32(int32_t lhs, int32_t rhs, int32_t* val) { in SignedSubOverflow32() argument
206 return __builtin_ssub_overflow(lhs, rhs, val); in SignedSubOverflow32()
208 uint32_t res = static_cast<uint32_t>(lhs) - static_cast<uint32_t>(rhs); in SignedSubOverflow32()
210 return ((res ^ lhs) & (res ^ ~rhs) & (1U << 31)) != 0; in SignedSubOverflow32()
218 inline bool SignedAddOverflow64(int64_t lhs, int64_t rhs, int64_t* val) { in SignedAddOverflow64() argument
219 uint64_t res = static_cast<uint64_t>(lhs) + static_cast<uint64_t>(rhs); in SignedAddOverflow64()
221 return ((res ^ lhs) & (res ^ rhs) & (1ULL << 63)) != 0; in SignedAddOverflow64()
228 inline bool SignedSubOverflow64(int64_t lhs, int64_t rhs, int64_t* val) { in SignedSubOverflow64() argument
229 uint64_t res = static_cast<uint64_t>(lhs) - static_cast<uint64_t>(rhs); in SignedSubOverflow64()
231 return ((res ^ lhs) & (res ^ ~rhs) & (1ULL << 63)) != 0; in SignedSubOverflow64()
238 int32_t SignedMulHigh32(int32_t lhs, int32_t rhs);
244 int32_t SignedMulHighAndAdd32(int32_t lhs, int32_t rhs, int32_t acc);
250 int32_t SignedDiv32(int32_t lhs, int32_t rhs);
256 int32_t SignedMod32(int32_t lhs, int32_t rhs);
262 inline bool UnsignedAddOverflow32(uint32_t lhs, uint32_t rhs, uint32_t* val) { in UnsignedAddOverflow32() argument
264 return __builtin_uadd_overflow(lhs, rhs, val); in UnsignedAddOverflow32()
266 *val = lhs + rhs; in UnsignedAddOverflow32()
267 return *val < (lhs | rhs); in UnsignedAddOverflow32()
274 inline uint32_t UnsignedDiv32(uint32_t lhs, uint32_t rhs) { in UnsignedDiv32() argument
275 return rhs ? lhs / rhs : 0u; in UnsignedDiv32()
281 inline uint32_t UnsignedMod32(uint32_t lhs, uint32_t rhs) { in UnsignedMod32() argument
282 return rhs ? lhs % rhs : 0u; in UnsignedMod32()