Vote count:
0
I am not getting the same results when I separate the asm code http://ift.tt/1MgVHYa into it's own asm file and calling the function via external "C" in C++.
What I'm doing to splitthe inline is removing everything in the __asm
section and replacing it with buildFinalMask_SSE2_ASM(s1p, s2p, m1p, dstp, s1_pitch, s2_pitch, m1_pitch, dst_pitch, width, height, thresh128);
This function is defined as a extern "C" to link to the procedure found in the asm file:
buildFinalMask_SSE2_ASM proc s1p:dword,s2p:dword,m1p:dword,dstp:dword,s1_pitch:dword,s2_pitch:dword,m1_pitch:dword,dst_pitch:dword,width_:dword,height:dword,thresh:qword
public buildFinalMask_SSE2_ASM
mov eax,s1p
mov ebx,s2p
mov edx,m1p
mov esi,dstp
mov edi,width_
movdqu xmm4,oword ptr thresh
pxor xmm5,xmm5
yloop:
xor ecx,ecx
align 16
xloop:
movdqa xmm0,[eax+ecx]
movdqa xmm1,[ebx+ecx]
movdqa xmm2,xmm0
psubusb xmm0,xmm1
psubusb xmm1,xmm2
por xmm0,xmm1
psubusb xmm0,xmm4
pcmpeqb xmm0,xmm5
pand xmm0,[edx+ecx]
movdqa [esi+ecx],xmm0
add ecx,16
cmp ecx,edi
jl xloop
add eax,s1_pitch
add ebx,s2_pitch
add edx,m1_pitch
add esi,dst_pitch
dec height
jnz yloop
ret
buildFinalMask_SSE2_ASM endp
The procedure itself provides different results each time it is ran despite being a direct copy of the code used inline and I'm unsure as to what changes would be needed in order to get the same results it had previously. Any help in the matter would be much appreciated!
asked 44 secs ago
Splitting inline assembly provides random results
Aucun commentaire:
Enregistrer un commentaire