diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 17 | ||||
-rw-r--r-- | src/corelib/tools/qunicodetables_p.h | 6 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 2 |
3 files changed, 20 insertions, 5 deletions
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 } diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h index f3fb6ec1b0..3f2e91a9b2 100644 --- a/src/corelib/tools/qunicodetables_p.h +++ b/src/corelib/tools/qunicodetables_p.h @@ -72,6 +72,9 @@ struct Properties { signed short mirrorDiff : 16; ushort lowerCaseSpecial : 1; signed short lowerCaseDiff : 15; +#ifdef Q_OS_WASM + unsigned char : 0; //wasm 64 packing trick +#endif ushort upperCaseSpecial : 1; signed short upperCaseDiff : 15; ushort titleCaseSpecial : 1; @@ -80,6 +83,9 @@ struct Properties { signed short caseFoldDiff : 15; ushort unicodeVersion : 8; /* 5 used */ ushort nfQuickCheck : 8; +#ifdef Q_OS_WASM + unsigned char : 0; //wasm 64 packing trick +#endif ushort graphemeBreakClass : 5; /* 5 used */ ushort wordBreakClass : 5; /* 5 used */ ushort sentenceBreakClass : 8; /* 4 used */ diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 9ec6ea4894..dc28e0e0a2 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -220,7 +220,7 @@ qtConfig(system-doubleconversion) { } # Note: libm should be present by default becaue this is C++ -unix:!macx-icc:!vxworks:!haiku:!integrity: LIBS_PRIVATE += -lm +unix:!macx-icc:!vxworks:!haiku:!integrity:!wasm: LIBS_PRIVATE += -lm TR_EXCLUDE += ../3rdparty/* |