Move likely() definitions to dyngen-exec.h, they are only used in the CPU

core where it's most useful (give a stronger hint to gcc4)
This commit is contained in:
gbeauche 2006-05-02 19:33:10 +00:00
parent b9b1fd4e22
commit e5051464bf
2 changed files with 16 additions and 15 deletions

View File

@ -166,21 +166,6 @@ typedef int64 intptr;
#error "Unsupported size of pointer"
#endif
/**
* Helper macros to annotate likely branch directions
**/
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif
#ifndef likely
#define likely(x) (x)
#endif
#ifndef unlikely
#define unlikely(x) (x)
#endif
/**
* Helper functions to byteswap data
**/

View File

@ -163,4 +163,20 @@ extern int __op_jmp0, __op_jmp1;
#define ASM_LONG ".long"
#endif
// Helper macros to annotate likely branch directions
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#ifndef likely
#define likely(x) __builtin_expect((x),1)
#endif
#ifndef unlikely
#define unlikely(x) __builtin_expect((x),0)
#endif
#endif
#ifndef likely
#define likely(x) (x)
#endif
#ifndef unlikely
#define unlikely(x) (x)
#endif
#endif /* DYNGEN_EXEC_H */