common: move _xgetbv with cpuid intrin

Besides, code comes from Gabest and not reactOS
This commit is contained in:
Gregory Hainaut 2016-07-17 10:20:57 +02:00
parent e872552fdc
commit 6e306ee44f
2 changed files with 7 additions and 8 deletions

View File

@ -67,11 +67,3 @@ static __inline__ __attribute__((always_inline)) s64 _InterlockedExchange64(vola
__sync_synchronize();
return __sync_lock_test_and_set(Target, Value);
}
/*** System information ***/
static __inline__ __attribute__((always_inline)) unsigned long long _xgetbv(unsigned int index)
{
unsigned int eax, edx;
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
return ((unsigned long long)edx << 32) | eax;
}

View File

@ -49,6 +49,13 @@ static __inline__ __attribute__((always_inline)) void cpuid(int CPUInfo[], const
__cpuid(InfoType, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
static __inline__ __attribute__((always_inline)) unsigned long long _xgetbv(unsigned int index)
{
unsigned int eax, edx;
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
return ((unsigned long long)edx << 32) | eax;
}
#endif
// Rotate instruction