mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +12:00
Misc. Linux improvements and bug fixes. (#121)
Co-authored-by: Tom Lally <tomlally@protonmail.com>
This commit is contained in:
parent
b8d4cf5b29
commit
d3a7b3b5a6
23 changed files with 101 additions and 104 deletions
|
@ -32,7 +32,7 @@ uint64 muldiv64(uint64 a, uint64 b, uint64 d)
|
|||
bool PPCTimer_hasInvariantRDTSCSupport()
|
||||
{
|
||||
uint32 cpuv[4];
|
||||
__cpuid((int*)cpuv, 0x80000007);
|
||||
cpuid((int*)cpuv, 0x80000007);
|
||||
return ((cpuv[3] >> 8) & 1);
|
||||
}
|
||||
|
||||
|
@ -106,11 +106,7 @@ uint64 PPCTimer_microsecondsToTsc(uint64 us)
|
|||
uint64 PPCTimer_tscToMicroseconds(uint64 us)
|
||||
{
|
||||
uint128_t r{};
|
||||
#if BOOST_OS_WINDOWS
|
||||
r.low = _umul128(us, 1000000ULL, &r.high);
|
||||
#else
|
||||
r.low = _umul128(us, 1000000ULL, (unsigned long long*)&r.high);
|
||||
#endif
|
||||
|
||||
|
||||
uint64 remainder;
|
||||
|
@ -146,11 +142,7 @@ uint64 PPCTimer_getFromRDTSC()
|
|||
rdtscDif = rdtscDif & ~(uint64)((sint64)rdtscDif >> 63);
|
||||
|
||||
uint128_t diff{};
|
||||
#if BOOST_OS_WINDOWS
|
||||
diff.low = _umul128(rdtscDif, Espresso::CORE_CLOCK, &diff.high);
|
||||
#else
|
||||
diff.low = _umul128(rdtscDif, Espresso::CORE_CLOCK, (unsigned long long*)&diff.high);
|
||||
#endif
|
||||
|
||||
if(rdtscCurrentMeasure > _rdtscLastMeasure)
|
||||
_rdtscLastMeasure = rdtscCurrentMeasure; // only travel forward in time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue