Skip to content

Commit

Permalink
Simplify x86 sse load multiple of four
Browse files Browse the repository at this point in the history
Assembly comparison yielded no differences so better to prefer the one
with fewer lines of code :)
  • Loading branch information
nickbabcock committed Oct 18, 2024
1 parent e3dfd2c commit 44fd3d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/x86/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ impl SseHash {

if let Some(d) = data.get(..4) {
let last4 = i32::from_le_bytes([d[0], d[1], d[2], d[3]]);
let word2 = _mm_cvtsi32_si128(last4);
let broadcast = V2x64U::from(_mm_shuffle_epi32(word2, 0));
let broadcast = V2x64U::from(_mm_set1_epi32(last4));
ret |= broadcast & mask4;
}

Expand Down

0 comments on commit 44fd3d6

Please sign in to comment.