performance - convert memcpy() code from x86 to x64 platform -
this code memcpy() on x86 platforms . need memcpy() on x64 platform .
_asm { mov esi, src mov edi, dest mov ecx, nbytes shr ecx, 6 // 64 bytes per iteration loop1: movq mm1, 0[esi] // read in source data movq mm2, 8[esi] movq mm3, 16[esi] movq mm4, 24[esi] movq mm5, 32[esi] movq mm6, 40[esi] movq mm7, 48[esi] movq mm0, 56[esi] movq 0[edi], mm1 // write destination movq 8[edi], mm2 movq 16[edi], mm3 movq 24[edi], mm4 movq 32[edi], mm5 movq 40[edi], mm6 movq 48[edi], mm7 movq 56[edi], mm0 add esi, 64 add edi, 64 dec ecx jnz loop1 emms }
i have no knowledge of x64 assembly language . how convert code x86 x64 ?
i suppose replacing esi , edi rsi , rdi should trick. although not become faster (or fast). other pointers, x64 backwards compatible x86.
in general better make c loop or use default memcpy. generate better code.
Comments
Post a Comment