Hallo,
Im close to done with my project now (Making a software blitter with SSE2).
I first wrote the whole thing with c++ Intrinsics, but have started to rewrite it in inline assembly. It is going ok, mostly to the fact that almost every Intrinsics command maps to a assembly command. But I am having trouble with the _mm_setr command, as it consists of several ASM instructions. I have tried looking at the output from visual studio, but it is far to complex for my assembly "skills". If anyone has time, I would really appreciate some input on how to do the following:
Convert this instruction into ASM:
Code:
__m128i screenRed= _mm_setr_epi16( screenDataPnt[2], screenDataPnt[6], screenDataPnt[10], screenDataPnt[14],
screenDataPnt[18], screenDataPnt[22], screenDataPnt[26], screenDataPnt[30]);
Here is the visual studio output:
Code:
mov ecx, DWORD PTR _screenDataPnt$[ebp]
movzx dx, BYTE PTR [ecx+30]
mov eax, DWORD PTR _screenDataPnt$[ebp]
movzx cx, BYTE PTR [eax+26]
mov eax, DWORD PTR _screenDataPnt$[ebp]
movzx ax, BYTE PTR [eax+22]
mov esi, DWORD PTR _screenDataPnt$[ebp]
movzx si, BYTE PTR [esi+18]
mov edi, DWORD PTR _screenDataPnt$[ebp]
movzx di, BYTE PTR [edi+14]
mov WORD PTR tv510[ebp], di
mov edi, DWORD PTR _screenDataPnt$[ebp]
movzx di, BYTE PTR [edi+10]
mov WORD PTR tv512[ebp], di
mov edi, DWORD PTR _screenDataPnt$[ebp]
movzx di, BYTE PTR [edi+6]
mov WORD PTR tv514[ebp], di
mov edi, DWORD PTR _screenDataPnt$[ebp]
movzx di, BYTE PTR [edi+2]
movzx edx, dx
movd xmm0, edx
movzx ecx, cx
movd xmm1, ecx
movzx edx, ax
movd xmm2, edx
movzx eax, si
movd xmm3, eax
mov cx, WORD PTR tv510[ebp]
movzx edx, cx
movd xmm4, edx
mov ax, WORD PTR tv512[ebp]
movzx ecx, ax
movd xmm5, ecx
mov dx, WORD PTR tv514[ebp]
movzx eax, dx
movd xmm6, eax
movzx ecx, di
movd xmm7, ecx
punpcklwd xmm7, xmm3
punpcklwd xmm5, xmm1
punpcklwd xmm7, xmm5
punpcklwd xmm6, xmm2
punpcklwd xmm4, xmm0
punpcklwd xmm6, xmm4
punpcklwd xmm7, xmm6
movdqa XMMWORD PTR $T19310[ebp], xmm7
movdqa xmm0, XMMWORD PTR $T19310[ebp]
movdqa XMMWORD PTR _screenRed$19309[ebp], xmm0
Thanks for your time