On Sun, Apr 27, 2003 at 09:56:30PM -0400, Frank Ch. Eigler wrote:
- The call to __builtin_expect was using BIT_IOR_EXPR instead of
TRUTH_ORIF_EXPR. This prevents the short-circuit evaluation of
the predicate, producing slightly slower code. [...]
Are you sure about that? Short-circuit evaluation usually requires
additional branches. I recall experimenting with this early on, and
it made runs slower, not faster.
I had tested the attached on x86 and found the TRUTH_ORIF version
faster than BIT_IOR by about 33%.
But now I've also tested it on x86_64 and PPC and found the exact
opposite (on x86-64 BIT_IOR is 47% faster, on PPC, BIT_IOR is 17%
faster).
So, that's 2 out of 3 and you're right that the code is less
jumpy. I'll revert to using BIT_IOR.
Diego.
<a.c>