| 485 | #endif |
| 486 | |
| 487 | SZ_PUBLIC sz_bool_t sz_equal_sve(sz_cptr_t a, sz_cptr_t b, sz_size_t length) { |
| 488 | // Determine the number of bytes in an SVE vector. |
| 489 | sz_size_t const vector_bytes = svcntb(); |
| 490 | sz_size_t progress = 0; |
| 491 | do { |
| 492 | svbool_t progress_vec = svwhilelt_b8((sz_u64_t)progress, (sz_u64_t)length); |
| 493 | svuint8_t a_vec = svld1(progress_vec, (sz_u8_t const *)(a + progress)); |
| 494 | svuint8_t b_vec = svld1(progress_vec, (sz_u8_t const *)(b + progress)); |
| 495 | // Compare: generate a predicate marking lanes where a!=b |
| 496 | svbool_t not_equal_vec = svcmpne(progress_vec, a_vec, b_vec); |
| 497 | if (svptest_any(progress_vec, not_equal_vec)) return sz_false_k; |
| 498 | progress += vector_bytes; |
| 499 | } while (progress < length); |
| 500 | return sz_true_k; |
| 501 | } |
| 502 | |
| 503 | SZ_PUBLIC sz_ordering_t sz_order_sve(sz_cptr_t a, sz_size_t a_length, sz_cptr_t b, sz_size_t b_length) { |
| 504 | //! Before optimizing this, read the "Operations Not Worth Optimizing" in Contributions Guide: |
no outgoing calls
no test coverage detected
searching dependent graphs…