diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index e45048df49..2bba5878f0 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -165,16 +165,22 @@ ps_adds1 #include static inline uint64_t __rdtsc() { -#ifdef __linux__ uint32_t lo, hi; +#ifdef _LP64 __asm__ __volatile__ ("xorl %%eax,%%eax \n cpuid" ::: "%rax", "%rbx", "%rcx", "%rdx"); __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); return (uint64_t)hi << 32 | lo; #else - // TODO: Figure out what is wrong with clobbering the rbx register on OSX - return 0; + __asm__ __volatile__ ( + "xor %%eax,%%eax;" + "push %%ebx;" + "cpuid;" + "pop %%ebx;" + ::: "%eax", "%ecx", "%edx"); + __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); #endif + return (uint64_t)hi << 32 | lo; } #endif