Skip to content

Commit

Permalink
Fix: Equality check on NEON (#197)
Browse files Browse the repository at this point in the history
The `vmaxvq_u8` should be replaced with `vminvq_u8` 
to make the `sz_equal_neon` function actually work.
  • Loading branch information
mdx1358 authored Nov 30, 2024
1 parent 2af873a commit 705fb5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/stringzilla/stringzilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -5818,7 +5818,7 @@ SZ_PUBLIC sz_bool_t sz_equal_neon(sz_cptr_t a, sz_cptr_t b, sz_size_t length) {
a_vec.u8x16 = vld1q_u8((sz_u8_t const *)a);
b_vec.u8x16 = vld1q_u8((sz_u8_t const *)b);
uint8x16_t cmp = vceqq_u8(a_vec.u8x16, b_vec.u8x16);
if (vmaxvq_u8(cmp) != 255) { return sz_false_k; } // Check if all bytes match
if (vminvq_u8(cmp) != 255) { return sz_false_k; } // Check if all bytes match
}

// Handle remaining bytes
Expand Down

0 comments on commit 705fb5e

Please sign in to comment.