Skip to content

Commit df5ccb5

Browse files
committed
update Wasmi to v0.43.0 and enable its simd feature
This allows to differentially fuzz the Wasm `simd` proposal support in Wasmtime against Wasmi's `simd` proposal implementation.
1 parent 7e5a7e5 commit df5ccb5

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Cargo.lock

Lines changed: 19 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/fuzzing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ wasm-encoder = { workspace = true }
3030
wasm-smith = { workspace = true }
3131
wasm-mutate = { workspace = true }
3232
wasm-spec-interpreter = { path = "./wasm-spec-interpreter", optional = true }
33-
wasmi = "0.42.1"
33+
wasmi = { version = "0.43.0", default-features = false, features = ["std", "simd"] }
3434
futures = { workspace = true }
3535
wasmtime-test-util = { workspace = true, features = ['wast', 'component-fuzz', 'component'] }
3636

crates/fuzzing/src/oracles/diff_wasmi.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ impl WasmiEngine {
1414
pub(crate) fn new(config: &mut Config) -> Self {
1515
let config = &mut config.module_config.config;
1616
// Force generated Wasm modules to never have features that Wasmi doesn't support.
17-
config.simd_enabled = false;
1817
config.relaxed_simd_enabled = false;
1918
config.threads_enabled = false;
2019
config.exceptions_enabled = false;
@@ -35,6 +34,7 @@ impl WasmiEngine {
3534
.wasm_extended_const(config.extended_const_enabled)
3635
.wasm_custom_page_sizes(config.custom_page_sizes_enabled)
3736
.wasm_memory64(config.memory64_enabled)
37+
.wasm_simd(config.simd_enabled)
3838
.wasm_wide_arithmetic(config.wide_arithmetic_enabled);
3939
Self {
4040
engine: wasmi::Engine::new(&wasmi_config),
@@ -175,7 +175,7 @@ impl From<&DiffValue> for wasmi::Val {
175175
DiffValue::I64(n) => WasmiValue::I64(n),
176176
DiffValue::F32(n) => WasmiValue::F32(wasmi::core::F32::from_bits(n)),
177177
DiffValue::F64(n) => WasmiValue::F64(wasmi::core::F64::from_bits(n)),
178-
DiffValue::V128(_) => unimplemented!(),
178+
DiffValue::V128(n) => WasmiValue::V128(wasmi::core::V128::from(n)),
179179
DiffValue::FuncRef { null } => {
180180
assert!(null);
181181
WasmiValue::FuncRef(wasmi::FuncRef::null())
@@ -197,6 +197,7 @@ impl From<wasmi::Val> for DiffValue {
197197
WasmiValue::I64(n) => DiffValue::I64(n),
198198
WasmiValue::F32(n) => DiffValue::F32(n.to_bits()),
199199
WasmiValue::F64(n) => DiffValue::F64(n.to_bits()),
200+
WasmiValue::V128(n) => DiffValue::V128(n.as_u128()),
200201
WasmiValue::FuncRef(f) => DiffValue::FuncRef { null: f.is_null() },
201202
WasmiValue::ExternRef(e) => DiffValue::ExternRef { null: e.is_null() },
202203
}

0 commit comments

Comments
 (0)