authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-22 19:05:17-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-22 19:10:27-04:00
logc161ce3f7c424274269bda0bf054a04540bc26cf
treef77302907f884055b7d5bc21cc9ab7b077a3708c
parent23f339f1b4686ee9c6d81e25d884bb407530dbcc
signaturelock-open Commit is signed but in an unrecognized format.

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.

1 files changed, 0 insertions(+), 26 deletions(-)

lib/libc/include/any-windows-any/psdk_inc/intrin-impl.h-26
...@@ -1938,32 +1938,6 @@ __buildmov(__movsd, unsigned __LONG32, "d")...@@ -1938,32 +1938,6 @@ __buildmov(__movsd, unsigned __LONG32, "d")
1938#define __INTRINSIC_DEFINED___movsd1938#define __INTRINSIC_DEFINED___movsd
1939#endif /* __INTRINSIC_PROLOG */1939#endif /* __INTRINSIC_PROLOG */
19401940
1941#if !defined(__GNUC__) || __GNUC__ < 8 /* GCC 8 has already defined _xgetbv */
1942/* NOTE: This should be in immintrin.h */
1943#if __INTRINSIC_PROLOG(_xgetbv)
1944unsigned __int64 _xgetbv(unsigned int);
1945#if !__has_builtin(_xgetbv)
1946__INTRINSICS_USEINLINE
1947unsigned __int64 _xgetbv(unsigned int index)
1948{
1949#if defined(__x86_64__) || defined(_AMD64_)
1950 unsigned __int64 val1, val2;
1951#else
1952 unsigned __LONG32 val1, val2;
1953#endif /* defined(__x86_64__) || defined(_AMD64_) */
1954
1955 __asm__ __volatile__(
1956 "xgetbv"
1957 : "=a" (val1), "=d" (val2)
1958 : "c" (index));
1959
1960 return (((unsigned __int64)val2) << 32) | val1;
1961}
1962#endif
1963#define __INTRINSIC_DEFINED__xgetbv
1964#endif /* __INTRINSIC_PROLOG */
1965#endif /* __GNUC__ < 8 */
1966
1967#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */1941#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
19681942
1969/* ***************************************************** */1943/* ***************************************************** */