Possible fix for the rdtsc call in JitIL.cpp on macosx (issue 3531). This also fixes issue 3595 (although that issue was invalid -- we don't suport scons on linux anymore).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6498 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
eda716b164
commit
b5863da915
|
@ -165,16 +165,22 @@ ps_adds1
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
static inline uint64_t __rdtsc()
|
static inline uint64_t __rdtsc()
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
|
||||||
uint32_t lo, hi;
|
uint32_t lo, hi;
|
||||||
|
#ifdef _LP64
|
||||||
__asm__ __volatile__ ("xorl %%eax,%%eax \n cpuid"
|
__asm__ __volatile__ ("xorl %%eax,%%eax \n cpuid"
|
||||||
::: "%rax", "%rbx", "%rcx", "%rdx");
|
::: "%rax", "%rbx", "%rcx", "%rdx");
|
||||||
__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
|
__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
|
||||||
return (uint64_t)hi << 32 | lo;
|
return (uint64_t)hi << 32 | lo;
|
||||||
#else
|
#else
|
||||||
// TODO: Figure out what is wrong with clobbering the rbx register on OSX
|
__asm__ __volatile__ (
|
||||||
return 0;
|
"xor %%eax,%%eax;"
|
||||||
|
"push %%ebx;"
|
||||||
|
"cpuid;"
|
||||||
|
"pop %%ebx;"
|
||||||
|
::: "%eax", "%ecx", "%edx");
|
||||||
|
__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
|
||||||
#endif
|
#endif
|
||||||
|
return (uint64_t)hi << 32 | lo;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue