Skip to content

Commit

Permalink
fix: simd binary ip for 32bit (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy authored Dec 3, 2024
1 parent 1007380 commit 6fd34f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ pub unsafe fn binary_dot_product(lhs: &[u64], rhs: &[u64]) -> u32 {
_mm256_castsi256_si128(sum256),
_mm256_extracti128_si256(sum256, 1),
);
sum += _mm_cvtsi128_si64(_mm_add_epi64(xa, _mm_shuffle_epi32(xa, 78))) as u32;
// this assumes the length is less than 2 ** 31
sum += _mm_cvtsi128_si32(_mm_add_epi64(xa, _mm_shuffle_epi32(xa, 78))) as u32;

sum
}

0 comments on commit 6fd34f0

Please sign in to comment.