mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
Core: Now using _addcarry_u64 only for x86
This commit is contained in:
parent
b23ab7bae7
commit
60aaffe05a
1 changed files with 14 additions and 0 deletions
|
|
@ -218,11 +218,25 @@ inline bool FitsInInt64(double x)
|
|||
|
||||
#if defined(__SIZEOF_INT128__) && (__GNUC__ > 5 || __clang_major__ >= 5)
|
||||
|
||||
#ifdef CPU_X86
|
||||
|
||||
inline
|
||||
byte addc64(uint64& result, const uint64& value, byte carry) {
|
||||
return _addcarry_u64(carry, result, value, &result);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
force_inline
|
||||
byte addc64(uint64& r, uint64 a, byte carry)
|
||||
{
|
||||
uint64_t r1 = r;
|
||||
r += a + carry;
|
||||
return carry ? r <= a : r < a;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline
|
||||
uint64 mul64(uint64 a, uint64 b, uint64& hi)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue