Skip to content

feat(detect_targets): enable HWY_WASM by default on WebAssembly (fixes #2831) - #3369

Open
jdymitarai wants to merge 3 commits into
google:masterfrom
jdymitarai:wasm-simd-baseline-opt-out
Open

jdymitarai wants to merge 3 commits into
google:masterfrom
jdymitarai:wasm-simd-baseline-opt-out

Conversation

@jdymitarai

Copy link
Copy Markdown
Contributor

Problem

As reported in #2831, hwy::DispatchedTarget previously returned HWY_EMU128 on WebAssembly unless the -msimd128 compiler flag was passed explicitly, because HWY_BASELINE_WASM checked defined(__wasm_simd128__).

Solution

Enable HWY_WASM by default on HWY_ARCH_WASM without requiring -msimd128, as discussed in #2831. WASM SIMD (simd128) is now widespread across modern web browsers and runtimes.

Developers building a non-SIMD fallback WebAssembly binary can cleanly opt out by specifying HWY_DISABLED_TARGETS=HWY_WASM (or HWY_COMPILE_ONLY_SCALAR), which falls back to HWY_EMU128 / HWY_SCALAR.

Fixes #2831.

@jan-wassenberg

Copy link
Copy Markdown
Member

Unfortunately this is nontrivial to land, we have some internal projects which turn out to break when enabling SIMD by default, which is why #2851 was rolled back.

How much of an issue is it for you that -msimd128 is required to be passed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hwy::DispatchedTarget always returns HWY_EMU128 on WASM/Emscripten

2 participants