该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
全角 换 掉
-----------------------
static __declspec(naked) void great_ansi_counter(const char*)
{
__asm
{
mov eax,dword ptr[esp+4] ; source_pointer to poll (will increase)
mov ebx,eax ; based pointer to save
xorps xmm1,xmm1 ; 0x0000 0000 0000 0000 0000 0000 0000 0000
pxor mm1,mm1
sse_main_loop:
// prefetchnta [eax] ; cache ~$
movapd xmm0,xmmword ptr[eax] ; 128 bit mem
add eax,16 ; +16 until zero (double qword)
pcmpeqb xmm0,xmm1 ; 0xNNNN NNNN NNNN NNNN NNNN NNNN NNNN NNNN ~$
packssdw xmm0,xmm0 ; compress
packssdw xmm0,xmm0 ; compress again
movd edx,xmm0 ; zero ?
test edx,edx ; if edx is*t zero jmp main_loop
je sse_main_loop ;
sub eax,16
mmx_main_loop:
movq mm0,mmword ptr[eax]
add eax,8
pcmpeqb mm0,mm1
packssdw mm0,mm0
movd edx,mm0
test edx,edx
je mmx_main_loop
extra_loop:
dec eax
cmp [eax],0
je extra_loop
sub eax,ebx
inc eax
ret
}
}