Skip to content

Commit 55df6ed

Browse files
committed
Change v128_{load,store} to be unaligned
This reflects the type signature where any arbitrary pointer can get passed in.
1 parent f86f39d commit 55df6ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/core_arch/src/wasm32/simd128.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ extern "C" {
290290
#[cfg_attr(test, assert_instr(v128.load))]
291291
#[target_feature(enable = "simd128")]
292292
pub unsafe fn v128_load(m: *const v128) -> v128 {
293-
*m
293+
ptr::read_unaligned(m)
294294
}
295295

296296
/// Load eight 8-bit integers and sign extend each one to a 16-bit lane
@@ -396,7 +396,7 @@ pub unsafe fn v128_load64_zero(m: *const u64) -> v128 {
396396
#[cfg_attr(test, assert_instr(v128.store))]
397397
#[target_feature(enable = "simd128")]
398398
pub unsafe fn v128_store(m: *mut v128, a: v128) {
399-
*m = a;
399+
ptr::write_unaligned(m, a);
400400
}
401401

402402
/// Loads an 8-bit value from `m` and sets lane `L` of `v` to that value.

0 commit comments

Comments
 (0)