diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2021-04-16 15:34:57 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2021-10-05 11:30:06 +1000 |
commit | 0e100a4d892cbdcdb7f326213ec1e4d0d1ae6d89 (patch) | |
tree | 94cdd5d90fc1ea64bdf6e589b152687980010c0e /cmake/QtWasmHelpers.cmake | |
parent | ef623fd16fa8cb58e7a0f8c04af75ee8b3f2752f (diff) |
wasm: add simd support
Emscripten only supports
SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction
sets at this time.
https://emscripten.org/docs/porting/simd.html
Browsers might need to enable simd support in the advanced
configurations
about: config or chrome:flags
Enable by configuring Qt with -sse2
Pick-to: 6.2
Fixes: QTBUG-63924
Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'cmake/QtWasmHelpers.cmake')
-rw-r--r-- | cmake/QtWasmHelpers.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index 240eaa0540..b80f0d0e18 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -19,6 +19,11 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) target_compile_options("${wasmTarget}" INTERFACE --bind) + #simd + if (QT_FEATURE_sse2) + target_compile_options("${wasmTarget}" INTERFACE -O2 -msimd128 -msse -msse2) + endif() + # Hardcode wasm memory size. Emscripten does not currently support memory growth # (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size # at build time. Further, browsers limit the maximum initial memory size to 1GB. |