Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Compare functions

swoncen
Beginner
188 Views
Hi,
I hope this is the right forum because I couldn't find any SIMD subforum here.
My problem:
I want to optimize the following code with SSE2 (_mm_cmpgt_epi8):
[bash]int16 kr = 16;
for(x = 0; x < xr; x++)
{
	if(*inPtr > this->m_SaturationMin)
		col--;
	else
		col = kr-1;
	inPtr++;
}[/bash]
col is an array in which resulting indices are stored, inPtr is an image, this->m_SaturationMin is an integer value (0 most of the time). I thought I could use_mm_cmpgt_epi8 (http://msdn.microsoft.com/en-us/library/wf45zt2b(v=VS.80).aspx) where a is the pointer from inPtrand bis this->m_SaturationMin. The output would be 255 or 0 for the elements and I would need col-- and kr-1 as output. I had some ideas to work around with shifting bits and such, but in the end it wouldn't be much of a performance increase. Is there any function which does something similar what I need (SSE,SSE2,SSE3,SSE4)? I don't own the ipp, but maybe someone knows a function which does exactly what I described - then I could read in the manual how to do it.
Thanks in advance.
Swoncen
0 Kudos
1 Reply
Naveen_G_Intel
Employee
188 Views

Hi Swoncen,

To discuss about CPU instruction, we have a separate forum Intel AVX and CPU Instructions , please submit it there, this forum is only for Intel Performance library(Intel IPP) related discussion.

Thank you,

Naveen Gv

0 Kudos
Reply