diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/uint128.h | 5 | ||||
| -rw-r--r-- | src/common/x64/native_clock.cpp | 2 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/common/uint128.h b/src/common/uint128.h index 199d0f55e..f890ffec2 100644 --- a/src/common/uint128.h +++ b/src/common/uint128.h | |||
| @@ -31,17 +31,12 @@ namespace Common { | |||
| 31 | return _udiv128(r[1], r[0], d, &remainder); | 31 | return _udiv128(r[1], r[0], d, &remainder); |
| 32 | #endif | 32 | #endif |
| 33 | #else | 33 | #else |
| 34 | #ifdef __SIZEOF_INT128__ | ||
| 35 | const auto product = static_cast<unsigned __int128>(a) * static_cast<unsigned __int128>(b); | ||
| 36 | return static_cast<u64>(product / d); | ||
| 37 | #else | ||
| 38 | const u64 diva = a / d; | 34 | const u64 diva = a / d; |
| 39 | const u64 moda = a % d; | 35 | const u64 moda = a % d; |
| 40 | const u64 divb = b / d; | 36 | const u64 divb = b / d; |
| 41 | const u64 modb = b % d; | 37 | const u64 modb = b % d; |
| 42 | return diva * b + moda * divb + moda * modb / d; | 38 | return diva * b + moda * divb + moda * modb / d; |
| 43 | #endif | 39 | #endif |
| 44 | #endif | ||
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | // This function multiplies 2 u64 values and produces a u128 value; | 42 | // This function multiplies 2 u64 values and produces a u128 value; |
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 6aaa8cdf9..8b08332ab 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -75,8 +75,8 @@ NativeClock::NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequen | |||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | u64 NativeClock::GetRTSC() { | 77 | u64 NativeClock::GetRTSC() { |
| 78 | TimePoint current_time_point{}; | ||
| 79 | TimePoint new_time_point{}; | 78 | TimePoint new_time_point{}; |
| 79 | TimePoint current_time_point{}; | ||
| 80 | 80 | ||
| 81 | current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); | 81 | current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); |
| 82 | do { | 82 | do { |