Vector Class Discussion

Searching through int array with SSE2
Author: Agner Date: 2014-04-09 10:52
You can use
if (horizontal_or(c))
to check if any element of c is true. Then use
int index = _mm_movemask_epi8(c);
to check which elements of c are true. index will have one bit for each byte of c that is true, i.e. 4 bits for each dword. Maybe I will make a function for this in a future version.
 
thread Searching through int array with SSE2 new - Christoph Rupp - 2014-04-09
reply Searching through int array with SSE2 - Agner - 2014-04-09
last reply Searching through int array with SSE2 new - Agner - 2014-04-23