[ a newby question about vectorized shuffling / permutation ]
Denis Gabaydulin
gabaden at gmail.com
Wed Jun 2 11:04:28 UTC 2021
Hi, folks!
Have a newbie question about the API.
I'm trying to explore a new and shiny vector API with simple but useful
examples.
One of that is to build a SIMD version to find any intersection of two
sorted lists.
E.g.
hasIntersection([1, 3, 4, 10], [2, 6, 6, 11]) => false
hasIntersection([1, 3, 4, 10], [2, 3, 6, 11]) => true
A mental model of this algorithm which I have:
1). to get a part of an array one
2). compare it n-times which corresponding part of an array two.
3). each time we need to compare two parts of arrays we need to shuffle
(permutate) a left part by a mask. E.g. 1, 3, 4, 10 -> 10, 1, 3, 4
4). if one of a number is the same, return true, otherwise, move.
In SIMD instructions looks like I need two major things.
1). vectorized comparison instruction
2). vectorized shuffle instruction.
The first one, I can see in the printed asm.
compare in API -> vpcmpeqd
The question, which function of the vector API should I use to getting
something like _mm_shuffle_epi32 ?
More information about the panama-dev
mailing list