r178330 - Add XTEST intrinsic defined in TSX extension

Michael Liao michael.liao at intel.com
Thu Mar 28 22:14:06 PDT 2013


Author: hliao
Date: Fri Mar 29 00:14:06 2013
New Revision: 178330

URL: http://llvm.org/viewvc/llvm-project?rev=178330&view=rev
Log:
Add XTEST intrinsic defined in TSX extension


Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/immintrin.h
    cfe/trunk/test/CodeGen/rtm-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=178330&r1=178329&r2=178330&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Fri Mar 29 00:14:06 2013
@@ -739,5 +739,6 @@ BUILTIN(__builtin_ia32_vfrczpd256, "V4dV
 BUILTIN(__builtin_ia32_xbegin, "i", "")
 BUILTIN(__builtin_ia32_xend, "v", "")
 BUILTIN(__builtin_ia32_xabort, "vIc", "")
+BUILTIN(__builtin_ia32_xtest, "i", "")
 
 #undef BUILTIN

Modified: cfe/trunk/lib/Headers/immintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/immintrin.h?rev=178330&r1=178329&r2=178330&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/immintrin.h (original)
+++ cfe/trunk/lib/Headers/immintrin.h Fri Mar 29 00:14:06 2013
@@ -102,4 +102,13 @@ _rdrand64_step(unsigned long long *__p)
 #include <rtmintrin.h>
 #endif
 
+/* FIXME: check __HLE__ as well when HLE is supported. */
+#if defined (__RTM__)
+static __inline__ int __attribute__((__always_inline__, __nodebug__))
+_xtest(void)
+{
+  return __builtin_ia32_xtest();
+}
+#endif
+
 #endif /* __IMMINTRIN_H */

Modified: cfe/trunk/test/CodeGen/rtm-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/rtm-builtins.c?rev=178330&r1=178329&r2=178330&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/rtm-builtins.c (original)
+++ cfe/trunk/test/CodeGen/rtm-builtins.c Fri Mar 29 00:14:06 2013
@@ -21,3 +21,8 @@ test_xabort(void) {
   // CHECK: void @llvm.x86.xabort(i8 2)
   _xabort(2);
 }
+
+unsigned int test_xtest(void) {
+  // CHECK: i32 @llvm.x86.xtest()
+  return _xtest();
+}





More information about the cfe-commits mailing list