mirror of
https://github.com/ziglang/zig.git
synced 2025-02-08 13:40:30 +00:00
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:
parent
23f339f1b4
commit
c161ce3f7c
@ -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_) */
|
||||
|
||||
/* ***************************************************** */
|
||||
|
Loading…
Reference in New Issue
Block a user