Skip to content

Commit

Permalink
ex10 fix for emscripten (same as for win)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten committed Oct 6, 2023
1 parent 86dd40d commit 2278044
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/xsimd/arch/xsimd_scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ namespace xsimd
{
return ::exp10(x);
}
#elif defined(_WIN32)
#elif defined(_WIN32) || defined(EMSCRIPTEN)
template <class T, class = typename std::enable_if<std::is_scalar<T>::value>::type>
inline T exp10(const T& x) noexcept
{
Expand Down
10 changes: 5 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ add_subdirectory(doc)

if(EMSCRIPTEN)
set_target_properties(test_xsimd PROPERTIES LINK_FLAGS "-s MODULARIZE=1 -s EXPORT_NAME=test_xsimd_wasm -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -lembind")
# target_compile_options(test_xsimd
# PUBLIC --std=c++17
# PUBLIC "SHELL: -msimd128"
# PUBLIC "SHELL: -msse2"
# )
target_compile_options(test_xsimd
PUBLIC --std=c++14
PUBLIC "SHELL: -msimd128"
PUBLIC "SHELL: -msse2"
)
endif()
3 changes: 2 additions & 1 deletion test/test_power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ struct power_test
INFO("pow");
CHECK_EQ(diff, 0);

#ifdef __SSE__
// use of undeclared identifier '_MM_SET_EXCEPTION_MASK for emscripten
#if defined(__SSE__) && !defined(EMSCRIPTEN)
// Test with FE_INVALID...
unsigned mask = _MM_GET_EXCEPTION_MASK();
_MM_SET_EXCEPTION_MASK(mask & ~_MM_MASK_INVALID);
Expand Down

0 comments on commit 2278044

Please sign in to comment.