| 110 | // divide each signed 8-bit element by a precomputed divisor (round towards zero) |
| 111 | NPY_FINLINE npyv_s16 npyv_divc_s16(npyv_s16 a, const npyv_s16x3 divisor); |
| 112 | NPY_FINLINE npyv_s8 npyv_divc_s8(npyv_s8 a, const npyv_s8x3 divisor) |
| 113 | { |
| 114 | const __m128i bmask = _mm_set1_epi32(0x00FF00FF); |
| 115 | // instead of _mm_cvtepi8_epi16/_mm_packs_epi16 to wrap around overflow |
| 116 | __m128i divc_even = npyv_divc_s16(_mm_srai_epi16(_mm_slli_epi16(a, 8), 8), divisor); |
| 117 | __m128i divc_odd = npyv_divc_s16(_mm_srai_epi16(a, 8), divisor); |
| 118 | divc_odd = _mm_slli_epi16(divc_odd, 8); |
| 119 | return npyv_select_u8(bmask, divc_even, divc_odd); |
| 120 | } |
| 121 | // divide each unsigned 16-bit element by a precomputed divisor |
| 122 | NPY_FINLINE npyv_u16 npyv_divc_u16(npyv_u16 a, const npyv_u16x3 divisor) |
| 123 | { |
nothing calls this directly
no test coverage detected