summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2019-01-18 09:31:10 +0200
committerMartin Storsjö <martin@martin.st>2019-01-22 16:24:26 +0000
commit9818af7d436f7aa1bf5c635041cc5d08fec599b5 (patch)
tree46d20848dd1f4c4299ac0d297e31a38fb47fb28b /src/corelib/tools
parent524a37f99d3d3115a1b371fd289044d90349a824 (diff)
qsimd: Fix compilation with trunk clang for mingw
Current tip-of-tree clang (after Clang 8 was branched) added an intrinsic function __builtin_ia32_xgetbv, and added the following define that provides _xgetbv: #define _xgetbv(A) __builtin_ia32_xgetbv((long long)(A)) This fallback declaration of the _xgetbv function only is used in case the Q_OS_WIN branch of the #if/#elif below is used, if the #if (defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)) || defined(Q_CC_GHS) wasn't taken. I left out the !defined(Q_CC_EMSCRIPTEN) part as I believe Q_OS_WIN and Q_CC_EMSCRIPTEN are mutually exclusive. Change-Id: I257fc4283ff9f0845df51ab764cf58acdf285c66 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qsimd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 07a8b022bc..1b51b591f7 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -293,7 +293,7 @@ static void cpuidFeatures07_00(uint &ebx, uint &ecx, uint &edx)
#endif
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !(defined(Q_CC_GNU) || defined(Q_CC_GHS))
// fallback overload in case this intrinsic does not exist: unsigned __int64 _xgetbv(unsigned int);
inline quint64 _xgetbv(__int64) { return 0; }
#endif