的我有以下代碼找到我嘗試用SSE3內在矢量化它的最大值SSE3內部函數:如何找到最大的一個大陣花車
int length = 2000;
float *data;
// data is allocated and initialized
float max = 0.0;
for(int i = 0; i < length; i++)
{
if(data[i] > max)
{
max = data;
}
}
,但我有種擊中我應該怎麼做比較。
int length = 2000;
float *data;
// data is allocated and initialized
float max = 0.0;
// for time being just assume that length is always mod 4
for(int i = 0; i < length; i+=4)
{
__m128 a = _mm_loadu_ps(data[i]);
__m128 b = _mm_load1_ps(max);
__m128 gt = _mm_cmpgt_ps(a,b);
// Kinda of struck on what to do next
}
任何人都可以提供一些想法。
如果我們看代碼的實際意思是,我們看到它與http://stackoverflow.c相同om/questions/9877700 /正在獲取最大價值的m128i-vector-with-sse – 2013-03-06 04:30:40