mingw-w64 libc: fix incorrect detection of _xgetbv

It was using __GNUC__ < 8 to check if _xgetbv intrinsic is available.
Since we always use zig cc with this header, we know we have clang 9,
which does have this intrinsic.
This commit is contained in:
Andrew Kelley 2019-09-22 19:05:17 -04:00
parent 23f339f1b4
commit c161ce3f7c
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -1938,32 +1938,6 @@ __buildmov(__movsd, unsigned __LONG32, "d")
#define __INTRINSIC_DEFINED___movsd
#endif /* __INTRINSIC_PROLOG */
#if !defined(__GNUC__) || __GNUC__ < 8 /* GCC 8 has already defined _xgetbv */
/* NOTE: This should be in immintrin.h */
#if __INTRINSIC_PROLOG(_xgetbv)
unsigned __int64 _xgetbv(unsigned int);
#if !__has_builtin(_xgetbv)
__INTRINSICS_USEINLINE
unsigned __int64 _xgetbv(unsigned int index)
{
#if defined(__x86_64__) || defined(_AMD64_)
unsigned __int64 val1, val2;
#else
unsigned __LONG32 val1, val2;
#endif /* defined(__x86_64__) || defined(_AMD64_) */
__asm__ __volatile__(
"xgetbv"
: "=a" (val1), "=d" (val2)
: "c" (index));
return (((unsigned __int64)val2) << 32) | val1;
}
#endif
#define __INTRINSIC_DEFINED__xgetbv
#endif /* __INTRINSIC_PROLOG */
#endif /* __GNUC__ < 8 */
#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
/* ***************************************************** */