Skip to content

Commit

Permalink
Implement SSE1 _mm_sfence(). Closes emscripten-core#3051.
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Aug 16, 2015
1 parent 7c803a6 commit a8ae920
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions system/include/emscripten/xmmintrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ _mm_store_ps(float *__p, __m128 __a)
// No NTA cache hint available.
#define _mm_stream_ps _mm_store_ps

static __inline__ void __attribute__((__always_inline__))
_mm_sfence(void)
{
__sync_synchronize(); // Emscripten/SharedArrayBuffer has only a full barrier instruction, which gives a stronger guarantee.
}

#define _MM_SHUFFLE(w, z, y, x) (((w) << 6) | ((z) << 4) | ((y) << 2) | (x))

// This is defined as a macro because __builtin_shufflevector requires its
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sse1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ int main()
_mm_prefetch(dummyData, _MM_HINT_T1);
_mm_prefetch(dummyData, _MM_HINT_T2);
_mm_prefetch(dummyData, _MM_HINT_NTA);
_mm_sfence();
#endif
_mm_sfence();

// SSE1 Misc instructions:
#ifdef TEST_M64
Expand Down

0 comments on commit a8ae920

Please sign in to comment.