emscripten-core / emscripten-core/emscripten

Imply -msimd128 when -msse* or other similar flags are specified

Open
#12,714 19 comments 3 reactions 0 assignees View on GitHub
SIMD wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Right now, Emscripten errors out if one of the SIMD flags, e.g. `-msse2`, is used without also specifying `-msimd128`.

While this works fine for Wasm-specific projects, it adds friction to building existing projects relying on SSE intrinsics. For example, CMake checks that try to use those flags, error out by default, and the only ways to fix it are either 1) modify CFLAGS / CXXFLAGS / etc. on the caller side to include `-msimd128`, which will now affect _all_ targets in CMake and not only those that used `-msse2` or 2) selectively modify CMakeFiles to include this extra flag only in places where `-msse2` is used too and only on Emscripten target.

Both those options are a bit cumbersome and I'd argue the underlying friction is unnecessary. Just like `-pthread` implies enabling atomics, bulk-memory etc., `-msse2` and friends should imply enabling `-msimd128` feature, as on their own they already are a clear signal that user intends to use SIMD instructions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.