Skip to content

Fix SIMD mask accessors compilation with Emscripten - #633

Open
jdumas wants to merge 1 commit into
RenderKit:masterfrom
jdumas:jdumas/fix-emscripten-simd-accessors
Open

jdumas wants to merge 1 commit into
RenderKit:masterfrom
jdumas:jdumas/fix-emscripten-simd-accessors

Conversation

@jdumas

@jdumas jdumas commented Sep 30, 2026

Copy link
Copy Markdown

Currently compiling embree with emscripten leads to the following error:

In file included from /home/runner/work/cpp_test/cpp_test/embree/common/simd/sse.h:31:
/home/runner/work/cpp_test/cpp_test/embree/common/simd/vboolf4_sse2.h:125:117: error: no member named 'm128i' in 'embree::vboolf_impl<4>'
  125 |   __forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a.m128i(), b.m128i())); }
      |                                                                                                                   ~ ^
/home/runner/work/cpp_test/cpp_test/embree/common/simd/vboolf4_sse2.h:125:128: error: no member named 'm128i' in 'embree::vboolf_impl<4>'
  125 |   __forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a.m128i(), b.m128i())); }
      |                                                                                                                              ~ ^
/home/runner/work/cpp_test/cpp_test/embree/common/simd/vboolf4_sse2.h:168:49: error: no member named 'm128i' in 'embree::vboolf_impl<4>'
  168 |     return _mm_castsi128_ps(_mm_shuffle_epi32(v.m128i(), _MM_SHUFFLE(i3, i2, i1, i0)));
      |                                               ~ ^
In file included from main.cpp:1:

This PR should fix it. For funsies here's a small LLM-generated repro with a GitHub Actions run showing the compile error. It might be worth adding Emscripten to the Embree CI workflow if you guys are interested (could do that as a separate PR).

Keep m128i() and m128d() available when compiling with Emscripten. SSE2 equality, shuffle, and masked integer loads call the explicit accessors regardless of platform. Continue excluding the implicit integer and double conversion operators for Emscripten, and leave the MSVC ARM64 path unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stefanatwork stefanatwork self-assigned this Oct 1, 2026
@stefanatwork
stefanatwork self-requested a review October 1, 2026 10:10
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.

3 participants