Skip to content

Commit

Permalink
add wasm_simd128 feature
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Aug 15, 2018
1 parent 131eccd commit 70bf4ed
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ci/run.sh
Expand Up @@ -39,10 +39,6 @@ case ${TARGET} in
*android*)
export STDSIMD_DISABLE_ASSERT_INSTR=1
;;
wasm32*)
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
;;

*)
;;
esac
Expand All @@ -63,13 +59,17 @@ cargo_test() {
cargo_test
cargo_test "--release"

# Test x86 targets compiled with AVX.
# Test targets compiled with extra features.
case ${TARGET} in
x86*)
RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
export STDSIMD_DISABLE_ASSERT_INSTR=1
cargo_test "--release"
;;
wasm32-unknown-unknown*)
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
cargo_test "--release --features=wasm32_simd128"
;;
*)
;;
esac
7 changes: 4 additions & 3 deletions coresimd/wasm32/mod.rs
@@ -1,11 +1,12 @@
//! WASM32 intrinsics

#[macro_use]
#[cfg(not(test))]
#[cfg(all(not(test), feature = "wasm_simd128"))]
mod simd128;
#[cfg(test)]

#[cfg(all(test, feature = "wasm_simd128"))]
pub mod simd128;
pub use self::simd128::*;
#[cfg(all(test, feature = "wasm_simd128"))]

#[cfg(test)]
use stdsimd_test::assert_instr;
Expand Down
2 changes: 2 additions & 0 deletions crates/coresimd/Cargo.toml
Expand Up @@ -31,3 +31,5 @@ strict = []
# Internal-usage only: enables only those intrinsics supported by Intel's
# Software Development Environment (SDE).
intel_sde = []
# Enables wasm simd128 intrinsics
wasm_simd128 = []
4 changes: 4 additions & 0 deletions crates/stdsimd/Cargo.toml
Expand Up @@ -37,3 +37,7 @@ path = "../../examples/hex.rs"
name = "wasm"
crate-type = ["cdylib"]
path = "../../examples/wasm.rs"

[features]
default = []
wasm_simd128 = ["coresimd/wasm_simd128"]

0 comments on commit 70bf4ed

Please sign in to comment.