clzerointrin.h revision 341825
1317019Sdim/*===----------------------- clzerointrin.h - CLZERO ----------------------===
2317019Sdim *
3317019Sdim * Permission is hereby granted, free of charge, to any person obtaining a copy
4317019Sdim * of this software and associated documentation files (the "Software"), to deal
5317019Sdim * in the Software without restriction, including without limitation the rights
6317019Sdim * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7317019Sdim * copies of the Software, and to permit persons to whom the Software is
8317019Sdim * furnished to do so, subject to the following conditions:
9317019Sdim *
10317019Sdim * The above copyright notice and this permission notice shall be included in
11317019Sdim * all copies or substantial portions of the Software.
12317019Sdim *
13317019Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14317019Sdim * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15317019Sdim * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16317019Sdim * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17317019Sdim * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18317019Sdim * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19317019Sdim * THE SOFTWARE.
20317019Sdim *
21317019Sdim *===-----------------------------------------------------------------------===
22317019Sdim */
23341825Sdim#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
24317019Sdim#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
25317019Sdim#endif
26317019Sdim
27341825Sdim#ifndef __CLZEROINTRIN_H
28341825Sdim#define __CLZEROINTRIN_H
29317019Sdim
30317019Sdim/* Define the default attributes for the functions in this file. */
31317019Sdim#define __DEFAULT_FN_ATTRS \
32317019Sdim  __attribute__((__always_inline__, __nodebug__,  __target__("clzero")))
33317019Sdim
34341825Sdim/// Loads the cache line address and zero's out the cacheline
35317019Sdim///
36317019Sdim/// \headerfile <clzerointrin.h>
37317019Sdim///
38317019Sdim/// This intrinsic corresponds to the <c> CLZERO </c> instruction.
39317019Sdim///
40317019Sdim/// \param __line
41317019Sdim///    A pointer to a cacheline which needs to be zeroed out.
42317019Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
43317019Sdim_mm_clzero (void * __line)
44317019Sdim{
45317019Sdim  __builtin_ia32_clzero ((void *)__line);
46317019Sdim}
47317019Sdim
48341825Sdim#undef __DEFAULT_FN_ATTRS
49317019Sdim
50341825Sdim#endif /* __CLZEROINTRIN_H */
51