SSE2 Compiler Error

…衆ロ難τιáo~ 提交于 2019-12-02 06:18:57

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1874882/sse2-compiler-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!