linux-5.15/likely()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#zf5c4d3b]
#backlinks
*説明 [#m3dd331a]
-パス: [[linux-5.15/include/linux/compiler.h]]
-trueと評価される可能性が高い分岐処理を高速化する。
--if (likely(a)) ...のように使う。
**引数 [#r8813a1d]
-x
--何らかの式
**返り値 [#r7e0dcb1]
-x
--xの値そのまま
**参考 [#ddd79b30]
*実装 [#z0b29265]
/*
* Note: DISABLE_BRANCH_PROFILING can be used by special...
* to disable branch tracing on a per file basis.
*/
#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
&& !defined(DISABLE_BRANCH_PROFILING) && !defined(__...
/*
* Using __builtin_constant_p(x) to ignore cases where t...
* value is always the same. This idea is taken from a ...
* written by Daniel Walker.
*/
# ifndef likely
# define likely(x) (__branch_check__(x, 1, __builtin_co...
# endif
//...
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#else
# define likely(x) __builtin_expect(!!(x), 1)
//...
#endif
-CONFIG_TRACE_BRANCH_PROFILINGが有効ならば__branch_check_...
--__builtin_constant_pはコンパイラ組み込み関数。引数がコ...
--[[linux-5.15/__branch_check__()]]
-CONFIG_TRACE_BRANCH_PROFILINGが無効ならば__builtin_expec...
--!!(x)とするのは1ではないtrue値を1に、0ではないfalse値を...
*コメント [#ne2fe80e]
終了行:
*参照元 [#zf5c4d3b]
#backlinks
*説明 [#m3dd331a]
-パス: [[linux-5.15/include/linux/compiler.h]]
-trueと評価される可能性が高い分岐処理を高速化する。
--if (likely(a)) ...のように使う。
**引数 [#r8813a1d]
-x
--何らかの式
**返り値 [#r7e0dcb1]
-x
--xの値そのまま
**参考 [#ddd79b30]
*実装 [#z0b29265]
/*
* Note: DISABLE_BRANCH_PROFILING can be used by special...
* to disable branch tracing on a per file basis.
*/
#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
&& !defined(DISABLE_BRANCH_PROFILING) && !defined(__...
/*
* Using __builtin_constant_p(x) to ignore cases where t...
* value is always the same. This idea is taken from a ...
* written by Daniel Walker.
*/
# ifndef likely
# define likely(x) (__branch_check__(x, 1, __builtin_co...
# endif
//...
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#else
# define likely(x) __builtin_expect(!!(x), 1)
//...
#endif
-CONFIG_TRACE_BRANCH_PROFILINGが有効ならば__branch_check_...
--__builtin_constant_pはコンパイラ組み込み関数。引数がコ...
--[[linux-5.15/__branch_check__()]]
-CONFIG_TRACE_BRANCH_PROFILINGが無効ならば__builtin_expec...
--!!(x)とするのは1ではないtrue値を1に、0ではないfalse値を...
*コメント [#ne2fe80e]
ページ名: