Skip to content

Commit

Permalink
Fix alignment error on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Mar 5, 2024
1 parent 27d46b7 commit 1490c5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/octets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,10 @@ unsafe fn store_neon(ptr: *mut uint8x16_t, value: uint8x16_t) {

// TODO: replace with vst1q_u8 when it's supported
let reinterp = vreinterpretq_u64_u8(value);
*(ptr as *mut u64) = vgetq_lane_u64(reinterp, 0);
*(ptr as *mut u64).add(1) = vgetq_lane_u64(reinterp, 1);
(ptr as *mut u64).write_unaligned(vgetq_lane_u64(reinterp, 0));
(ptr as *mut u64)
.add(1)
.write_unaligned(vgetq_lane_u64(reinterp, 1));
}

#[cfg(all(target_arch = "aarch64", feature = "std"))]
Expand Down

0 comments on commit 1490c5a

Please sign in to comment.