| 2401 | #if NPY_SIMD |
| 2402 | /* Count the zero bytes between `*d` and `end`, updating `*d` to point to where to keep counting from. */ |
| 2403 | NPY_FINLINE NPY_GCC_OPT_3 npyv_u8 |
| 2404 | count_zero_bytes_u8(const npy_uint8 **d, const npy_uint8 *end, npy_uint8 max_count) |
| 2405 | { |
| 2406 | const npyv_u8 vone = npyv_setall_u8(1); |
| 2407 | const npyv_u8 vzero = npyv_zero_u8(); |
| 2408 | |
| 2409 | npy_intp lane_max = 0; |
| 2410 | npyv_u8 vsum8 = npyv_zero_u8(); |
| 2411 | while (*d < end && lane_max <= max_count - 1) { |
| 2412 | // we count zeros because `cmpeq` cheaper than `cmpneq` for most archs |
| 2413 | npyv_u8 vt = npyv_cvt_u8_b8(npyv_cmpeq_u8(npyv_load_u8(*d), vzero)); |
| 2414 | vt = npyv_and_u8(vt, vone); |
| 2415 | vsum8 = npyv_add_u8(vsum8, vt); |
| 2416 | *d += npyv_nlanes_u8; |
| 2417 | lane_max += 1; |
| 2418 | } |
| 2419 | return vsum8; |
| 2420 | } |
| 2421 | |
| 2422 | NPY_FINLINE NPY_GCC_OPT_3 npyv_u16x2 |
| 2423 | count_zero_bytes_u16(const npy_uint8 **d, const npy_uint8 *end, npy_uint16 max_count) |
no outgoing calls
no test coverage detected