Re: What is faster: jne or jge?

Stefan Monnier (monnier+lists/linux/kernel/news/@TEQUILA.SYSTEMSZ.CS.YALE.EDU)
31 May 1998 18:42:13 -0400


Tigran Aivazian <tigran@aivazian.demon.co.uk> writes:
> This: if (some_syscall() < 0) {
[...]
> Or this: if (some_syscall() == -1) {
[...]
> But what *is* faster?

In general, it's a good idea to disregard "what is faster" when coding such
things (obviously the speed difference is not going to be enormous and the mere
fact that you don't know indicates that it's probably going to change from one
chip to another and even from one compiler to another).

Instead, think about the actual meaning. Even if the spec claims that the call
only returns a non-negative result or -1, think of what would/should happen if
it returned -4 instead.

Stefan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu