這是一個後續到SSE2 Compiler Error
這是真正錯誤我經歷過,並通過改變_mm_malloc
聲明轉載如下爲Michael Burr建議:
在0x00415116在SO.exe未處理的異常:0000005:訪問衝突讀取 位置0xffffffff。
在行label: movdqa xmm0, xmmword ptr [t1+eax]
我試圖動態分配t1
和t2
和according to this tutorial,我用_mm_malloc
:
#include <emmintrin.h>
int main(int argc, char* argv[])
{
int *t1, *t2;
const int n = 100000;
t1 = (int*)_mm_malloc(n*sizeof(int),16);
t2 = (int*)_mm_malloc(n*sizeof(int),16);
__m128i mul1, mul2;
for (int j = 0; j < n; j++)
{
t1[j] = j;
t2[j] = (j+1);
} // set temporary variables to random values
_asm
{
mov eax, 0
label: movdqa xmm0, xmmword ptr [t1+eax]
movdqa xmm1, xmmword ptr [t2+eax]
pmuludq xmm0, xmm1
movdqa mul1, xmm0
movdqa xmm0, xmmword ptr [t1+eax]
pshufd xmm0, xmm0, 05fh
pshufd xmm1, xmm1, 05fh
pmuludq xmm0, xmm1
movdqa mul2, xmm0
add eax, 16
cmp eax, 100000
jnge label
}
_mm_free(t1);
_mm_free(t2);
return 0;
}
現在的工作有困難的錯誤:) – Jacob 2009-12-09 20:13:54