Re: Is je more effective than jg
- From: leon800219@xxxxxxxxx
- Date: 26 Nov 2006 18:17:06 -0800
"leon800219@xxxxxxxxx 写道:
"
Hi all:When I disassembled the above C code the asm I got:
I wonder is jne more effective than jbe, if so why?
The statement:
for(i=0;i<=10;++i)
{
}
seems slower than:
for(i=0;i!=10;++i)
{
}
?
; 9 : int i;
; 10 : for(i=0;i<=10;++i)
mov DWORD PTR _i$[ebp], 0
jmp SHORT $LN6@wmain
$LN5@wmain:
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
$LN6@wmain:
cmp DWORD PTR _i$[ebp], 10 ; 0000000aH
jg SHORT $LN4@wmain
; 11 : {
; 12 : ;
; 13 : }
jmp SHORT $LN5@wmain
$LN4@wmain:
; 14 :
; 15 : int j;
; 16 : for(i=0;i!=10;++i)
mov DWORD PTR _i$[ebp], 0
jmp SHORT $LN3@wmain
$LN2@wmain:
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
$LN3@wmain:
cmp DWORD PTR _i$[ebp], 10 ; 0000000aH
je SHORT $LN1@wmain
; 17 : {
; 18 : ;
; 19 : }
jmp SHORT $LN2@wmain
$LN1@wmain:
So the real difference is:
jg SHORT $LN1@wmain
and
je SHORT $LN1@wmain
Is there any performance difference? I wonder.
.
- References:
- Is je more effective than jg
- From: leon800219
- Is je more effective than jg
- Prev by Date: Is je more effective than jg
- Next by Date: Re: Is je more effective than jg
- Previous by thread: Is je more effective than jg
- Next by thread: Re: Is je more effective than jg
- Index(es):
Relevant Pages
|