r239926 - Move xtest to its own file to match the gcc header organization.

Eric Christopher echristo at gmail.com
Wed Jun 17 11:42:07 PDT 2015


Author: echristo
Date: Wed Jun 17 13:42:07 2015
New Revision: 239926

URL: http://llvm.org/viewvc/llvm-project?rev=239926&view=rev
Log:
Move xtest to its own file to match the gcc header organization.

Added:
    cfe/trunk/lib/Headers/xtestintrin.h
Modified:
    cfe/trunk/lib/Headers/CMakeLists.txt
    cfe/trunk/lib/Headers/immintrin.h
    cfe/trunk/test/Headers/x86intrin-2.c

Modified: cfe/trunk/lib/Headers/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/CMakeLists.txt?rev=239926&r1=239925&r2=239926&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/CMakeLists.txt (original)
+++ cfe/trunk/lib/Headers/CMakeLists.txt Wed Jun 17 13:42:07 2015
@@ -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)

Modified: cfe/trunk/lib/Headers/immintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/immintrin.h?rev=239926&r1=239925&r2=239926&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/immintrin.h (original)
+++ cfe/trunk/lib/Headers/immintrin.h Wed Jun 17 13:42:07 2015
@@ -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>
 

Added: cfe/trunk/lib/Headers/xtestintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xtestintrin.h?rev=239926&view=auto
==============================================================================
--- cfe/trunk/lib/Headers/xtestintrin.h (added)
+++ cfe/trunk/lib/Headers/xtestintrin.h Wed Jun 17 13:42:07 2015
@@ -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

Modified: cfe/trunk/test/Headers/x86intrin-2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/x86intrin-2.c?rev=239926&r1=239925&r2=239926&view=diff
==============================================================================
--- cfe/trunk/test/Headers/x86intrin-2.c (original)
+++ cfe/trunk/test/Headers/x86intrin-2.c Wed Jun 17 13:42:07 2015
@@ -130,4 +130,8 @@ __m128 __attribute__((__target__("f16c")
   return _mm_cvtph_ps(a);
 }
 
+int __attribute__((__target__("rtm"))) xtest_wrap(void) {
+  return _xtest();
+}
+
 #endif





More information about the cfe-commits mailing list