xref: /netbsd-src/external/apache2/llvm/dist/clang/lib/Headers/tsxldtrkintrin.h (revision e038c9c4676b0f19b1b7dd08a940c6ed64a6d5ae)
1*e038c9c4Sjoerg /*===------------- tsxldtrkintrin.h - tsxldtrk intrinsics ------------------===
2*e038c9c4Sjoerg  *
3*e038c9c4Sjoerg  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*e038c9c4Sjoerg  * See https://llvm.org/LICENSE.txt for license information.
5*e038c9c4Sjoerg  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*e038c9c4Sjoerg  *
7*e038c9c4Sjoerg  *===-----------------------------------------------------------------------===
8*e038c9c4Sjoerg  */
9*e038c9c4Sjoerg 
10*e038c9c4Sjoerg #ifndef __IMMINTRIN_H
11*e038c9c4Sjoerg #error "Never use <tsxldtrkintrin.h> directly; include <immintrin.h> instead."
12*e038c9c4Sjoerg #endif
13*e038c9c4Sjoerg 
14*e038c9c4Sjoerg #ifndef __TSXLDTRKINTRIN_H
15*e038c9c4Sjoerg #define __TSXLDTRKINTRIN_H
16*e038c9c4Sjoerg 
17*e038c9c4Sjoerg /* Define the default attributes for the functions in this file */
18*e038c9c4Sjoerg #define _DEFAULT_FN_ATTRS \
19*e038c9c4Sjoerg   __attribute__((__always_inline__, __nodebug__, __target__("tsxldtrk")))
20*e038c9c4Sjoerg 
21*e038c9c4Sjoerg /// Marks the start of an TSX (RTM) suspend load address tracking region. If
22*e038c9c4Sjoerg ///    this intrinsic is used inside a transactional region, subsequent loads
23*e038c9c4Sjoerg ///    are not added to the read set of the transaction. If it's used inside a
24*e038c9c4Sjoerg ///    suspend load address tracking region it will cause transaction abort.
25*e038c9c4Sjoerg ///    If it's used outside of a transactional region it behaves like a NOP.
26*e038c9c4Sjoerg ///
27*e038c9c4Sjoerg /// \headerfile <x86intrin.h>
28*e038c9c4Sjoerg ///
29*e038c9c4Sjoerg /// This intrinsic corresponds to the \c XSUSLDTRK instruction.
30*e038c9c4Sjoerg ///
31*e038c9c4Sjoerg static __inline__ void _DEFAULT_FN_ATTRS
_xsusldtrk(void)32*e038c9c4Sjoerg _xsusldtrk (void)
33*e038c9c4Sjoerg {
34*e038c9c4Sjoerg     __builtin_ia32_xsusldtrk();
35*e038c9c4Sjoerg }
36*e038c9c4Sjoerg 
37*e038c9c4Sjoerg /// Marks the end of an TSX (RTM) suspend load address tracking region. If this
38*e038c9c4Sjoerg ///    intrinsic is used inside a suspend load address tracking region it will
39*e038c9c4Sjoerg ///    end the suspend region and all following load addresses will be added to
40*e038c9c4Sjoerg ///    the transaction read set. If it's used inside an active transaction but
41*e038c9c4Sjoerg ///    not in a suspend region it will cause transaction abort. If it's used
42*e038c9c4Sjoerg ///    outside of a transactional region it behaves like a NOP.
43*e038c9c4Sjoerg ///
44*e038c9c4Sjoerg /// \headerfile <x86intrin.h>
45*e038c9c4Sjoerg ///
46*e038c9c4Sjoerg /// This intrinsic corresponds to the \c XRESLDTRK instruction.
47*e038c9c4Sjoerg ///
48*e038c9c4Sjoerg static __inline__ void _DEFAULT_FN_ATTRS
_xresldtrk(void)49*e038c9c4Sjoerg _xresldtrk (void)
50*e038c9c4Sjoerg {
51*e038c9c4Sjoerg     __builtin_ia32_xresldtrk();
52*e038c9c4Sjoerg }
53*e038c9c4Sjoerg 
54*e038c9c4Sjoerg #undef _DEFAULT_FN_ATTRS
55*e038c9c4Sjoerg 
56*e038c9c4Sjoerg #endif /* __TSXLDTRKINTRIN_H */
57