This document is for a version of USD that is under development. See
this page
for the current release.
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Typedefs
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
c
d
e
f
h
i
k
l
m
o
p
r
s
t
v
w
Enumerator
a
b
c
d
e
i
l
m
n
o
p
r
t
u
Related Functions
b
g
h
o
s
t
Files
File List
File Members
All
_
a
c
g
h
j
n
o
p
s
t
u
v
w
Functions
a
c
g
h
j
n
o
p
s
t
u
v
w
Variables
Typedefs
a
g
n
p
s
t
u
Enumerations
Enumerator
Macros
_
a
g
n
p
s
t
u
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
hints.h
Go to the documentation of this file.
1
//
2
// Copyright 2016 Pixar
3
//
4
// Licensed under the terms set forth in the LICENSE.txt file available at
5
// https://openusd.org/license.
6
//
7
#ifndef PXR_BASE_ARCH_HINTS_H
8
#define PXR_BASE_ARCH_HINTS_H
9
10
#include "pxr/base/arch/defines.h"
11
21
22
#if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG)
23
24
#define ARCH_LIKELY(x) (__builtin_expect((bool)(x), true))
25
#define ARCH_UNLIKELY(x) (__builtin_expect((bool)(x), false))
26
27
#else
28
29
#define ARCH_LIKELY(x) (x)
30
#define ARCH_UNLIKELY(x) (x)
31
32
#endif
33
49
50
#if defined(ARCH_COMPILER_GCC) || \
51
defined(ARCH_COMPILER_CLANG) || \
52
defined(ARCH_COMPILER_ICC)
53
54
// Intentionally using __builtin_unreachable on clang for consistency, since
55
// __builtin_assume does not evaluate the expression, and our only option on gcc
56
// is the __builtin_unreachable branch.
57
58
#define ARCH_GUARANTEE_TO_COMPILER(x) \
59
if (static_cast<bool>(x)) { } else { __builtin_unreachable(); }
60
61
#else
62
63
#define ARCH_GUARANTEE_TO_COMPILER(x)
64
65
#endif
66
67
68
#endif
// PXR_BASE_ARCH_HINTS_H
pxr
base
arch
hints.h
© Copyright 2024, Pixar Animation Studios. |
Terms of Use
| Generated on Fri Nov 22 2024 14:48:37 by
1.9.6