The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/dpdk_rte_lpm/rte_branch_prediction.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause
    2  * Copyright(c) 2010-2014 Intel Corporation
    3  */
    4 
    5 /**
    6  * @file
    7  * Branch Prediction Helpers in RTE
    8  */
    9 
   10 #ifndef _RTE_BRANCH_PREDICTION_H_
   11 #define _RTE_BRANCH_PREDICTION_H_
   12 
   13 /**
   14  * Check if a branch is likely to be taken.
   15  *
   16  * This compiler builtin allows the developer to indicate if a branch is
   17  * likely to be taken. Example:
   18  *
   19  *   if (likely(x > 1))
   20  *      do_stuff();
   21  *
   22  */
   23 #ifndef likely
   24 #define likely(x)       __builtin_expect(!!(x), 1)
   25 #endif /* likely */
   26 
   27 /**
   28  * Check if a branch is unlikely to be taken.
   29  *
   30  * This compiler builtin allows the developer to indicate if a branch is
   31  * unlikely to be taken. Example:
   32  *
   33  *   if (unlikely(x < 1))
   34  *      do_stuff();
   35  *
   36  */
   37 #ifndef unlikely
   38 #define unlikely(x)     __builtin_expect(!!(x), 0)
   39 #endif /* unlikely */
   40 
   41 #endif /* _RTE_BRANCH_PREDICTION_H_ */

Cache object: 0c6f03919c589e282113a17f0c301332


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.