This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]