]> granicus.if.org Git - clang/commitdiff
Move xtest to its own file to match the gcc header organization.
authorEric Christopher <echristo@gmail.com>
Wed, 17 Jun 2015 18:42:07 +0000 (18:42 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 17 Jun 2015 18:42:07 +0000 (18:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239926 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/CMakeLists.txt
lib/Headers/immintrin.h
lib/Headers/xtestintrin.h [new file with mode: 0644]
test/Headers/x86intrin-2.c

index 29a738e7a81aab00e282790704ada7d2683ed571..5f8857c41b49134165e22355fdf485d3b2e86086 100644 (file)
@@ -62,6 +62,7 @@ set(files
   x86intrin.h
   xmmintrin.h
   xopintrin.h
+  xtestintrin.h
   )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
index 4194eb5910a86db704e3717af50f5b141ab65bf0..4af407dfc7e87d9a3d57fe9268944ff8707a0712 100644 (file)
@@ -136,15 +136,7 @@ _writegsbase_u64(unsigned long long __V)
 
 #include <rtmintrin.h>
 
-/* xtest returns non-zero if the instruction is executed within an RTM or active
- * HLE region. */
-/* FIXME: This can be an either or for RTM/HLE. Deal with this when HLE is
- * supported. */
-static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rtm")))
-_xtest(void)
-{
-  return __builtin_ia32_xtest();
-}
+#include <xtestintrin.h>
 
 #include <shaintrin.h>
 
diff --git a/lib/Headers/xtestintrin.h b/lib/Headers/xtestintrin.h
new file mode 100644 (file)
index 0000000..9d3378f
--- /dev/null
@@ -0,0 +1,41 @@
+/*===---- xtestintrin.h - XTEST intrinsic ---------------------------------===
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __IMMINTRIN_H
+#error "Never use <xtestintrin.h> directly; include <immintrin.h> instead."
+#endif
+
+#ifndef __XTESTINTRIN_H
+#define __XTESTINTRIN_H
+
+/* xtest returns non-zero if the instruction is executed within an RTM or active
+ * HLE region. */
+/* FIXME: This can be an either or for RTM/HLE. Deal with this when HLE is
+ * supported. */
+static __inline__ int
+    __attribute__((__always_inline__, __nodebug__, __target__("rtm")))
+    _xtest(void) {
+  return __builtin_ia32_xtest();
+}
+
+#endif
index 825321da17f65d925fd4602dbf6ff3a20772d08a..f98fdbd13a8a436bc1328514444c7828ebae2faf 100644 (file)
@@ -130,4 +130,8 @@ __m128 __attribute__((__target__("f16c"))) mm_cvtph_ps_wrap(__m128i a) {
   return _mm_cvtph_ps(a);
 }
 
+int __attribute__((__target__("rtm"))) xtest_wrap(void) {
+  return _xtest();
+}
+
 #endif