简体   繁体   中英

Why does x86 have the redundant JNGE instruction?

On page 3-431 of the Intel instruction set reference , two different instructions are mentioned:

7C cb  JL rel8   Jump short if less (SF ≠ OF).
7C cb  JNGE rel8 Jump short if not greater or equal (SF ≠ OF).

What is the reasoning behind having two names for the same instruction? Is there any instance where it matters whether I use JL or JNGE ?

It's just to make code more readable in case one or the other matches your intention better. As you quoted, the machine code is the same, and ultimately that's what the processor will execute. As such, it won't know whether you used JL or JNGE . All the relations have their negated name too.

There are other duplicates that illustrate the readability point a little better, for example JE and JZ . You'd normally use JE after a comparison, and JZ otherwise. Similarly you have JB and JC .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM