wasm: add wasm_simd configure feature

Add Qt configure feature for enabling WebAssembly SIMD usage:

   ./configure ... -feature-wasm-simd128

Enabling this feature makes Qt add the -msimd128 flag to
the compile options, which enables SIMD instruction usage
for the compiler.

(This should not be confused with the previously added SSE
SIMD support, which uses Emscripten's support for translating
SSE SIMD to WASM SIMD)

Change-Id: I84a36ccef8abf9199c304d68ce371c6b1747b832
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Morten Sørvig 2022-10-07 12:00:22 +02:00 committed by Morten Johan Sørvig
parent f5de333192
commit ef3813fc1e
2 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,9 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
"SHELL:-s EXPORT_NAME=createQtAppInstance")
#simd
if (QT_FEATURE_wasm_simd128)
target_compile_options("${wasmTarget}" INTERFACE -msimd128)
endif()
if (QT_FEATURE_sse2)
target_compile_options("${wasmTarget}" INTERFACE -O2 -msimd128 -msse -msse2)
endif()

View File

@ -928,6 +928,14 @@ qt_feature("arm_crypto" PRIVATE
)
qt_feature_definition("arm_crypto" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
qt_feature_config("arm_crypto" QMAKE_PRIVATE_CONFIG)
qt_feature("wasm_simd128" PRIVATE
LABEL "WebAssembly SIMD128"
AUTODETECT OFF
)
qt_feature_definition("wasm_simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1")
qt_feature_config("wasm_simd128" QMAKE_PRIVATE_CONFIG)
qt_feature("posix_fallocate" PRIVATE
LABEL "POSIX fallocate()"
CONDITION TEST_posix_fallocate
@ -1155,6 +1163,10 @@ qt_configure_add_summary_entry(ARGS "relocatable")
qt_configure_add_summary_entry(ARGS "precompile_header")
qt_configure_add_summary_entry(ARGS "ltcg")
qt_configure_add_summary_entry(ARGS "intelcet")
qt_configure_add_summary_entry(
ARGS "wasm_simd128"
CONDITION ( TEST_architecture_arch STREQUAL wasm )
)
qt_configure_add_summary_section(NAME "Target compiler supports")
qt_configure_add_summary_entry(
TYPE "featureList"