]> xenbits.xensource.com Git - unikraft/libs/intel-intrinsics.git/commitdiff
Add compatibility with Clang <= 10 RELEASE-0.14.0
authorAndrei Tatar <andrei@unikraft.io>
Mon, 14 Aug 2023 19:10:24 +0000 (21:10 +0200)
committerUnikraft <monkey@unikraft.io>
Tue, 15 Aug 2023 18:35:41 +0000 (18:35 +0000)
Clang versions below 11 do not support the AMX, serialize, and tsxldtrk
intrinsics. This change adds a version check when including the
offending headers.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #4

include-llvm/immintrin.h

index 0cc72600f193f3f4291a8b254e5bd952072a4ba4..682e4ef4603abdbe5331d2e6d6e8f3f6ca8beeaa 100644 (file)
@@ -509,10 +509,12 @@ _storebe_i64(void * __P, long long __D) {
 #endif
 #endif
 
+#if (__clang_major__ >= 11)
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||      \
     defined(__AMXTILE__) || defined(__AMXINT8__) || defined(__AMXBF16__)
 #include <amxintrin.h>
 #endif
+#endif
 
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||      \
     defined(__AVX512VP2INTERSECT__)
@@ -529,6 +531,7 @@ _storebe_i64(void * __P, long long __D) {
 #include <enqcmdintrin.h>
 #endif
 
+#if (__clang_major__ >= 11)
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||      \
     defined(__SERIALIZE__)
 #include <serializeintrin.h>
@@ -538,6 +541,7 @@ _storebe_i64(void * __P, long long __D) {
     defined(__TSXLDTRK__)
 #include <tsxldtrkintrin.h>
 #endif
+#endif
 
 #if defined(_MSC_VER) && __has_extension(gnu_asm)
 /* Define the default attributes for these intrinsics */