blob: ed485380af795bfdd1e2dc41f9441d7a8447ad73 [file] [log] [blame]
Logan Chiendf4f7662019-09-04 16:45:23 -07001/*===---- mwaitxintrin.h - MONITORX/MWAITX intrinsics ----------------------===
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
10#ifndef __X86INTRIN_H
11#error "Never use <mwaitxintrin.h> directly; include <x86intrin.h> instead."
12#endif
13
14#ifndef __MWAITXINTRIN_H
15#define __MWAITXINTRIN_H
16
17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("mwaitx")))
19static __inline__ void __DEFAULT_FN_ATTRS
Sasha Smundak33d5ddd2020-05-04 13:37:26 -070020_mm_monitorx(void * __p, unsigned __extensions, unsigned __hints)
Logan Chiendf4f7662019-09-04 16:45:23 -070021{
Sasha Smundak33d5ddd2020-05-04 13:37:26 -070022 __builtin_ia32_monitorx(__p, __extensions, __hints);
Logan Chiendf4f7662019-09-04 16:45:23 -070023}
24
25static __inline__ void __DEFAULT_FN_ATTRS
26_mm_mwaitx(unsigned __extensions, unsigned __hints, unsigned __clock)
27{
28 __builtin_ia32_mwaitx(__extensions, __hints, __clock);
29}
30
31#undef __DEFAULT_FN_ATTRS
32
33#endif /* __MWAITXINTRIN_H */