This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
[cygnus.project.sid] branch probability hinting
- To: tromey at redhat dot com
- Subject: [cygnus.project.sid] branch probability hinting
- From: Andrew Haley <aph at redhat dot com>
- Date: Thu, 1 Mar 2001 09:23:00 +0000 (GMT)
- Cc: Java Discuss List <java at gcc dot gnu dot org>
- References: <87y9uq5p7v.fsf@creche.redhat.com>
Tom Tromey writes:
> I've always thought the __builtin_expect code in libgcj was a bit
> ugly. I find it hard to read and understand.
>
> I think we ought to adopt macros like the appended.
I think the macros should be used in parens:
if UNLIKELY(error)
is non-idiomatic C.
if (UNLIKELY(error))
is better IMO. Otherwise this is a good idea; I've never liked the
builtin_expect syntax much.
Also please everyone note that the compiler already knows that
if (p == NULL)
is unlikely, so let's not obfuscate our code unnecessarily.
Andrew.