DPDK  24.07.0
rte_prefetch.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4 
5 #ifndef _RTE_PREFETCH_H_
6 #define _RTE_PREFETCH_H_
7 
8 #include <rte_compat.h>
9 
27 static inline void rte_prefetch0(const volatile void *p);
28 
34 static inline void rte_prefetch1(const volatile void *p);
35 
42 static inline void rte_prefetch2(const volatile void *p);
43 
54 static inline void rte_prefetch_non_temporal(const volatile void *p);
55 
66 __rte_experimental
67 static inline void
68 rte_prefetch0_write(const void *p)
69 {
70  /* 1 indicates intention to write, 3 sets target cache level to L1. See
71  * GCC docs where these integer constants are described in more detail:
72  * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
73  */
74 #ifdef RTE_TOOLCHAIN_MSVC
75  rte_prefetch0(p);
76 #else
77  __builtin_prefetch(p, 1, 3);
78 #endif
79 }
80 
91 __rte_experimental
92 static inline void
93 rte_prefetch1_write(const void *p)
94 {
95  /* 1 indicates intention to write, 2 sets target cache level to L2. See
96  * GCC docs where these integer constants are described in more detail:
97  * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
98  */
99 #ifdef RTE_TOOLCHAIN_MSVC
100  rte_prefetch1(p);
101 #else
102  __builtin_prefetch(p, 1, 2);
103 #endif
104 }
105 
116 __rte_experimental
117 static inline void
118 rte_prefetch2_write(const void *p)
119 {
120  /* 1 indicates intention to write, 1 sets target cache level to L3. See
121  * GCC docs where these integer constants are described in more detail:
122  * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
123  */
124 #ifdef RTE_TOOLCHAIN_MSVC
125  rte_prefetch2(p);
126 #else
127  __builtin_prefetch(p, 1, 1);
128 #endif
129 }
130 
145 __rte_experimental
146 static inline void
147 rte_cldemote(const volatile void *p);
148 
149 #endif /* _RTE_PREFETCH_H_ */
static void rte_prefetch2(const volatile void *p)
static __rte_experimental void rte_prefetch2_write(const void *p)
Definition: rte_prefetch.h:118
static __rte_experimental void rte_cldemote(const volatile void *p)
static __rte_experimental void rte_prefetch1_write(const void *p)
Definition: rte_prefetch.h:93
static void rte_prefetch1(const volatile void *p)
static __rte_experimental void rte_prefetch0_write(const void *p)
Definition: rte_prefetch.h:68
static void rte_prefetch0(const volatile void *p)
static void rte_prefetch_non_temporal(const volatile void *p)