Skip to content

Commit 70bf4ed

Browse files
committed
add wasm_simd128 feature
1 parent 131eccd commit 70bf4ed

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

ci/run.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ case ${TARGET} in
3939
*android*)
4040
export STDSIMD_DISABLE_ASSERT_INSTR=1
4141
;;
42-
wasm32*)
43-
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
44-
;;
45-
4642
*)
4743
;;
4844
esac
@@ -63,13 +59,17 @@ cargo_test() {
6359
cargo_test
6460
cargo_test "--release"
6561

66-
# Test x86 targets compiled with AVX.
62+
# Test targets compiled with extra features.
6763
case ${TARGET} in
6864
x86*)
6965
RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
7066
export STDSIMD_DISABLE_ASSERT_INSTR=1
7167
cargo_test "--release"
7268
;;
69+
wasm32-unknown-unknown*)
70+
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
71+
cargo_test "--release --features=wasm32_simd128"
72+
;;
7373
*)
7474
;;
7575
esac

coresimd/wasm32/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
//! WASM32 intrinsics
22
33
#[macro_use]
4-
#[cfg(not(test))]
4+
#[cfg(all(not(test), feature = "wasm_simd128"))]
55
mod simd128;
6-
#[cfg(test)]
6+
7+
#[cfg(all(test, feature = "wasm_simd128"))]
78
pub mod simd128;
8-
pub use self::simd128::*;
9+
#[cfg(all(test, feature = "wasm_simd128"))]
910

1011
#[cfg(test)]
1112
use stdsimd_test::assert_instr;

crates/coresimd/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ strict = []
3131
# Internal-usage only: enables only those intrinsics supported by Intel's
3232
# Software Development Environment (SDE).
3333
intel_sde = []
34+
# Enables wasm simd128 intrinsics
35+
wasm_simd128 = []

crates/stdsimd/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ path = "../../examples/hex.rs"
3737
name = "wasm"
3838
crate-type = ["cdylib"]
3939
path = "../../examples/wasm.rs"
40+
41+
[features]
42+
default = []
43+
wasm_simd128 = ["coresimd/wasm_simd128"]

0 commit comments

Comments
 (0)