aboutsummaryrefslogtreecommitdiff
path: root/src/common/x64/native_clock.cpp
diff options
context:
space:
mode:
authoryuzubot <yuzu@yuzu-emu.org>2023-03-28 12:03:15 +0000
committeryuzubot <yuzu@yuzu-emu.org>2023-03-28 12:03:15 +0000
commit18a6fd6d2cf3dcda935e406a311cdc29ddf9350b (patch)
treea43b51a4056ad7664346a63f145c889da1f59d16 /src/common/x64/native_clock.cpp
parentfbbf532d42f5688533d31f7fe6f75526b4187e5c (diff)
"Merge Tagged PR 9982"mainline-0-1386
Diffstat (limited to 'src/common/x64/native_clock.cpp')
-rw-r--r--src/common/x64/native_clock.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp
index 76c66e7eed..277b006625 100644
--- a/src/common/x64/native_clock.cpp
+++ b/src/common/x64/native_clock.cpp
@@ -27,16 +27,13 @@ __forceinline static u64 FencedRDTSC() {
}
#else
static u64 FencedRDTSC() {
- u64 result;
+ u64 eax;
+ u64 edx;
asm volatile("lfence\n\t"
"rdtsc\n\t"
- "shl $32, %%rdx\n\t"
- "or %%rdx, %0\n\t"
- "lfence"
- : "=a"(result)
- :
- : "rdx", "memory", "cc");
- return result;
+ "lfence\n\t"
+ : "=a"(eax), "=d"(edx));
+ return (edx << 32) | eax;
}
#endif