DPDK 22.11.6
|
Go to the source code of this file.
Macros | |
#define | likely(x) __builtin_expect(!!(x), 1) |
#define | unlikely(x) __builtin_expect(!!(x), 0) |
Branch Prediction Helpers in RTE
Definition in file rte_branch_prediction.h.
#define likely | ( | x | ) | __builtin_expect(!!(x), 1) |
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();
Definition at line 28 of file rte_branch_prediction.h.
#define unlikely | ( | x | ) | __builtin_expect(!!(x), 0) |
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();
Definition at line 42 of file rte_branch_prediction.h.