Skip to content
Open
Changes from 1 commit
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: 2 additions & 0 deletions crates/core_simd/src/swizzle_dyn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ unsafe fn avx2_pshufb512(bytes: Simd<u8, 64>, idxs: Simd<u8, 64>) -> Simd<u8, 64

let z0 = half_swizzler(bytes0, bytes1, idxs0);
let z1 = half_swizzler(bytes0, bytes1, idxs1);

// SAFETY: Concatenation of two 32-element vectors to one 64-element vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this says what your doing, what it should say is why it's safe to use transmute like this. e.g.:
[Simd<u8, 32>; 2] and Simd<u8, 64> both have the same size (64) and no padding bytes, so transmuting is safe

let z = mem::transmute::<[Simd<u8, 32>; 2], Simd<u8, 64>>([z0.into(), z1.into()]);

idxs.simd_lt(high).select(z, Simd::splat(0u8))
Expand Down
Loading