Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit 2d5899a

Browse files
chore: basic simd instructions
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 802a10a commit 2d5899a

File tree

8 files changed

+65
-158
lines changed

8 files changed

+65
-158
lines changed

crates/tinywasm/src/interpreter/executor.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use super::no_std_floats::NoStdFloatExt;
44

55
use alloc::{format, rc::Rc, string::ToString};
66
use core::ops::ControlFlow;
7+
use interpreter::simd::exec_next_simd;
78
use interpreter::stack::CallFrame;
89
use tinywasm_types::*;
910

@@ -12,11 +13,11 @@ use super::stack::{BlockFrame, BlockType, Stack};
1213
use super::values::*;
1314
use crate::*;
1415

15-
pub(super) struct Executor<'store, 'stack> {
16-
cf: CallFrame,
17-
module: ModuleInstance,
18-
store: &'store mut Store,
19-
stack: &'stack mut Stack,
16+
pub(crate) struct Executor<'store, 'stack> {
17+
pub(crate) cf: CallFrame,
18+
pub(crate) module: ModuleInstance,
19+
pub(crate) store: &'store mut Store,
20+
pub(crate) stack: &'stack mut Stack,
2021
}
2122

2223
impl<'store, 'stack> Executor<'store, 'stack> {
@@ -302,7 +303,7 @@ impl<'store, 'stack> Executor<'store, 'stack> {
302303
LocalCopy128(from, to) => self.exec_local_copy::<Value128>(*from, *to),
303304
LocalCopyRef(from, to) => self.exec_local_copy::<ValueRef>(*from, *to),
304305

305-
Simd(op) => unimplemented!("simd instruction {:?}", op),
306+
Simd(op) => exec_next_simd(self, *op).to_cf()?,
306307
};
307308

308309
self.cf.incr_instr_ptr();
Lines changed: 32 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,32 @@
1-
// #[cfg(not(feature = "std"))]
2-
// #[allow(unused_imports)]
3-
// use super::no_std_floats::NoStdFloatExt;
4-
5-
// // WIP
6-
// struct V128([u8; 16]);
7-
8-
// impl V128 {
9-
// fn f32x4(&self) -> [f32; 4] {
10-
// let mut res = [0.0; 4];
11-
// for i in 0..4 {
12-
// let mut f = [0; 4];
13-
// for j in 0..4 {
14-
// f[j] = self.0[i * 4 + j];
15-
// }
16-
// res[i] = f32::from_le_bytes(f);
17-
// }
18-
// res
19-
// }
20-
21-
// fn i32x4(&self) -> [i32; 4] {
22-
// let mut res = [0; 4];
23-
// for i in 0..4 {
24-
// let mut f = [0; 4];
25-
// for j in 0..4 {
26-
// f[j] = self.0[i * 4 + j];
27-
// }
28-
// res[i] = i32::from_le_bytes(f);
29-
// }
30-
// res
31-
// }
32-
33-
// fn i64x2(&self) -> [i64; 2] {
34-
// let mut res = [0; 2];
35-
// for i in 0..2 {
36-
// let mut f = [0; 8];
37-
// for j in 0..8 {
38-
// f[j] = self.0[i * 8 + j];
39-
// }
40-
// res[i] = i64::from_le_bytes(f);
41-
// }
42-
// res
43-
// }
44-
45-
// fn f64x2(&self) -> [f64; 2] {
46-
// let mut res = [0.0; 2];
47-
// for i in 0..2 {
48-
// let mut f = [0; 8];
49-
// for j in 0..8 {
50-
// f[j] = self.0[i * 8 + j];
51-
// }
52-
// res[i] = f64::from_le_bytes(f);
53-
// }
54-
// res
55-
// }
56-
57-
// fn i16x8(&self) -> [i16; 8] {
58-
// let mut res = [0; 8];
59-
// for i in 0..8 {
60-
// let mut f = [0; 2];
61-
// for j in 0..2 {
62-
// f[j] = self.0[i * 2 + j];
63-
// }
64-
// res[i] = i16::from_le_bytes(f);
65-
// }
66-
// res
67-
// }
68-
69-
// fn i8x16(&self) -> [i8; 16] {
70-
// let mut res = [0; 16];
71-
// for i in 0..16 {
72-
// res[i] = i8::from_le_bytes([self.0[i]]);
73-
// }
74-
// res
75-
// }
76-
// }
77-
78-
// fn vvunop(c1: V128) -> V128 {
79-
// let mut res = [0; 16];
80-
// for i in 0..16 {
81-
// res[i] = !c1.0[i];
82-
// }
83-
// V128(res)
84-
// }
85-
86-
// fn vvbinop(c1: V128, c2: V128) -> V128 {
87-
// let mut res = [0; 16];
88-
// for i in 0..16 {
89-
// res[i] = c1.0[i] & c2.0[i];
90-
// }
91-
// V128(res)
92-
// }
93-
94-
// fn vvternop(c1: V128, c2: V128, c3: V128) -> V128 {
95-
// let mut res = [0; 16];
96-
// for i in 0..16 {
97-
// res[i] = c1.0[i] & c2.0[i] | !c1.0[i] & c3.0[i];
98-
// }
99-
// V128(res)
100-
// }
101-
102-
// fn any_true(val: V128) -> bool {
103-
// val.0.iter().any(|&x| x != 0)
104-
// }
105-
106-
// fn i8x16_swizzle(c1: V128, c2: V128) -> V128 {
107-
// let mut res = [0; 16];
108-
// for i in 0..16 {
109-
// res[i] = c1.0[c2.0[i] as usize];
110-
// }
111-
// V128(res)
112-
// }
113-
114-
// fn i18x16_shuffle(c1: V128, c2: V128) -> V128 {
115-
// let mut res = [0; 16];
116-
// for i in 0..16 {
117-
// res[i] = c1.0[(c2.0[i] & 0xf) as usize];
118-
// }
119-
// V128(res)
120-
// }
121-
122-
// fn f32x4_abs(val: V128) -> V128 {
123-
// let mut res = [0; 16];
124-
// for i in 0..4 {
125-
// let f = val.f32x4();
126-
// let f = f32::abs(f[i]);
127-
// let f = f.to_le_bytes();
128-
// for j in 0..4 {
129-
// res[i * 4 + j] = f[j];
130-
// }
131-
// }
132-
// V128(res)
133-
// }
1+
use tinywasm_types::SimdInstruction;
2+
3+
use crate::Result;
4+
5+
#[cfg(not(feature = "std"))]
6+
#[allow(unused_imports)]
7+
use super::no_std_floats::NoStdFloatExt;
8+
use super::{executor::Executor, Value128};
9+
10+
#[inline(always)]
11+
pub(crate) fn exec_next_simd(e: &mut Executor<'_, '_>, op: SimdInstruction) -> Result<()> {
12+
match op {
13+
// unops
14+
SimdInstruction::V128Not => e.stack.values.replace_top_same(|a: Value128| Ok(!a))?,
15+
// binops
16+
SimdInstruction::V128And => e.stack.values.calculate_same(|a: Value128, b: Value128| Ok(a & b))?,
17+
SimdInstruction::V128AndNot => e.stack.values.calculate_same(|a: Value128, b: Value128| Ok(a & !b))?,
18+
SimdInstruction::V128Or => e.stack.values.calculate_same(|a: Value128, b: Value128| Ok(a | b))?,
19+
SimdInstruction::V128Xor => e.stack.values.calculate_same(|a: Value128, b: Value128| Ok(a ^ b))?,
20+
// ternops
21+
SimdInstruction::V128Bitselect => {
22+
let c: Value128 = e.stack.values.pop();
23+
e.stack.values.calculate(|a: Value128, b: Value128| Ok((a & b) | (!a & c)))?;
24+
}
25+
// shifts
26+
_ => {}
27+
}
28+
Ok(())
29+
}
30+
31+
// trait SimdExt {}
32+
// impl SimdExt for Value128 {}

crates/tinywasm/src/interpreter/stack/value_stack.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,33 @@ impl ValueStack {
6767
}
6868

6969
#[inline]
70-
pub(crate) fn calculate_same<T: InternalValue>(&mut self, func: fn(T, T) -> Result<T>) -> Result<()> {
70+
pub(crate) fn calculate_same<T: InternalValue>(&mut self, func: impl FnOnce(T, T) -> Result<T>) -> Result<()> {
7171
T::stack_calculate(self, func)
7272
}
7373

7474
#[inline]
75-
pub(crate) fn calculate<T: InternalValue, U: InternalValue>(&mut self, func: fn(T, T) -> Result<U>) -> Result<()> {
75+
pub(crate) fn calculate<T: InternalValue, U: InternalValue>(
76+
&mut self,
77+
func: impl FnOnce(T, T) -> Result<U>,
78+
) -> Result<()> {
7679
let v2 = T::stack_pop(self);
7780
let v1 = T::stack_pop(self);
7881
U::stack_push(self, func(v1, v2)?);
7982
Ok(())
8083
}
8184

8285
#[inline]
83-
pub(crate) fn replace_top<T: InternalValue, U: InternalValue>(&mut self, func: fn(T) -> Result<U>) -> Result<()> {
86+
pub(crate) fn replace_top<T: InternalValue, U: InternalValue>(
87+
&mut self,
88+
func: impl FnOnce(T) -> Result<U>,
89+
) -> Result<()> {
8490
let v1 = T::stack_pop(self);
8591
U::stack_push(self, func(v1)?);
8692
Ok(())
8793
}
8894

8995
#[inline]
90-
pub(crate) fn replace_top_same<T: InternalValue>(&mut self, func: fn(T) -> Result<T>) -> Result<()> {
96+
pub(crate) fn replace_top_same<T: InternalValue>(&mut self, func: impl Fn(T) -> Result<T>) -> Result<()> {
9197
T::replace_top(self, func)
9298
}
9399

crates/tinywasm/src/interpreter/values.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ mod sealed {
146146

147147
pub(crate) trait InternalValue: sealed::Sealed + Into<TinyWasmValue> {
148148
fn stack_push(stack: &mut ValueStack, value: Self);
149-
fn replace_top(stack: &mut ValueStack, func: fn(Self) -> Result<Self>) -> Result<()>
149+
fn replace_top(stack: &mut ValueStack, func: impl FnOnce(Self) -> Result<Self>) -> Result<()>
150150
where
151151
Self: Sized;
152-
fn stack_calculate(stack: &mut ValueStack, func: fn(Self, Self) -> Result<Self>) -> Result<()>
152+
fn stack_calculate(stack: &mut ValueStack, func: impl FnOnce(Self, Self) -> Result<Self>) -> Result<()>
153153
where
154154
Self: Sized;
155155

@@ -197,7 +197,7 @@ macro_rules! impl_internalvalue {
197197
}
198198

199199
#[inline(always)]
200-
fn stack_calculate(stack: &mut ValueStack, func: fn(Self, Self) -> Result<Self>) -> Result<()> {
200+
fn stack_calculate(stack: &mut ValueStack, func: impl FnOnce(Self, Self) -> Result<Self>) -> Result<()> {
201201
let v2 = stack.$stack.pop();
202202
let v1 = stack.$stack.last_mut();
203203
let (Some(v1), Some(v2)) = (v1, v2) else {
@@ -209,7 +209,7 @@ macro_rules! impl_internalvalue {
209209
}
210210

211211
#[inline(always)]
212-
fn replace_top(stack: &mut ValueStack, func: fn(Self) -> Result<Self>) -> Result<()> {
212+
fn replace_top(stack: &mut ValueStack, func: impl FnOnce(Self) -> Result<Self>) -> Result<()> {
213213
let Some(v) = stack.$stack.last_mut() else {
214214
unreachable!("ValueStack underflow, this is a bug");
215215
};

crates/tinywasm/src/store/table.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ impl TableInstance {
4848
}
4949

5050
pub(crate) fn get(&self, addr: TableAddr) -> Result<&TableElement> {
51-
// self.elements.get(addr as usize).ok_or_else(|| Error::Trap(Trap::UndefinedElement { index: addr as usize }))
52-
self.elements.get(addr as usize).ok_or({
53-
Error::Trap(Trap::TableOutOfBounds { offset: addr as usize, len: 1, max: self.elements.len() })
54-
})
51+
self.elements.get(addr as usize).ok_or(Error::Trap(Trap::TableOutOfBounds {
52+
offset: addr as usize,
53+
len: 1,
54+
max: self.elements.len(),
55+
}))
5556
}
5657

5758
pub(crate) fn copy_from_slice(&mut self, dst: usize, src: &[TableElement]) -> Result<()> {
@@ -172,7 +173,7 @@ impl TableElement {
172173
}
173174
}
174175

175-
pub(crate) fn map<F: FnOnce(Addr) -> Addr>(self, f: F) -> Self {
176+
pub(crate) fn map(self, f: impl FnOnce(Addr) -> Addr) -> Self {
176177
match self {
177178
TableElement::Uninitialized => TableElement::Uninitialized,
178179
TableElement::Initialized(addr) => TableElement::Initialized(f(addr)),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
0.8.0,1300,24679,[{"name":"simd_address.wast","passed":4,"failed":45},{"name":"simd_align.wast","passed":46,"failed":54},{"name":"simd_bit_shift.wast","passed":39,"failed":213},{"name":"simd_bitwise.wast","passed":28,"failed":141},{"name":"simd_boolean.wast","passed":16,"failed":261},{"name":"simd_const.wast","passed":301,"failed":456},{"name":"simd_conversions.wast","passed":48,"failed":234},{"name":"simd_f32x4.wast","passed":16,"failed":774},{"name":"simd_f32x4_arith.wast","passed":16,"failed":1806},{"name":"simd_f32x4_cmp.wast","passed":24,"failed":2583},{"name":"simd_f32x4_pmin_pmax.wast","passed":14,"failed":3873},{"name":"simd_f32x4_rounding.wast","passed":24,"failed":177},{"name":"simd_f64x2.wast","passed":8,"failed":795},{"name":"simd_f64x2_arith.wast","passed":16,"failed":1809},{"name":"simd_f64x2_cmp.wast","passed":24,"failed":2661},{"name":"simd_f64x2_pmin_pmax.wast","passed":14,"failed":3873},{"name":"simd_f64x2_rounding.wast","passed":24,"failed":177},{"name":"simd_i16x8_arith.wast","passed":11,"failed":183},{"name":"simd_i16x8_arith2.wast","passed":19,"failed":153},{"name":"simd_i16x8_cmp.wast","passed":30,"failed":435},{"name":"simd_i16x8_extadd_pairwise_i8x16.wast","passed":4,"failed":17},{"name":"simd_i16x8_extmul_i8x16.wast","passed":12,"failed":105},{"name":"simd_i16x8_q15mulr_sat_s.wast","passed":3,"failed":27},{"name":"simd_i16x8_sat_arith.wast","passed":16,"failed":206},{"name":"simd_i32x4_arith.wast","passed":11,"failed":183},{"name":"simd_i32x4_arith2.wast","passed":26,"failed":123},{"name":"simd_i32x4_cmp.wast","passed":40,"failed":435},{"name":"simd_i32x4_dot_i16x8.wast","passed":3,"failed":27},{"name":"simd_i32x4_extadd_pairwise_i16x8.wast","passed":4,"failed":17},{"name":"simd_i32x4_extmul_i16x8.wast","passed":12,"failed":105},{"name":"simd_i32x4_trunc_sat_f32x4.wast","passed":4,"failed":103},{"name":"simd_i32x4_trunc_sat_f64x2.wast","passed":4,"failed":103},{"name":"simd_i64x2_arith.wast","passed":11,"failed":189},{"name":"simd_i64x2_arith2.wast","passed":2,"failed":23},{"name":"simd_i64x2_cmp.wast","passed":10,"failed":103},{"name":"simd_i64x2_extmul_i32x4.wast","passed":12,"failed":105},{"name":"simd_i8x16_arith.wast","passed":8,"failed":123},{"name":"simd_i8x16_arith2.wast","passed":25,"failed":186},{"name":"simd_i8x16_cmp.wast","passed":30,"failed":415},{"name":"simd_i8x16_sat_arith.wast","passed":24,"failed":190},{"name":"simd_int_to_int_extend.wast","passed":24,"failed":229},{"name":"simd_lane.wast","passed":189,"failed":286},{"name":"simd_linking.wast","passed":0,"failed":3},{"name":"simd_load.wast","passed":8,"failed":31},{"name":"simd_load16_lane.wast","passed":3,"failed":33},{"name":"simd_load32_lane.wast","passed":3,"failed":21},{"name":"simd_load64_lane.wast","passed":3,"failed":13},{"name":"simd_load8_lane.wast","passed":3,"failed":49},{"name":"simd_load_extend.wast","passed":18,"failed":86},{"name":"simd_load_splat.wast","passed":12,"failed":114},{"name":"simd_load_zero.wast","passed":10,"failed":29},{"name":"simd_splat.wast","passed":23,"failed":162},{"name":"simd_store.wast","passed":9,"failed":19},{"name":"simd_store16_lane.wast","passed":3,"failed":33},{"name":"simd_store32_lane.wast","passed":3,"failed":21},{"name":"simd_store64_lane.wast","passed":3,"failed":13},{"name":"simd_store8_lane.wast","passed":3,"failed":49}]
2-
0.9.0-alpha.0,1702,24277,[{"name":"simd_address.wast","passed":7,"failed":42},{"name":"simd_align.wast","passed":92,"failed":8},{"name":"simd_bit_shift.wast","passed":41,"failed":211},{"name":"simd_bitwise.wast","passed":30,"failed":139},{"name":"simd_boolean.wast","passed":18,"failed":259},{"name":"simd_const.wast","passed":551,"failed":206},{"name":"simd_conversions.wast","passed":50,"failed":232},{"name":"simd_f32x4.wast","passed":18,"failed":772},{"name":"simd_f32x4_arith.wast","passed":19,"failed":1803},{"name":"simd_f32x4_cmp.wast","passed":26,"failed":2581},{"name":"simd_f32x4_pmin_pmax.wast","passed":15,"failed":3872},{"name":"simd_f32x4_rounding.wast","passed":25,"failed":176},{"name":"simd_f64x2.wast","passed":10,"failed":793},{"name":"simd_f64x2_arith.wast","passed":19,"failed":1806},{"name":"simd_f64x2_cmp.wast","passed":26,"failed":2659},{"name":"simd_f64x2_pmin_pmax.wast","passed":15,"failed":3872},{"name":"simd_f64x2_rounding.wast","passed":25,"failed":176},{"name":"simd_i16x8_arith.wast","passed":13,"failed":181},{"name":"simd_i16x8_arith2.wast","passed":21,"failed":151},{"name":"simd_i16x8_cmp.wast","passed":32,"failed":433},{"name":"simd_i16x8_extadd_pairwise_i8x16.wast","passed":5,"failed":16},{"name":"simd_i16x8_extmul_i8x16.wast","passed":13,"failed":104},{"name":"simd_i16x8_q15mulr_sat_s.wast","passed":4,"failed":26},{"name":"simd_i16x8_sat_arith.wast","passed":18,"failed":204},{"name":"simd_i32x4_arith.wast","passed":13,"failed":181},{"name":"simd_i32x4_arith2.wast","passed":28,"failed":121},{"name":"simd_i32x4_cmp.wast","passed":42,"failed":433},{"name":"simd_i32x4_dot_i16x8.wast","passed":4,"failed":26},{"name":"simd_i32x4_extadd_pairwise_i16x8.wast","passed":5,"failed":16},{"name":"simd_i32x4_extmul_i16x8.wast","passed":13,"failed":104},{"name":"simd_i32x4_trunc_sat_f32x4.wast","passed":5,"failed":102},{"name":"simd_i32x4_trunc_sat_f64x2.wast","passed":5,"failed":102},{"name":"simd_i64x2_arith.wast","passed":13,"failed":187},{"name":"simd_i64x2_arith2.wast","passed":4,"failed":21},{"name":"simd_i64x2_cmp.wast","passed":11,"failed":102},{"name":"simd_i64x2_extmul_i32x4.wast","passed":13,"failed":104},{"name":"simd_i8x16_arith.wast","passed":10,"failed":121},{"name":"simd_i8x16_arith2.wast","passed":27,"failed":184},{"name":"simd_i8x16_cmp.wast","passed":32,"failed":413},{"name":"simd_i8x16_sat_arith.wast","passed":26,"failed":188},{"name":"simd_int_to_int_extend.wast","passed":25,"failed":228},{"name":"simd_lane.wast","passed":200,"failed":275},{"name":"simd_linking.wast","passed":0,"failed":3},{"name":"simd_load.wast","passed":22,"failed":17},{"name":"simd_load16_lane.wast","passed":4,"failed":32},{"name":"simd_load32_lane.wast","passed":4,"failed":20},{"name":"simd_load64_lane.wast","passed":4,"failed":12},{"name":"simd_load8_lane.wast","passed":4,"failed":48},{"name":"simd_load_extend.wast","passed":20,"failed":84},{"name":"simd_load_splat.wast","passed":14,"failed":112},{"name":"simd_load_zero.wast","passed":12,"failed":27},{"name":"simd_splat.wast","passed":26,"failed":159},{"name":"simd_store.wast","passed":11,"failed":17},{"name":"simd_store16_lane.wast","passed":3,"failed":33},{"name":"simd_store32_lane.wast","passed":3,"failed":21},{"name":"simd_store64_lane.wast","passed":3,"failed":13},{"name":"simd_store8_lane.wast","passed":3,"failed":49}]
2+
0.9.0-alpha.0,1741,24238,[{"name":"simd_address.wast","passed":7,"failed":42},{"name":"simd_align.wast","passed":93,"failed":7},{"name":"simd_bit_shift.wast","passed":41,"failed":211},{"name":"simd_bitwise.wast","passed":30,"failed":139},{"name":"simd_boolean.wast","passed":18,"failed":259},{"name":"simd_const.wast","passed":551,"failed":206},{"name":"simd_conversions.wast","passed":50,"failed":232},{"name":"simd_f32x4.wast","passed":18,"failed":772},{"name":"simd_f32x4_arith.wast","passed":19,"failed":1803},{"name":"simd_f32x4_cmp.wast","passed":26,"failed":2581},{"name":"simd_f32x4_pmin_pmax.wast","passed":15,"failed":3872},{"name":"simd_f32x4_rounding.wast","passed":25,"failed":176},{"name":"simd_f64x2.wast","passed":10,"failed":793},{"name":"simd_f64x2_arith.wast","passed":19,"failed":1806},{"name":"simd_f64x2_cmp.wast","passed":26,"failed":2659},{"name":"simd_f64x2_pmin_pmax.wast","passed":15,"failed":3872},{"name":"simd_f64x2_rounding.wast","passed":25,"failed":176},{"name":"simd_i16x8_arith.wast","passed":13,"failed":181},{"name":"simd_i16x8_arith2.wast","passed":21,"failed":151},{"name":"simd_i16x8_cmp.wast","passed":32,"failed":433},{"name":"simd_i16x8_extadd_pairwise_i8x16.wast","passed":5,"failed":16},{"name":"simd_i16x8_extmul_i8x16.wast","passed":13,"failed":104},{"name":"simd_i16x8_q15mulr_sat_s.wast","passed":4,"failed":26},{"name":"simd_i16x8_sat_arith.wast","passed":18,"failed":204},{"name":"simd_i32x4_arith.wast","passed":13,"failed":181},{"name":"simd_i32x4_arith2.wast","passed":28,"failed":121},{"name":"simd_i32x4_cmp.wast","passed":42,"failed":433},{"name":"simd_i32x4_dot_i16x8.wast","passed":4,"failed":26},{"name":"simd_i32x4_extadd_pairwise_i16x8.wast","passed":5,"failed":16},{"name":"simd_i32x4_extmul_i16x8.wast","passed":13,"failed":104},{"name":"simd_i32x4_trunc_sat_f32x4.wast","passed":5,"failed":102},{"name":"simd_i32x4_trunc_sat_f64x2.wast","passed":5,"failed":102},{"name":"simd_i64x2_arith.wast","passed":13,"failed":187},{"name":"simd_i64x2_arith2.wast","passed":4,"failed":21},{"name":"simd_i64x2_cmp.wast","passed":11,"failed":102},{"name":"simd_i64x2_extmul_i32x4.wast","passed":13,"failed":104},{"name":"simd_i8x16_arith.wast","passed":10,"failed":121},{"name":"simd_i8x16_arith2.wast","passed":27,"failed":184},{"name":"simd_i8x16_cmp.wast","passed":32,"failed":413},{"name":"simd_i8x16_sat_arith.wast","passed":26,"failed":188},{"name":"simd_int_to_int_extend.wast","passed":25,"failed":228},{"name":"simd_lane.wast","passed":209,"failed":266},{"name":"simd_linking.wast","passed":0,"failed":3},{"name":"simd_load.wast","passed":24,"failed":15},{"name":"simd_load16_lane.wast","passed":4,"failed":32},{"name":"simd_load32_lane.wast","passed":4,"failed":20},{"name":"simd_load64_lane.wast","passed":4,"failed":12},{"name":"simd_load8_lane.wast","passed":4,"failed":48},{"name":"simd_load_extend.wast","passed":24,"failed":80},{"name":"simd_load_splat.wast","passed":17,"failed":109},{"name":"simd_load_zero.wast","passed":12,"failed":27},{"name":"simd_splat.wast","passed":37,"failed":148},{"name":"simd_store.wast","passed":20,"failed":8},{"name":"simd_store16_lane.wast","passed":3,"failed":33},{"name":"simd_store32_lane.wast","passed":3,"failed":21},{"name":"simd_store64_lane.wast","passed":3,"failed":13},{"name":"simd_store8_lane.wast","passed":3,"failed":49}]

crates/tinywasm/tests/testsuite/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn exec_fn(
4646
instance.exported_func_untyped(&store, name)?.call(&mut store, args)
4747
}
4848

49-
pub fn catch_unwind_silent<F: FnOnce() -> R, R>(f: F) -> std::thread::Result<R> {
49+
pub fn catch_unwind_silent<R>(f: impl FnOnce() -> R) -> std::thread::Result<R> {
5050
let prev_hook = panic::take_hook();
5151
panic::set_hook(Box::new(|_| {}));
5252
let result = panic::catch_unwind(AssertUnwindSafe(f));

0 commit comments

Comments
 (0)