This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
UNLIKELY
- From: Dmitry Nadezhin <dmitry dot nadezhin at gmail dot com>
- To: libffi-discuss at sourceware dot org
- Date: Mon, 9 Jan 2012 16:38:19 +0300
- Subject: UNLIKELY
The ffi_common.h contains definitions:
#define LIKELY(x) __builtin_expect((x),1)
#define UNLIKELY(x) __builtin_expect((x),1)
I guess that the definition of UNLIKELY should be:
#define UNLIKELY(x) __builtin_expect((x),0)
Also some libraries prefer to define LIKELY like this:
#define _X_LIKELY(x) __builtin_expect(!!(x), 1)
#define __GMP_LIKELY(cond) __builtin_expect ((cond) != 0, 1)
but I'm not sure if it changes the generated code on any platform.