add dpdk dummy
This commit is contained in:
32
test/dpdk_dummy/rte_branch_prediction.h
Normal file
32
test/dpdk_dummy/rte_branch_prediction.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef _RTE_BRANCH_PREDICTION_H_
|
||||
#define _RTE_BRANCH_PREDICTION_H_
|
||||
|
||||
/**
|
||||
* Check if a branch is likely to be taken.
|
||||
*
|
||||
* This compiler builtin allows the developer to indicate if a branch is
|
||||
* likely to be taken. Example:
|
||||
*
|
||||
* if (likely(x > 1))
|
||||
* do_stuff();
|
||||
*
|
||||
*/
|
||||
#ifndef likely
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#endif /* likely */
|
||||
|
||||
/**
|
||||
* Check if a branch is unlikely to be taken.
|
||||
*
|
||||
* This compiler builtin allows the developer to indicate if a branch is
|
||||
* unlikely to be taken. Example:
|
||||
*
|
||||
* if (unlikely(x < 1))
|
||||
* do_stuff();
|
||||
*
|
||||
*/
|
||||
#ifndef unlikely
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#endif /* unlikely */
|
||||
|
||||
#endif /* _RTE_BRANCH_PREDICTION_H_ */
|
||||
Reference in New Issue
Block a user