Re: Is je more effective than jg




<leon800219@xxxxxxxxx> wrote in message
news:1164604928.778784.112080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

"Ratch дµÀ£º
"
<leon800219@xxxxxxxxx> wrote in message
news:1164592812.095934.170610@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all:

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


In the subject of this message you ask about JE. In the body of this
message you ask about JBE. So I am confused. Anyway the question is what
is "effective". JE,JBE, and JG are three different instructions that do
different things. So is addition more "effective" than multiplication or
subtraction? Ratch
Sorry for confusion my question is on JE and JG, by effective I mean
which instruction less time and resouce consuming, since they act like
same functionality in
for loop. Is that make sense?

JE/JNE has to check only one flag (ZF), whereas JG/JLE has to check two
flags (ZF and SF). If the CPU does not have the hardware to check both
flags simultaneously, then JG will be the slower instruction. Ratch


.



Relevant Pages

  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... I ask why WOULD it be slower? ... the extra instruction is small compared to the time to execute the move. ... Micro Focus' efficiency advice is exactly the same on every platform, ... becomes zero, rather than incrementing the counter from zero to n. ...
    (comp.lang.cobol)
  • Re: Cobol Myth Busters
    ... Of course, whether adding 5 is slower, or faster, than adding 1 is completely ... Or he was thinking of a LOOP instruction. ... but it gives an insight into optimization. ... Facts incorrectly interpreted are less useful than an absence of facts. ...
    (comp.lang.cobol)
  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... can be SLOWER than a machine language COMPARE instruction that ... > necessarily be presumed *slower* than the case in which the comparison was ... (display the time, including milliseconds, if available, using whatever ... COBOL construct is best on your machine) ...
    (comp.lang.cobol)
  • Re: IF NOTs
    ... a" will will slower than "FALSE a". ... case (executing x) would be slower than the "TRUE b" case (also ... conditional jump instruction. ... zero as needed. ...
    (comp.lang.forth)
  • Re: 80386 support in -current
    ... So, indeed, xchg is *lot* slower on p4 in non-SMP case than cmpxchgl, I ... functions in atomic.h to use cmpxchg instead of xchg, ... cmpxchgb %b1,%0; jnz 1b"); ... >>particular instruction which was introduced with the 486 and must be ...
    (freebsd-current)