[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / lib / Headers / prfchwintrin.h
blobd2f91aa0123e0ec30cac717e94205cea5401e604
1 /*===---- prfchwintrin.h - PREFETCHW intrinsic -----------------------------===
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
7 *===-----------------------------------------------------------------------===
8 */
10 #if !defined(__X86INTRIN_H) && !defined(_MM3DNOW_H_INCLUDED)
11 #error "Never use <prfchwintrin.h> directly; include <x86intrin.h> or <mm3dnow.h> instead."
12 #endif
14 #ifndef __PRFCHWINTRIN_H
15 #define __PRFCHWINTRIN_H
17 /// Loads a memory sequence containing the specified memory address into
18 /// all data cache levels. The cache-coherency state is set to exclusive.
19 /// Data can be read from and written to the cache line without additional
20 /// delay.
21 ///
22 /// \headerfile <x86intrin.h>
23 ///
24 /// This intrinsic corresponds to the \c PREFETCHT0 instruction.
25 ///
26 /// \param __P
27 /// A pointer specifying the memory address to be prefetched.
28 static __inline__ void __attribute__((__always_inline__, __nodebug__))
29 _m_prefetch(void *__P)
31 __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
34 /// Loads a memory sequence containing the specified memory address into
35 /// the L1 data cache and sets the cache-coherency to modified. This
36 /// provides a hint to the processor that the cache line will be modified.
37 /// It is intended for use when the cache line will be written to shortly
38 /// after the prefetch is performed.
39 ///
40 /// Note that the effect of this intrinsic is dependent on the processor
41 /// implementation.
42 ///
43 /// \headerfile <x86intrin.h>
44 ///
45 /// This intrinsic corresponds to the \c PREFETCHW instruction.
46 ///
47 /// \param __P
48 /// A pointer specifying the memory address to be prefetched.
49 static __inline__ void __attribute__((__always_inline__, __nodebug__))
50 _m_prefetchw(volatile const void *__P)
52 #pragma clang diagnostic push
53 #pragma clang diagnostic ignored "-Wcast-qual"
54 __builtin_prefetch ((const void*)__P, 1, 3 /* _MM_HINT_T0 */);
55 #pragma clang diagnostic pop
58 #endif /* __PRFCHWINTRIN_H */