Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/wasmi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ prefer-btree-collections = [
"wasmparser/prefer-btree-collections",
]
wat = ["dep:wat", "std"]
simd = ["wasmi_core/simd", "wasmi_ir/simd"]
simd = ["wasmi_core/simd", "wasmi_ir/simd", "wasmparser/simd"]

# Enables extra checks performed during Wasmi bytecode execution.
#
Expand Down
12 changes: 12 additions & 0 deletions crates/wasmi/src/engine/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
features.set(WasmFeatures::CUSTOM_PAGE_SIZES, false);
features.set(WasmFeatures::MEMORY64, true);
features.set(WasmFeatures::WIDE_ARITHMETIC, false);
features.set(WasmFeatures::SIMD, cfg!(feature = "simd"));
features
}

Expand Down Expand Up @@ -358,6 +359,17 @@
self
}

/// Enable or disable the [`simd`] Wasm proposal for the [`Config`].
///
/// Enabled by default.
///
/// [`simd`]: https://github.com/WebAssembly/simd
#[cfg(feature = "simd")]
pub fn wasm_simd(&mut self, enable: bool) -> &mut Self {
self.features.set(WasmFeatures::SIMD, enable);

Check warning on line 369 in crates/wasmi/src/engine/config.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/config.rs#L368-L369

Added lines #L368 - L369 were not covered by tests
self
}

/// Enable or disable Wasm floating point (`f32` and `f64`) instructions and types.
///
/// Enabled by default.
Expand Down
733 changes: 733 additions & 0 deletions crates/wasmi/src/engine/executor/instrs.rs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions crates/wasmi/src/engine/translator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ mod utils;
mod visit;
mod visit_register;

#[cfg(feature = "simd")]
mod simd;

#[cfg(test)]
mod tests;

Expand Down
1 change: 1 addition & 0 deletions crates/wasmi/src/engine/translator/simd/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod visit;
Loading