From 6e306ee44f91f3d865c33bb10fc01bc82195456b Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 17 Jul 2016 10:20:57 +0200 Subject: [PATCH] common: move _xgetbv with cpuid intrin Besides, code comes from Gabest and not reactOS --- common/include/intrin_x86.h | 8 -------- common/include/x86emitter/x86_intrin.h | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/include/intrin_x86.h b/common/include/intrin_x86.h index 320b336470..6e6873207b 100644 --- a/common/include/intrin_x86.h +++ b/common/include/intrin_x86.h @@ -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; -} diff --git a/common/include/x86emitter/x86_intrin.h b/common/include/x86emitter/x86_intrin.h index c0c0a59477..95fa0c98d7 100644 --- a/common/include/x86emitter/x86_intrin.h +++ b/common/include/x86emitter/x86_intrin.h @@ -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