Skip to content

Commit 359b736

Browse files
authored
Rewrite simd128 and wasm support (#620)
* Update representation of `v128` * Rename everything with new naming convention of underscores and no modules/impls * Remove no longer necessary `wasm_simd128` feature * Remove `#[target_feature]` attributes (use `#[cfg]` instead) * Update `assert_instr` tests * Update some implementations as LLVM has evolved * Allow some more esoteric syntax in `#[assert_instr]` * Adjust the safety of APIs where appropriate * Remove macros in favor of hand-coded implementations * Comment out the tests for now as there's no known runtime for these yet
1 parent 5ddcb92 commit 359b736

File tree

11 files changed

+2158
-1366
lines changed

11 files changed

+2158
-1366
lines changed

ci/run.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ case ${TARGET} in
6060
cargo_test "--release"
6161
;;
6262
wasm32-unknown-unknown*)
63-
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
64-
cargo_test "--release --features=wasm_simd128"
63+
# There's no node or other runtime which supports the most recent SIMD
64+
# proposal, but hopefully that's coming soon! For now just test that we
65+
# can codegen with no LLVM faults, and we'll remove `--no-run` at a
66+
# later date.
67+
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128"
68+
export RUSTFLAGS="${RUSTFLAGS} -Cllvm-args=-wasm-enable-unimplemented-simd"
69+
cargo_test "--release --no-run"
6570
;;
6671
*)
6772
;;

coresimd/wasm32/mod.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
//! WASM32 intrinsics
22
3-
#![allow(deprecated)]
4-
5-
#[macro_use]
6-
#[cfg(all(not(test), feature = "wasm_simd128"))]
7-
mod simd128;
8-
9-
#[cfg(all(test, feature = "wasm_simd128"))]
10-
pub mod simd128;
11-
#[cfg(all(test, feature = "wasm_simd128"))]
12-
pub use self::simd128::*;
13-
143
#[cfg(test)]
154
use stdsimd_test::assert_instr;
165
#[cfg(test)]
@@ -21,6 +10,11 @@ mod atomic;
2110
#[cfg(any(target_feature = "atomics", dox))]
2211
pub use self::atomic::*;
2312

13+
#[cfg(any(target_feature = "simd128", dox))]
14+
mod simd128;
15+
#[cfg(any(target_feature = "simd128", dox))]
16+
pub use self::simd128::*;
17+
2418
mod memory;
2519
pub use self::memory::*;
2620

0 commit comments

Comments
 (0)