the logical xor operator!

Karl Heuer karl at haddock.ISC.COM
Tue Jun 28 03:50:16 AEST 1988


In article <3254 at rpp386.UUCP> jfh at rpp386.UUCP (The Beach Bum) writes:
>in particular, i believe (a == 0)^(b == 0) most likely can't be as well
>optimized as (a == 0)!=(b == 0).

Nonsense.  "!=" and "^" produce the same result when both operands are
normalized booleans; therefore a compiler which detects this situation is free
to generate its favorite logical-xor construct for both.  In practice, few if
any compilers bother to do this.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.std.c mailing list