---
name: "rte_branch_prediction.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_branch_prediction.h"
---

# rte\_branch\_prediction.h(3)

## NAME

rte\_branch\_prediction.h

## SYNOPSIS

### Macros

\#define **likely**(x)   \_\_builtin\_expect(!!(x), 1)\
 \#define **unlikely**(x)   \_\_builtin\_expect(!!(x), 0)\

## Detailed Description

Branch Prediction Helpers in RTE

Definition in file **rte\_branch\_prediction.h**.

## Macro Definition Documentation

### #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 **26** 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 **43** of file **rte\_branch\_prediction.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
