xref: /freebsd/contrib/llvm-project/clang/lib/Headers/clzerointrin.h (revision 5fb307d29b364982acbde82cbf77db3cae486f8c)
1 /*===----------------------- clzerointrin.h - CLZERO ----------------------===
2  *
3  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4  * See https://llvm.org/LICENSE.txt for license information.
5  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6  *
7  *===-----------------------------------------------------------------------===
8  */
9 #ifndef __X86INTRIN_H
10 #error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
11 #endif
12 
13 #ifndef __CLZEROINTRIN_H
14 #define __CLZEROINTRIN_H
15 
16 /* Define the default attributes for the functions in this file. */
17 #define __DEFAULT_FN_ATTRS \
18   __attribute__((__always_inline__, __nodebug__,  __target__("clzero")))
19 
20 /// Zeroes out the cache line for the address \a __line. This uses a
21 ///    non-temporal store. Calling \c _mm_sfence() afterward might be needed
22 ///    to enforce ordering.
23 ///
24 /// \headerfile <x86intrin.h>
25 ///
26 /// This intrinsic corresponds to the \c CLZERO instruction.
27 ///
28 /// \param __line
29 ///    An address within the cache line to zero out.
30 static __inline__ void __DEFAULT_FN_ATTRS
31 _mm_clzero (void * __line)
32 {
33   __builtin_ia32_clzero ((void *)__line);
34 }
35 
36 #undef __DEFAULT_FN_ATTRS
37 
38 #endif /* __CLZEROINTRIN_H */
39