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