[vector] Sparse load (simple gather) of vector from array?
Lev Serebryakov
lev at serebryakov.spb.ru
Fri Mar 15 19:46:32 UTC 2019
I have (long) array of floats: `float[] data`. I have Spicies of
FloatArray, `S`. I need to create `FloatVector` with even elements (0,
2, 4, ...) set to elements from `data` array and odd elements set to
zero (`0.0f`).
So, if we use 256 bit vectors shape, it should be like this:
{data[offest+0], 0.0f, data[offest+1], 0.0f, data[offest+2], 0.0f,
data[offest+3], 0.0f}
I could load vector from array and blend it with zero vector, but it
will have wrong float data from array (like `offset+0`, `offset+2`, etc).
What is simplest way to perform such "gather" load?
--
// Black Lion AKA Lev Serebryakov
More information about the panama-dev
mailing list