【发布时间】:2014-07-06 21:29:05
【问题描述】:
处理 2D 数组时的常见做法是加载一组值,然后将它们向左或向右移动,然后再将 1 个值加载到不再需要的值中。最好的方法是什么??
float arr[128][128];
for(int i = 1;i < 127;++i)
for(int j = 1;j < 127;++j)
{
__m128 top = _mm_load_ps(arr[i - 1][j]);
__m128 center = _mm_load_ps(arr[i][j]);
//...stuff
//rotate the top
top = _mm_shuffle_ps(top,top,_MM_SHUFFLE(0,3,2,1));
//how do i load another item in without insert?
【问题讨论】: