Go to the documentation of this file.
24 #ifndef PXR_BASE_ARCH_HINTS_H
25 #define PXR_BASE_ARCH_HINTS_H
39 #if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG)
41 #define ARCH_LIKELY(x) (__builtin_expect((bool)(x), true))
42 #define ARCH_UNLIKELY(x) (__builtin_expect((bool)(x), false))
46 #define ARCH_LIKELY(x) (x)
47 #define ARCH_UNLIKELY(x) (x)
67 #if defined(ARCH_COMPILER_GCC) || \
68 defined(ARCH_COMPILER_CLANG) || \
69 defined(ARCH_COMPILER_ICC)
75 #define ARCH_GUARANTEE_TO_COMPILER(x) \
76 if (static_cast<bool>(x)) { } else { __builtin_unreachable(); }
80 #define ARCH_GUARANTEE_TO_COMPILER(x)
85 #endif // PXR_BASE_ARCH_HINTS_H