Skip to content

Commit

Permalink
update avx2 from upstream (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
arpankapoor authored Sep 21, 2024
1 parent c5a0322 commit c84f5ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xxh3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn accumulate_512_avx2(acc: &mut Acc, input: &StripeLanes, secret: &StripeLanes)
let key_vec = _mm256_loadu_si256(secret[idx].as_ptr() as _);
let data_key = _mm256_xor_si256(data_vec, key_vec);

let data_key_lo = _mm256_shuffle_epi32(data_key, _mm_shuffle(0, 3, 0, 1));
let data_key_lo = _mm256_srli_epi64(data_key, 32);
let product = _mm256_mul_epu32(data_key, data_key_lo);

let data_swap = _mm256_shuffle_epi32(data_vec, _mm_shuffle(1,0,3,2));
Expand Down Expand Up @@ -443,7 +443,7 @@ fn scramble_acc_avx2(acc: &mut Acc, secret: &StripeLanes) {
let key_vec = _mm256_loadu_si256(secret[idx].as_ptr() as _);
let data_key = _mm256_xor_si256(data_vec, key_vec);

let data_key_hi = _mm256_shuffle_epi32(data_key, _mm_shuffle(0, 3, 0, 1));
let data_key_hi = _mm256_srli_epi64(data_key, 32);
let prod_lo = _mm256_mul_epu32(data_key, prime32);
let prod_hi = _mm256_mul_epu32(data_key_hi, prime32);
xacc.add(idx).write(_mm256_add_epi64(prod_lo, _mm256_slli_epi64(prod_hi, 32)));
Expand Down

0 comments on commit c84f5ed

Please sign in to comment.