| 721 | // uses vector as indexes into a table |
| 722 | // that contains 32 elements of float32. |
| 723 | NPY_FINLINE npyv_f32 npyv_lut32_f32(const float *table, npyv_u32 idx) |
| 724 | { |
| 725 | const int i0 = _mm_cvtsi128_si32(idx); |
| 726 | #ifdef NPY_HAVE_SSE41 |
| 727 | const int i1 = _mm_extract_epi32(idx, 1); |
| 728 | const int i2 = _mm_extract_epi32(idx, 2); |
| 729 | const int i3 = _mm_extract_epi32(idx, 3); |
| 730 | #else |
| 731 | const int i1 = _mm_extract_epi16(idx, 2); |
| 732 | const int i2 = _mm_extract_epi16(idx, 4); |
| 733 | const int i3 = _mm_extract_epi16(idx, 6); |
| 734 | #endif |
| 735 | return npyv_set_f32(table[i0], table[i1], table[i2], table[i3]); |
| 736 | } |
| 737 | NPY_FINLINE npyv_u32 npyv_lut32_u32(const npy_uint32 *table, npyv_u32 idx) |
| 738 | { return npyv_reinterpret_u32_f32(npyv_lut32_f32((const float*)table, idx)); } |
| 739 | NPY_FINLINE npyv_s32 npyv_lut32_s32(const npy_int32 *table, npyv_u32 idx) |
no outgoing calls
no test coverage detected