diff --git a/system/include/emscripten/emmintrin.h b/system/include/emscripten/emmintrin.h index 8f669a65a..fcca50c91 100644 --- a/system/include/emscripten/emmintrin.h +++ b/system/include/emscripten/emmintrin.h @@ -1532,13 +1532,23 @@ _mm_storeu_si128(__m128i *__p, __m128i __b) #endif } -#ifndef __EMSCRIPTEN__ // XXX TODO Add support static __inline__ void __attribute__((__always_inline__, __nodebug__)) _mm_maskmoveu_si128(__m128i __d, __m128i __n, char *__p) { +#ifdef __EMSCRIPTEN__ + union { + unsigned char x[16]; + __m128i m; + } mask, data; + mask.m = __n; + data.m = __d; + for(int i = 0; i < 16; ++i) + if (mask.x[i] & 0x80) + __p[i] = data.x[i]; +#else __builtin_ia32_maskmovdqu((__v16qi)__d, (__v16qi)__n, __p); -} #endif +} static __inline__ void __attribute__((__always_inline__, __nodebug__)) _mm_storel_epi64(__m128i *__p, __m128i __a) diff --git a/tests/test_sse2_full.cpp b/tests/test_sse2_full.cpp index a6afb7546..e506bddf6 100644 --- a/tests/test_sse2_full.cpp +++ b/tests/test_sse2_full.cpp @@ -275,9 +275,7 @@ int main() Ret_M128d_M128d(__m128d, _mm_min_sd); // SSE2 Store instructions: -#if 0 void_M128i_M128i_OutIntPtr(_mm_maskmoveu_si128, char*, 16, 1); -#endif void_OutDoublePtr_M128d(_mm_store_pd, double*, 16, 16); // void_OutDoublePtr_M128d(_mm_store_pd1, double*, 16, 16); void_OutDoublePtr_M128d(_mm_store_sd, double*, 8, 1);