lib/Header: Fix Visual Studio builds try #2
[llvm-project.git] / clang / lib / Headers / waitpkgintrin.h
blob7ecada4cf723d60a1cc32c14ab5179a5fe1f8dd8
1 /*===----------------------- waitpkgintrin.h - WAITPKG --------------------===
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 */
9 #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
10 #error "Never use <waitpkgintrin.h> directly; include <x86intrin.h> instead."
11 #endif
13 #ifndef __WAITPKGINTRIN_H
14 #define __WAITPKGINTRIN_H
16 /* Define the default attributes for the functions in this file. */
17 #define __DEFAULT_FN_ATTRS \
18 __attribute__((__always_inline__, __nodebug__, __target__("waitpkg")))
20 static __inline__ void __DEFAULT_FN_ATTRS
21 _umonitor (void * __address)
23 __builtin_ia32_umonitor (__address);
26 static __inline__ unsigned char __DEFAULT_FN_ATTRS
27 _umwait (unsigned int __control, unsigned long long __counter)
29 return __builtin_ia32_umwait (__control,
30 (unsigned int)(__counter >> 32), (unsigned int)__counter);
33 static __inline__ unsigned char __DEFAULT_FN_ATTRS
34 _tpause (unsigned int __control, unsigned long long __counter)
36 return __builtin_ia32_tpause (__control,
37 (unsigned int)(__counter >> 32), (unsigned int)__counter);
40 #undef __DEFAULT_FN_ATTRS
42 #endif /* __WAITPKGINTRIN_H */