Don't try to use SSE4.2 CRC intrinsics under Emscripten #8213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A very simple change to avoid enabling SSE4 under Emscripten.
This is a workaround, as the latest changes in this WIP branch don't work with Emscripten when SSE4.2 is enabled.
It is possible to build Emscripten projects with SSE4.2 (see https://emscripten.org/docs/porting/simd.html) by passing flags
-msse4.2
and-msimd128
, which will define__SSE4_2__
. However, symbols used here such as_mm_crc32_u32
are not available. Instead, Emscripten exposes a different set of WebAssembly SIMD intrinsics.This PR is just a workaround for now - an ideal solution would be to have
#ifdef EMSCRIPTEN
branches for each place that uses SIMD intrinsics, and provide WASM intrinsic equivalent in those places, as described in the article above.