Skip to content

Commit

Permalink
Fix tests on x86
Browse files Browse the repository at this point in the history
  • Loading branch information
ogxd committed Oct 29, 2023
1 parent ac6e081 commit 2a875c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/gxhash/platform/x86_128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub unsafe fn get_partial(p: *const state, len: isize) -> state {
let partial_vector: state;
// Safety check
if check_same_page(p) {
let indices = _mm_setr_epi8(
let indices = _mm_set_epi8(
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
);

Expand All @@ -33,7 +33,7 @@ pub unsafe fn get_partial(p: *const state, len: isize) -> state {
partial_vector = get_partial_safe(p as *const u8, len as usize)
}
// Prevents padded zeroes to introduce bias
_mm_add_epi32(partial_vector, _mm_set1_epi32(len as i32))
_mm_add_epi8(partial_vector, _mm_set1_epi8(len as i8))
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/gxhash/platform/x86_256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub unsafe fn get_partial(p: *const state, len: isize) -> state {
let partial_vector: state;
// Safety check
if check_same_page(p) {
let indices = _mm256_setr_epi8(
let indices = _mm256_set_epi8(
31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
);

Expand Down

0 comments on commit 2a875c5

Please sign in to comment.