Re: Is je more effective than jg




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)
{
}
?

int
main()
{
const int count = 10;
int i;

for ( i = 0; i <= count - 1; i++ ) {}
for ( i = 0; i != count; i++ ) {}

return 0;
}

$ cc -S -Os -momit-leaf-frame-pointer test.c

$ cc --version
cc (GCC) 3.3.5 (propolice)

main:
movl $9, %eax
..L6:
decl %eax
jns .L6 # <-- 1
xorl %eax, %eax
..L11:
incl %eax
cmpl $10, %eax # <-- 2
jne .L11 # <-- 2
xorl %eax, %eax
ret



--
/ qo |) :@=N%_g=v=a=g_eD_e=c()=d=8! =%!Gn@8're. w8in/ad
\ _x/ , ;h-%-a'hA'H4,X0'Xo~xo~xO,R`-%EXp01ITed: *-7/+eh
/ | ng `-%__%--'__%--'__%--~__%--^%B`/$qV3r[o; &GooMee
L o_O http://tech.groups.yahoo.com/group/opRWTng O_o L"EnOF"
.



Relevant Pages