From dd3b9c6208f07583427fe6492357af06cbc09d0c Mon Sep 17 00:00:00 2001 From: Yolanda-Chen Date: Fri, 31 May 2024 03:27:47 +0800 Subject: [PATCH] Add feature to support WASM Relaxed SIMD (#1389) --- bazel/emscripten_toolchain/toolchain.bzl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bazel/emscripten_toolchain/toolchain.bzl b/bazel/emscripten_toolchain/toolchain.bzl index 745e27d..5a03ada 100644 --- a/bazel/emscripten_toolchain/toolchain.bzl +++ b/bazel/emscripten_toolchain/toolchain.bzl @@ -434,6 +434,11 @@ def _impl(ctx): name = "wasm_simd", requires = [feature_set(features = ["llvm_backend"])], ), + # Adds relaxed-simd support, only available with the llvm backend. + feature( + name = "wasm_relaxed_simd", + requires = [feature_set(features = ["llvm_backend"])], + ), feature( name = "precise_long_double_printf", enabled = True, @@ -560,6 +565,11 @@ def _impl(ctx): flags = ["-msimd128"], features = ["wasm_simd"], ), + flag_set( + actions = all_compile_actions + all_link_actions, + flags = ["-msimd128", "-mrelaxed-simd"], + features = ["wasm_relaxed_simd"], + ), flag_set( actions = all_link_actions, flags = ["-s", "PRINTF_LONG_DOUBLE=1"],