SSE2编译器错误
我试图闯入 SSE2 并尝试了以下示例程序:
#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;
}
并获取以下警告和错误:
警告 C4405:“xmm0”:标识符是保留字
错误 C2400:“操作码”中内联汇编器语法错误;找到“xmm0”
我尝试寻找可能的原因,但大多数分享我的问题的人都使用 Visual C++ 6.0,而我使用 Visual C++ 8.0。
有什么建议吗?
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:
warning C4405: 'xmm0' : identifier is reserved word
error C2400: inline assembler syntax error in 'opcode'; found 'xmm0'
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.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误就会消失。
那么,如果您更改为
“您确定您没有错过那里的 ap 吗?”,
编辑:事实上,我很确定你这样做了,因为我从未听说过 muludq。事实上,我用 mcow 替换了它(我知道它不存在)并得到了相同的错误。
Well the error goes away if you change
to
Are you sure you didn't just miss a p there?
Edit: 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.