Archived

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

Austrian Coder

[SIMD] Question

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
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
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
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