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/core/src/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ macro_rules! impl_v128_loadN_splat_at_for {
///
/// If `address` loads out of bounds from `memory`.
pub fn $name(memory: &[u8], address: usize) -> Result<V128, TrapCode> {
memory::load_at::<u8>(memory, address).map(V128::splat)
memory::load_at::<$ty>(memory, address).map(V128::splat)
}
)*
};
Expand Down
120 changes: 84 additions & 36 deletions crates/wasmi/src/engine/executor/instrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,125 +2074,173 @@
offset,
} => self.execute_v128_load_offset16(result, ptr, offset)?,
#[cfg(feature = "simd")]
Instr::V128Load32Zero { result, offset_lo } => todo!(),
Instr::V128Load32Zero { result, offset_lo } => {
self.execute_v128_load32_zero(&store.inner, result, offset_lo)?

Check warning on line 2078 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2077-L2078

Added lines #L2077 - L2078 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load32ZeroAt { result, address } => todo!(),
Instr::V128Load32ZeroAt { result, address } => {
self.execute_v128_load32_zero_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load32ZeroOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load32_zero_offset16(result, ptr, offset)?,

Check warning on line 2089 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2089

Added line #L2089 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load64Zero { result, offset_lo } => todo!(),
Instr::V128Load64Zero { result, offset_lo } => {
self.execute_v128_load64_zero(&store.inner, result, offset_lo)?

Check warning on line 2092 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2091-L2092

Added lines #L2091 - L2092 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load64ZeroAt { result, address } => todo!(),
Instr::V128Load64ZeroAt { result, address } => {
self.execute_v128_load64_zero_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load64ZeroOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load64_zero_offset16(result, ptr, offset)?,

Check warning on line 2103 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2103

Added line #L2103 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load8Splat { result, offset_lo } => todo!(),
Instr::V128Load8Splat { result, offset_lo } => {
self.execute_v128_load8_splat(&store.inner, result, offset_lo)?
}
#[cfg(feature = "simd")]
Instr::V128Load8SplatAt { result, address } => todo!(),
Instr::V128Load8SplatAt { result, address } => {
self.execute_v128_load8_splat_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load8SplatOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load8_splat_offset16(result, ptr, offset)?,

Check warning on line 2117 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2117

Added line #L2117 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load16Splat { result, offset_lo } => todo!(),
Instr::V128Load16Splat { result, offset_lo } => {
self.execute_v128_load16_splat(&store.inner, result, offset_lo)?

Check warning on line 2120 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2119-L2120

Added lines #L2119 - L2120 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load16SplatAt { result, address } => todo!(),
Instr::V128Load16SplatAt { result, address } => {
self.execute_v128_load16_splat_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load16SplatOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load16_splat_offset16(result, ptr, offset)?,

Check warning on line 2131 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2131

Added line #L2131 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load32Splat { result, offset_lo } => todo!(),
Instr::V128Load32Splat { result, offset_lo } => {
self.execute_v128_load32_splat(&store.inner, result, offset_lo)?

Check warning on line 2134 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2133-L2134

Added lines #L2133 - L2134 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load32SplatAt { result, address } => todo!(),
Instr::V128Load32SplatAt { result, address } => {
self.execute_v128_load32_splat_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load32SplatOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load32_splat_offset16(result, ptr, offset)?,

Check warning on line 2145 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2145

Added line #L2145 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load64Splat { result, offset_lo } => todo!(),
Instr::V128Load64Splat { result, offset_lo } => {
self.execute_v128_load64_splat(&store.inner, result, offset_lo)?

Check warning on line 2148 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2147-L2148

Added lines #L2147 - L2148 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load64SplatAt { result, address } => todo!(),
Instr::V128Load64SplatAt { result, address } => {
self.execute_v128_load64_splat_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load64SplatOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load64_splat_offset16(result, ptr, offset)?,

Check warning on line 2159 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2159

Added line #L2159 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load8x8S { result, offset_lo } => todo!(),
Instr::V128Load8x8S { result, offset_lo } => {
self.execute_v128_load8x8_s(&store.inner, result, offset_lo)?

Check warning on line 2162 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2161-L2162

Added lines #L2161 - L2162 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load8x8SAt { result, address } => todo!(),
Instr::V128Load8x8SAt { result, address } => {
self.execute_v128_load8x8_s_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load8x8SOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load8x8_s_offset16(result, ptr, offset)?,

Check warning on line 2173 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2173

Added line #L2173 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load8x8U { result, offset_lo } => todo!(),
Instr::V128Load8x8U { result, offset_lo } => {
self.execute_v128_load8x8_u(&store.inner, result, offset_lo)?

Check warning on line 2176 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2175-L2176

Added lines #L2175 - L2176 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load8x8UAt { result, address } => todo!(),
Instr::V128Load8x8UAt { result, address } => {
self.execute_v128_load8x8_u_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load8x8UOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load8x8_u_offset16(result, ptr, offset)?,

Check warning on line 2187 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2187

Added line #L2187 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load16x4S { result, offset_lo } => todo!(),
Instr::V128Load16x4S { result, offset_lo } => {
self.execute_v128_load16x4_s(&store.inner, result, offset_lo)?

Check warning on line 2190 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2189-L2190

Added lines #L2189 - L2190 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load16x4SAt { result, address } => todo!(),
Instr::V128Load16x4SAt { result, address } => {
self.execute_v128_load16x4_s_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load16x4SOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load16x4_s_offset16(result, ptr, offset)?,

Check warning on line 2201 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2201

Added line #L2201 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load16x4U { result, offset_lo } => todo!(),
Instr::V128Load16x4U { result, offset_lo } => {
self.execute_v128_load16x4_u(&store.inner, result, offset_lo)?

Check warning on line 2204 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2203-L2204

Added lines #L2203 - L2204 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load16x4UAt { result, address } => todo!(),
Instr::V128Load16x4UAt { result, address } => {
self.execute_v128_load16x4_u_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load16x4UOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load16x4_u_offset16(result, ptr, offset)?,

Check warning on line 2215 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2215

Added line #L2215 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load32x2S { result, offset_lo } => todo!(),
Instr::V128Load32x2S { result, offset_lo } => {
self.execute_v128_load32x2_s(&store.inner, result, offset_lo)?

Check warning on line 2218 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2217-L2218

Added lines #L2217 - L2218 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load32x2SAt { result, address } => todo!(),
Instr::V128Load32x2SAt { result, address } => {
self.execute_v128_load32x2_s_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load32x2SOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load32x2_s_offset16(result, ptr, offset)?,

Check warning on line 2229 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2229

Added line #L2229 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load32x2U { result, offset_lo } => todo!(),
Instr::V128Load32x2U { result, offset_lo } => {
self.execute_v128_load32x2_u(&store.inner, result, offset_lo)?

Check warning on line 2232 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2231-L2232

Added lines #L2231 - L2232 were not covered by tests
}
#[cfg(feature = "simd")]
Instr::V128Load32x2UAt { result, address } => todo!(),
Instr::V128Load32x2UAt { result, address } => {
self.execute_v128_load32x2_u_at(&store.inner, result, address)?
}
#[cfg(feature = "simd")]
Instr::V128Load32x2UOffset16 {
result,
ptr,
offset,
} => todo!(),
} => self.execute_v128_load32x2_u_offset16(result, ptr, offset)?,

Check warning on line 2243 in crates/wasmi/src/engine/executor/instrs.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/engine/executor/instrs.rs#L2243

Added line #L2243 was not covered by tests
#[cfg(feature = "simd")]
Instr::V128Load8Lane { result, offset_lo } => todo!(),
#[cfg(feature = "simd")]
Expand Down
96 changes: 96 additions & 0 deletions crates/wasmi/src/engine/executor/instrs/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,102 @@ impl Executor<'_> {
simd::v128_load,
simd::v128_load_at,
),
(
V128,
(Instruction::V128Load8x8S, execute_v128_load8x8_s),
(Instruction::V128Load8x8SAt, execute_v128_load8x8_s_at),
(Instruction::V128Load8x8SOffset16, execute_v128_load8x8_s_offset16),
simd::v128_load8x8_s,
simd::v128_load8x8_s_at,
),
(
V128,
(Instruction::V128Load8x8U, execute_v128_load8x8_u),
(Instruction::V128Load8x8UAt, execute_v128_load8x8_u_at),
(Instruction::V128Load8x8UOffset16, execute_v128_load8x8_u_offset16),
simd::v128_load8x8_u,
simd::v128_load8x8_u_at,
),
(
V128,
(Instruction::V128Load16x4S, execute_v128_load16x4_s),
(Instruction::V128Load16x4SAt, execute_v128_load16x4_s_at),
(Instruction::V128Load16x4SOffset16, execute_v128_load16x4_s_offset16),
simd::v128_load16x4_s,
simd::v128_load16x4_s_at,
),
(
V128,
(Instruction::V128Load16x4U, execute_v128_load16x4_u),
(Instruction::V128Load16x4UAt, execute_v128_load16x4_u_at),
(Instruction::V128Load16x4UOffset16, execute_v128_load16x4_u_offset16),
simd::v128_load16x4_u,
simd::v128_load16x4_u_at,
),
(
V128,
(Instruction::V128Load32x2S, execute_v128_load32x2_s),
(Instruction::V128Load32x2SAt, execute_v128_load32x2_s_at),
(Instruction::V128Load32x2SOffset16, execute_v128_load32x2_s_offset16),
simd::v128_load32x2_s,
simd::v128_load32x2_s_at,
),
(
V128,
(Instruction::V128Load32x2U, execute_v128_load32x2_u),
(Instruction::V128Load32x2UAt, execute_v128_load32x2_u_at),
(Instruction::V128Load32x2UOffset16, execute_v128_load32x2_u_offset16),
simd::v128_load32x2_u,
simd::v128_load32x2_u_at,
),
(
V128,
(Instruction::V128Load8Splat, execute_v128_load8_splat),
(Instruction::V128Load8SplatAt, execute_v128_load8_splat_at),
(Instruction::V128Load8SplatOffset16, execute_v128_load8_splat_offset16),
simd::v128_load8_splat,
simd::v128_load8_splat_at,
),
(
V128,
(Instruction::V128Load16Splat, execute_v128_load16_splat),
(Instruction::V128Load16SplatAt, execute_v128_load16_splat_at),
(Instruction::V128Load16SplatOffset16, execute_v128_load16_splat_offset16),
simd::v128_load16_splat,
simd::v128_load16_splat_at,
),
(
V128,
(Instruction::V128Load32Splat, execute_v128_load32_splat),
(Instruction::V128Load32SplatAt, execute_v128_load32_splat_at),
(Instruction::V128Load32SplatOffset16, execute_v128_load32_splat_offset16),
simd::v128_load32_splat,
simd::v128_load32_splat_at,
),
(
V128,
(Instruction::V128Load64Splat, execute_v128_load64_splat),
(Instruction::V128Load64SplatAt, execute_v128_load64_splat_at),
(Instruction::V128Load64SplatOffset16, execute_v128_load64_splat_offset16),
simd::v128_load64_splat,
simd::v128_load64_splat_at,
),
(
V128,
(Instruction::V128Load32Zero, execute_v128_load32_zero),
(Instruction::V128Load32ZeroAt, execute_v128_load32_zero_at),
(Instruction::V128Load32ZeroOffset16, execute_v128_load32_zero_offset16),
simd::v128_load32_zero,
simd::v128_load32_zero_at,
),
(
V128,
(Instruction::V128Load64Zero, execute_v128_load64_zero),
(Instruction::V128Load64ZeroAt, execute_v128_load64_zero_at),
(Instruction::V128Load64ZeroOffset16, execute_v128_load64_zero_offset16),
simd::v128_load64_zero,
simd::v128_load64_zero_at,
),
}

impl_execute_load! {
Expand Down
Loading