Re: Fastcode CompareMem B&V 1.0
- From: "Aleksandr Sharahov" <alsha-on-mail333.com>
- Date: Fri, 29 Apr 2005 01:19:27 +0400
HI Dennis,
You can remove CompareMem_Sha_IA32_1_a.
CompareMem_Sha_IA32_3_a is a little faster.
--
regards
Aleksandr
function CompareMem_Sha_IA32_3_a(P1, P2: pointer; Length: integer): boolean;
asm
sub edx, eax
add ecx, -8
push ebx
jl @Byte
mov ebx, [eax+edx]
cmp ebx, [eax]
jne @Ret0
add ecx, eax
add eax, 4
and eax, -4
sub ecx, eax
jl @Byte
@DwordLoop:
mov ebx, [eax+edx]
cmp ebx, [eax]
jne @Ret0
mov ebx, [eax+edx+4]
cmp ebx, [eax+4]
jne @Ret0
add eax, 8
add ecx, -8
jge @DwordLoop
@Byte:
add ecx, 8
jle @Ret1
@ByteLoop:
movzx ebx, [eax+edx]
cmp bl, [eax]
jne @Ret0
add eax, 1
add ecx, -1
jg @ByteLoop
@Ret1:
mov eax, 1
pop ebx
ret
@Ret0:
xor eax, eax
pop ebx
end;
.
- Follow-Ups:
- Re: Fastcode CompareMem B&V 1.0
- From: Dennis
- Re: Fastcode CompareMem B&V 1.0
- References:
- Fastcode CompareMem B&V 1.0
- From: Dennis
- Re: Fastcode CompareMem B&V 1.0
- From: Aleksandr Sharahov
- Fastcode CompareMem B&V 1.0
- Prev by Date: Re: Fastcode Rules
- Next by Date: Re: Fastcode CompareMem B&V 1.0
- Previous by thread: Re: Fastcode CompareMem B&V 1.0
- Next by thread: Re: Fastcode CompareMem B&V 1.0
- Index(es):
Relevant Pages
|