1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
7 * Branch Prediction Helpers in RTE
10 #ifndef _RTE_BRANCH_PREDICTION_H_
11 #define _RTE_BRANCH_PREDICTION_H_
14 * Check if a branch is likely to be taken.
16 * This compiler builtin allows the developer to indicate if a branch is
17 * likely to be taken. Example:
24 #define likely(x) __builtin_expect((x),1)
28 * Check if a branch is unlikely to be taken.
30 * This compiler builtin allows the developer to indicate if a branch is
31 * unlikely to be taken. Example:
33 * if (unlikely(x < 1))
38 #define unlikely(x) __builtin_expect((x),0)
41 #endif /* _RTE_BRANCH_PREDICTION_H_ */