mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +12:00
Cleanup udiv128 (#206)
This commit is contained in:
parent
4eaa600b57
commit
6cdb6eed17
4 changed files with 9 additions and 19 deletions
|
@ -108,14 +108,8 @@ uint64 PPCTimer_tscToMicroseconds(uint64 us)
|
|||
uint128_t r{};
|
||||
r.low = _umul128(us, 1000000ULL, &r.high);
|
||||
|
||||
|
||||
uint64 remainder;
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1923 && !defined(__clang__)
|
||||
const uint64 microseconds = _udiv128(r.high, r.low, _rdtscFrequency, &remainder);
|
||||
#else
|
||||
const uint64 microseconds = udiv128(r.low, r.high, _rdtscFrequency, &remainder);
|
||||
#endif
|
||||
|
||||
return microseconds;
|
||||
}
|
||||
|
@ -159,12 +153,7 @@ uint64 PPCTimer_getFromRDTSC()
|
|||
#endif
|
||||
|
||||
uint64 remainder;
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1923 && !defined(__clang__)
|
||||
uint64 elapsedTick = _udiv128(_rdtscAcc.high, _rdtscAcc.low, _rdtscFrequency, &remainder);
|
||||
#else
|
||||
uint64 elapsedTick = udiv128(_rdtscAcc.low, _rdtscAcc.high, _rdtscFrequency, &remainder);
|
||||
#endif
|
||||
|
||||
|
||||
_rdtscAcc.low = remainder;
|
||||
_rdtscAcc.high = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue