common: Fix multiple _xgetbv() error on GCC 8

GCC 8 now provides _xgetbv, so avoid using our own definition in that
case.
This commit is contained in:
Jonathan Li 2018-05-04 20:25:11 +01:00
parent 191219f7d8
commit 15efe69e46
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ static __inline__ __attribute__((always_inline)) void cpuid(int CPUInfo[], const
__cpuid(InfoType, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
#if __GNUC__ < 8
static __inline__ __attribute__((always_inline)) unsigned long long _xgetbv(unsigned int index)
{
unsigned int eax, edx;
@ -57,6 +58,7 @@ static __inline__ __attribute__((always_inline)) unsigned long long _xgetbv(unsi
: "c"(index));
return ((unsigned long long)edx << 32) | eax;
}
#endif
#endif