blob: a180984a3f285822b3271506ac48185cbda4fec0 [file] [log] [blame]
Logan Chiendf4f7662019-09-04 16:45:23 -07001/*===----------------------- 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#if !defined __X86INTRIN_H && !defined __IMMINTRIN_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/// Loads the cache line address and zero's out the cacheline
21///
22/// \headerfile <clzerointrin.h>
23///
24/// This intrinsic corresponds to the <c> CLZERO </c> instruction.
25///
26/// \param __line
27/// A pointer to a cacheline which needs to be zeroed out.
28static __inline__ void __DEFAULT_FN_ATTRS
29_mm_clzero (void * __line)
30{
31 __builtin_ia32_clzero ((void *)__line);
32}
33
34#undef __DEFAULT_FN_ATTRS
35
36#endif /* __CLZEROINTRIN_H */