1317019Sdim/*===----------------------- clzerointrin.h - CLZERO ----------------------===
2317019Sdim *
3353358Sdim * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim * See https://llvm.org/LICENSE.txt for license information.
5353358Sdim * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6317019Sdim *
7317019Sdim *===-----------------------------------------------------------------------===
8317019Sdim */
9341825Sdim#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
10317019Sdim#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
11317019Sdim#endif
12317019Sdim
13341825Sdim#ifndef __CLZEROINTRIN_H
14341825Sdim#define __CLZEROINTRIN_H
15317019Sdim
16317019Sdim/* Define the default attributes for the functions in this file. */
17317019Sdim#define __DEFAULT_FN_ATTRS \
18317019Sdim  __attribute__((__always_inline__, __nodebug__,  __target__("clzero")))
19317019Sdim
20341825Sdim/// Loads the cache line address and zero's out the cacheline
21317019Sdim///
22317019Sdim/// \headerfile <clzerointrin.h>
23317019Sdim///
24317019Sdim/// This intrinsic corresponds to the <c> CLZERO </c> instruction.
25317019Sdim///
26317019Sdim/// \param __line
27317019Sdim///    A pointer to a cacheline which needs to be zeroed out.
28317019Sdimstatic __inline__ void __DEFAULT_FN_ATTRS
29317019Sdim_mm_clzero (void * __line)
30317019Sdim{
31317019Sdim  __builtin_ia32_clzero ((void *)__line);
32317019Sdim}
33317019Sdim
34341825Sdim#undef __DEFAULT_FN_ATTRS
35317019Sdim
36341825Sdim#endif /* __CLZEROINTRIN_H */
37