2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2016-09-16 22:17:33 +00:00
|
|
|
* Copyright (c) Intel Corporation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* Likely/unlikely branch prediction macros
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPDK_LIKELY_H
|
|
|
|
#define SPDK_LIKELY_H
|
|
|
|
|
2017-05-01 20:22:48 +00:00
|
|
|
#include "spdk/stdinc.h"
|
|
|
|
|
2016-09-16 22:17:33 +00:00
|
|
|
#define spdk_unlikely(cond) __builtin_expect((cond), 0)
|
2016-12-15 20:01:08 +00:00
|
|
|
#define spdk_likely(cond) __builtin_expect(!!(cond), 1)
|
2016-09-16 22:17:33 +00:00
|
|
|
|
|
|
|
#endif
|