SSE2编译器错误

发布于 2024-08-14 06:42:03 字数 1088 浏览 2 评论 0原文

我试图闯入 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

享受孤独 2024-08-21 06:42:03

错误就会消失。

muludq xmm0, xmm1

那么,如果您更改为

pmuludq xmm0, xmm1

“您确定您没有错过那里的 ap 吗?”,

编辑:事实上,我很确定你这样做了,因为我从未听说过 muludq。事实上,我用 mcow 替换了它(我知道它不存在)并得到了相同的错误。

Well the error goes away if you change

muludq xmm0, xmm1

to

pmuludq xmm0, xmm1

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文