1*7330f729Sjoerg /*===---- xtestintrin.h - XTEST intrinsic ----------------------------------=== 2*7330f729Sjoerg * 3*7330f729Sjoerg * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*7330f729Sjoerg * See https://llvm.org/LICENSE.txt for license information. 5*7330f729Sjoerg * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*7330f729Sjoerg * 7*7330f729Sjoerg *===-----------------------------------------------------------------------=== 8*7330f729Sjoerg */ 9*7330f729Sjoerg 10*7330f729Sjoerg #ifndef __IMMINTRIN_H 11*7330f729Sjoerg #error "Never use <xtestintrin.h> directly; include <immintrin.h> instead." 12*7330f729Sjoerg #endif 13*7330f729Sjoerg 14*7330f729Sjoerg #ifndef __XTESTINTRIN_H 15*7330f729Sjoerg #define __XTESTINTRIN_H 16*7330f729Sjoerg 17*7330f729Sjoerg /* xtest returns non-zero if the instruction is executed within an RTM or active 18*7330f729Sjoerg * HLE region. */ 19*7330f729Sjoerg /* FIXME: This can be an either or for RTM/HLE. Deal with this when HLE is 20*7330f729Sjoerg * supported. */ 21*7330f729Sjoerg static __inline__ int 22*7330f729Sjoerg __attribute__((__always_inline__, __nodebug__, __target__("rtm"))) _xtest(void)23*7330f729Sjoerg _xtest(void) { 24*7330f729Sjoerg return __builtin_ia32_xtest(); 25*7330f729Sjoerg } 26*7330f729Sjoerg 27*7330f729Sjoerg #endif 28