Browse Source

Add DUK_UNPREDICTABLE() placeholder

pull/1234/head
Sami Vaarala 8 years ago
parent
commit
c14832dcb2
  1. 5
      config/compilers/compiler_clang.h.in
  2. 5
      config/compilers/compiler_emscripten.h.in
  3. 1
      config/compilers/compiler_gcc.h.in
  4. 3
      config/header-snippets/compiler_fillins.h.in

5
config/compilers/compiler_clang.h.in

@ -17,6 +17,11 @@
#define DUK_USE_BRANCH_HINTS
#define DUK_LIKELY(x) __builtin_expect((x), 1)
#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
#if defined(__clang__) && defined(__has_builtin)
#if __has_builtin(__builtin_unpredictable)
#define DUK_UNPREDICTABLE() do { __builtin_unpredictable(); } while (0)
#endif
#endif
#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
#define DUK_NOINLINE __attribute__((noinline))

5
config/compilers/compiler_emscripten.h.in

@ -9,6 +9,11 @@
#define DUK_USE_BRANCH_HINTS
#define DUK_LIKELY(x) __builtin_expect((x), 1)
#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
#if defined(__clang__) && defined(__has_builtin)
#if __has_builtin(__builtin_unpredictable)
#define DUK_UNPREDICTABLE() do { __builtin_unpredictable(); } while (0)
#endif
#endif
#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
#define DUK_NOINLINE __attribute__((noinline))

1
config/compilers/compiler_gcc.h.in

@ -24,6 +24,7 @@
#define DUK_LIKELY(x) __builtin_expect((x), 1)
#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
#endif
/* XXX: equivalent of clang __builtin_unpredictable? */
#if (defined(DUK_F_C99) || defined(DUK_F_CPP11)) && \
defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 30101)

3
config/header-snippets/compiler_fillins.h.in

@ -66,6 +66,9 @@
#if !defined(DUK_UNLIKELY)
#define DUK_UNLIKELY(x) (x)
#endif
#if !defined(DUK_UNPREDICTABLE)
#define DUK_UNPREDICTABLE(x) (x)
#endif
#if !defined(DUK_NOINLINE)
#define DUK_NOINLINE /*nop*/

Loading…
Cancel
Save