Skip to content

Commit b2d3f2f

Browse files
committed
Removes alignment requirement in st3
1 parent 3fdc05a commit b2d3f2f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

crates/core_arch/src/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ macro_rules! deinterleaving_load {
277277

278278
// NOTE: copy_nonoverlapping requires both pointers to be aligned to at least align_of::<$elem>(),
279279
// passing a pointer that is not sufficiently aligned is an UB.
280-
let arr: Arr = std::array::from_fn(|x| $crate::ptr::read_unaligned(($ptr as *const $elem).add(x)));
280+
let arr: Arr = $crate::array::from_fn(|x| $crate::ptr::read_unaligned(($ptr as *const $elem).add(x)));
281281
// NOTE: repr(simd) adds padding to make the total size a power of two.
282282
// Hence writing W to ptr might write out of bounds.
283+
type W = Simd<$elem, { $lanes * 3 }>;
283284
let w: W = W::from_array(arr);
284285

285286
let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 3, 0>());

0 commit comments

Comments
 (0)