[SIMD] Question

Started by
8 comments, last by Austrian Coder 20 years, 9 months ago
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
Advertisement
have you included xmmintrin.h in your file? (this is requiered for SSE support)
Stéphane RossGame Gurus Entertainment
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)
you included mmintrin.h? this is for mmx support i think... theres a difference between xmmintrin and mmintrin
Stéphane RossGame Gurus Entertainment
no you don´t need xmmintrin.h that´s for the intrinsics functions not inline assembler. is d and s pointers?
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;
}
}
that will compile just fine for me, are you sure you have processor pack installed?
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?
no it should work with console, I have vs6sp5 and vcpp5 installed
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.
"Coding math tricks in asm is more fun than Java"

This topic is closed to new replies.

Advertisement