DOKK / manpages / debian 13 / dpdk-doc / rte_branch_prediction.h.3.en
rte_branch_prediction.h(3) Library Functions Manual rte_branch_prediction.h(3)

rte_branch_prediction.h


#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.

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 26 of file rte_branch_prediction.h.

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 43 of file rte_branch_prediction.h.

Generated automatically by Doxygen for DPDK from the source code.

Version 24.11.3 DPDK