• Advertisement

Archived

This topic is now archived and is closed to further replies.

[SIMD] Question

This topic is 5345 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have here this code:
__asm {
	mov edi,d;
	mov esi,s;
	mov ecx,_size;
	shr ecx,4;
lx:
	movaps xmm0, [esi];
	lea esi,[esi+16];
	movaps [edi],xmm0;
	lea edi,[edi+16];
	dec ecx;
	jnz lx;
}
Copy _size bytes form s to d. But i get some errors. error C2400: Inline-Assembler: Syntaxerror at 'Opcode'; 'xmm0' found (movaps xmm0, [esi] error C2400: Inline-Assembler: Syntaxfehler in 'Opcode'; '[' found (movaps [edi],xmm0 I am using VC++ 6.0 SP5 + Processor Pack What i am making wrong? Thanks, Christian

Share this post


Link to post
Share on other sites
Advertisement
have you included xmmintrin.h in your file? (this is requiered for SSE support)

Share this post


Link to post
Share on other sites
Now i get these errors:

C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\mmintrin.h(29): error C2146: Syntax error: Missing '';'' before designators '' _ m_from_int''
C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\mmintrin.h(29) m_from_int: error C2501: '' __m64 '': Missing storage class or type designator
C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\mmintrin.h(29): fatal error C1004: Unexpected file end found

(Translated form german to englisch via altavista)

Share this post


Link to post
Share on other sites
you included mmintrin.h? this is for mmx support i think... theres a difference between xmmintrin and mmintrin

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
no you don´t need xmmintrin.h that´s for the intrinsics functions not inline assembler. is d and s pointers?

Share this post


Link to post
Share on other sites
void SSE_16bytes_CopyMem(unsigned char* d, unsigned char* s, int _size)
{
__asm {
mov edi,d;
mov esi,s;
mov ecx,_size;
shr ecx,4;
lx:
movaps xmm0, [esi];
lea esi,[esi+16];
movaps [edi],xmm0;
lea edi,[edi+16];
dec ecx;
jnz lx;
}
}

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
that will compile just fine for me, are you sure you have processor pack installed?

Share this post


Link to post
Share on other sites
Yes i have installed the processor pack. I have reisntalled it now, but the same erros.
Should I use the beta version of the processor pack? Must i create an win32 app, not console, to use SSE?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
no it should work with console, I have vs6sp5 and vcpp5 installed

Share this post


Link to post
Share on other sites
forgive me if I am wrong, and it won''t solve your problem but why use lea instead of simply add ?

I wonder if two consecutive address taking on esi and edi wont slow the code.

Share this post


Link to post
Share on other sites

  • Advertisement