| 68 | |
| 69 | template<typename B, class A = std::allocator<B>> |
| 70 | mipp::Reg<B> |
| 71 | read_array(const std::vector<B, A>& array, mipp::Reg<B> r_idx, const mipp::Msk<mipp::N<B>()>& m_idx = true) |
| 72 | { |
| 73 | B idx[mipp::N<B>()], val[mipp::N<B>()]; |
| 74 | |
| 75 | const auto r_zero = mipp::Reg<B>((B)0); |
| 76 | r_idx = mipp::blend(r_idx, r_zero, m_idx); |
| 77 | r_idx.store(idx); |
| 78 | |
| 79 | for (auto j = 0; j < mipp::N<B>(); j++) |
| 80 | val[j] = array[idx[j]]; |
| 81 | |
| 82 | return mipp::Reg<B>(val); |
| 83 | } |
| 84 | |
| 85 | template<typename B, class A = std::allocator<B>> |
| 86 | void |