Skip to content

Commit

Permalink
use sse2 instructoion
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten authored and JohanMabille committed Oct 2, 2023
1 parent 0c06fe1 commit 9c06f0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ else()
target_compile_options(test_xsimd_wasm
PUBLIC --std=c++17
PUBLIC "SHELL: -msimd128"
PUBLIC "SHELL: -msse2"
)
# add flags embind, modularize

Expand Down
11 changes: 6 additions & 5 deletions test/test_wasm/test_wasm.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <xmmintrin.h>
#include <wasm_simd128.h>
#include "xsimd/xsimd.hpp"

Expand All @@ -11,11 +12,11 @@ using namespace emscripten;

int test_mean()
{
// std::cout<<"test_mean"<<std::endl;
// xsimd::batch<float, xsimd::avx> a = {1.5, 2.5, 3.5, 4.5};
// xsimd::batch<float, xsimd::avx> b = {2.5, 3.5, 4.5, 5.5};
// auto mean = (a + b) / 2;
// std::cout << mean << std::endl;
std::cout<<"test_mean"<<std::endl;
xsimd::batch<float, xsimd::sse2> a = {1.5, 2.5, 3.5, 4.5};
xsimd::batch<float, xsimd::sse2> b = {2.5, 3.5, 4.5, 5.5};
auto mean = (a + b) / 2;
std::cout << mean << std::endl;
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions test/test_wasm/test_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ set -e
TEST_WASM_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SRC_DIR=$TEST_WASM_DIR/../..

# setup emsdk

git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..



# build wasm
Expand Down

0 comments on commit 9c06f0c

Please sign in to comment.