brintos

brintos / linux-shallow public Read only

0
0
Text · 875 B · a7c343d Raw
34 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef __BPF_COMPILER_H__3#define __BPF_COMPILER_H__4 5#define DO_PRAGMA_(X) _Pragma(#X)6 7#if __clang__8#define __pragma_loop_unroll DO_PRAGMA_(clang loop unroll(enable))9#else10/* In GCC -funroll-loops, which is enabled with -O2, should have the11   same impact than the loop-unroll-enable pragma above.  */12#define __pragma_loop_unroll13#endif14 15#if __clang__16#define __pragma_loop_unroll_count(N) DO_PRAGMA_(clang loop unroll_count(N))17#else18#define __pragma_loop_unroll_count(N) DO_PRAGMA_(GCC unroll N)19#endif20 21#if __clang__22#define __pragma_loop_unroll_full DO_PRAGMA_(clang loop unroll(full))23#else24#define __pragma_loop_unroll_full DO_PRAGMA_(GCC unroll 65534)25#endif26 27#if __clang__28#define __pragma_loop_no_unroll DO_PRAGMA_(clang loop unroll(disable))29#else30#define __pragma_loop_no_unroll DO_PRAGMA_(GCC unroll 1)31#endif32 33#endif34