FEMU  原版 master 7e238cc
FEMU: Accurate, Scalable and Extensible NVMe SSD Emulator (FAST'18)
rte_branch_prediction.h 文件参考
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define likely(x)   __builtin_expect(!!(x), 1)
 
#define unlikely(x)   __builtin_expect(!!(x), 0)
 

详细描述

Branch Prediction Helpers in RTE

宏定义说明

◆ likely

#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();

◆ unlikely

#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();