SSE2编译器错误 [英] SSE2 Compiler Error
问题描述
我试图闯入SSE2和尝试了以下示例程序:
I'm trying to break into SSE2 and tried the following example program:
#include "stdafx.h"
#include <emmintrin.h>
int main(int argc, char* argv[])
{
__declspec(align(16)) long mul; // multiply variable
__declspec(align(16)) int t1[100000]; // temporary variable
__declspec(align(16)) int t2[100000]; // temporary variable
__m128i mul1, mul2;
for (int j = 0; j < 100000; 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
muludq xmm0, xmm1
movdqa mul2, xmm0
add eax, 16
cmp eax, 100000
jnge label
}
return 0;
}
和得到以下警告和错误:
And get the following warnings and errors:
警告C4405:'XMM0':标识符是保留字
warning C4405: 'xmm0' : identifier is reserved word
错误C2400:在运code'内联汇编语法错误;发现XMM0
error C2400: inline assembler syntax error in 'opcode'; found 'xmm0'
我试图寻找可能的原因,但最谁分享我的使用问题的Visual C ++ 6.0,而我使用Visual C ++ 8.0的人。
I tried searching for possible causes but most of the people who share my issues used Visual C++ 6.0, whereas I use Visual C++ 8.0.
有什么建议?
推荐答案
好吧错误消失,如果你改变
Well the error goes away if you change
muludq xmm0, xmm1
到
pmuludq xmm0, xmm1
你确定你不只是错过的p呢?
Are you sure you didn't just miss a p there?
编辑:其实IM pretty确定你做了,因为我从来没有听说过muludq的。事实上,我与mcow替换了它(我知道不存在),并得到了同样的错误。
In fact im pretty definite you did because I've never heard of muludq. In fact i replaced it with mcow (which i KNOW doesn't exist) and got the same error.
这篇关于SSE2编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!