From 29c0377f07f4942f9957ea87d59c252148dc9e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 1 Jun 2018 15:13:30 +0200 Subject: WebAssembly for QtBase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu Done-with: Sami Enne Done-with: Morten Johan Sørvig Started-by: Andrew Knight Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/tools/qsimd.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools/qsimd.cpp') diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 85efd3cded..07a8b022bc 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -190,7 +190,9 @@ static inline quint64 detectProcessorFeatures() static int maxBasicCpuidSupported() { -#if defined(Q_CC_GNU) +#if defined(Q_CC_EMSCRIPTEN) + return 6; // All features supported by Emscripten +#elif defined(Q_CC_GNU) qregisterint tmp1; # if Q_PROCESSOR_X86 < 5 @@ -235,7 +237,7 @@ static int maxBasicCpuidSupported() static void cpuidFeatures01(uint &ecx, uint &edx) { -#if defined(Q_CC_GNU) +#if defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN) qregisterint tmp1; asm ("xchg " PICreg", %2\n" "cpuid\n" @@ -252,6 +254,9 @@ static void cpuidFeatures01(uint &ecx, uint &edx) __CPUID(1, info); ecx = info[2]; edx = info[3]; +#else + Q_UNUSED(ecx); + Q_UNUSED(edx); #endif } @@ -261,7 +266,7 @@ inline void __cpuidex(int info[4], int, __int64) { memset(info, 0, 4*sizeof(int) static void cpuidFeatures07_00(uint &ebx, uint &ecx, uint &edx) { -#if defined(Q_CC_GNU) +#if defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN) qregisteruint rbx; // in case it's 64-bit qregisteruint rcx = 0; qregisteruint rdx = 0; @@ -294,7 +299,7 @@ inline quint64 _xgetbv(__int64) { return 0; } #endif static void xgetbv(uint in, uint &eax, uint &edx) { -#if defined(Q_CC_GNU) || defined(Q_CC_GHS) +#if (defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)) || defined(Q_CC_GHS) asm (".byte 0x0F, 0x01, 0xD0" // xgetbv instruction : "=a" (eax), "=d" (edx) : "c" (in)); @@ -302,6 +307,10 @@ static void xgetbv(uint in, uint &eax, uint &edx) quint64 result = _xgetbv(in); eax = result; edx = result >> 32; +#else + Q_UNUSED(in); + Q_UNUSED(eax); + Q_UNUSED(edx); #endif } -- cgit v1.2.3