[docs] Fix build-docs.sh
[llvm-project.git] / clang / lib / Headers / rtmintrin.h
bloba3ec81e3f7402e4018521509374e89a9c4bc8dc5
1 /*===---- rtmintrin.h - RTM intrinsics -------------------------------------===
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 #ifndef __IMMINTRIN_H
11 #error "Never use <rtmintrin.h> directly; include <immintrin.h> instead."
12 #endif
14 #ifndef __RTMINTRIN_H
15 #define __RTMINTRIN_H
17 #define _XBEGIN_STARTED (~0u)
18 #define _XABORT_EXPLICIT (1 << 0)
19 #define _XABORT_RETRY (1 << 1)
20 #define _XABORT_CONFLICT (1 << 2)
21 #define _XABORT_CAPACITY (1 << 3)
22 #define _XABORT_DEBUG (1 << 4)
23 #define _XABORT_NESTED (1 << 5)
24 #define _XABORT_CODE(x) (((x) >> 24) & 0xFF)
26 /* Define the default attributes for the functions in this file. */
27 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("rtm")))
29 static __inline__ unsigned int __DEFAULT_FN_ATTRS
30 _xbegin(void)
32 return (unsigned int)__builtin_ia32_xbegin();
35 static __inline__ void __DEFAULT_FN_ATTRS
36 _xend(void)
38 __builtin_ia32_xend();
41 #define _xabort(imm) __builtin_ia32_xabort((imm))
43 #undef __DEFAULT_FN_ATTRS
45 #endif /* __RTMINTRIN_H */