MCPcopy Create free account
hub / github.com/numpy/numpy / npyv_lut16_f64

Function npyv_lut16_f64

numpy/core/src/common/simd/vec/memory.h:685–697  ·  view source on GitHub ↗

uses vector as indexes into a table that contains 16 elements of float64.

Source from the content-addressed store, hash-verified

683// uses vector as indexes into a table
684// that contains 16 elements of float64.
685NPY_FINLINE npyv_f64 npyv_lut16_f64(const double *table, npyv_u64 idx)
686{
687#ifdef NPY_HAVE_VX
688 const unsigned i0 = vec_extract((npyv_u32)idx, 1);
689 const unsigned i1 = vec_extract((npyv_u32)idx, 3);
690#else
691 const unsigned i0 = vec_extract((npyv_u32)idx, 0);
692 const unsigned i1 = vec_extract((npyv_u32)idx, 2);
693#endif
694 npyv_f64 r = vec_promote(table[i0], 0);
695 r = vec_insert(table[i1], r, 1);
696 return r;
697}
698NPY_FINLINE npyv_u64 npyv_lut16_u64(const npy_uint64 *table, npyv_u64 idx)
699{ return npyv_reinterpret_u64_f64(npyv_lut16_f64((const double*)table, idx)); }
700NPY_FINLINE npyv_s64 npyv_lut16_s64(const npy_int64 *table, npyv_u64 idx)

Callers 2

npyv_lut16_u64Function · 0.70
npyv_lut16_s64Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected