Go to the documentation of this file.
7 #ifndef PXR_BASE_ARCH_HINTS_H
8 #define PXR_BASE_ARCH_HINTS_H
22 #if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG)
24 #define ARCH_LIKELY(x) (__builtin_expect((bool)(x), true))
25 #define ARCH_UNLIKELY(x) (__builtin_expect((bool)(x), false))
29 #define ARCH_LIKELY(x) (x)
30 #define ARCH_UNLIKELY(x) (x)
50 #if defined(ARCH_COMPILER_GCC) || \
51 defined(ARCH_COMPILER_CLANG) || \
52 defined(ARCH_COMPILER_ICC)
58 #define ARCH_GUARANTEE_TO_COMPILER(x) \
59 if (static_cast<bool>(x)) { } else { __builtin_unreachable(); }
63 #define ARCH_GUARANTEE_TO_COMPILER(x)
68 #endif // PXR_BASE_ARCH_HINTS_H