[clang] 847abdd - [X86] Add AMX_COMPLEX to Graniterapids

Freddy Ye via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 5 22:19:58 PDT 2023


Author: Freddy Ye
Date: 2023-04-06T13:19:44+08:00
New Revision: 847abddedca9ed2934e0c2386662ccb04ba4d298

URL: https://github.com/llvm/llvm-project/commit/847abddedca9ed2934e0c2386662ccb04ba4d298
DIFF: https://github.com/llvm/llvm-project/commit/847abddedca9ed2934e0c2386662ccb04ba4d298.diff

LOG: [X86] Add AMX_COMPLEX to Graniterapids

This patch also rename __AMXCOMPLEX__ to __AMX_COMPLEX__

Reviewed By: skan, xiangzhangllvm

Differential Revision: https://reviews.llvm.org/D147525

Added: 
    

Modified: 
    clang/lib/Basic/Targets/X86.cpp
    clang/lib/Headers/immintrin.h
    clang/test/Preprocessor/predefined-arch-macros.c
    clang/test/Preprocessor/x86_target_features.c
    llvm/lib/Target/X86/X86.td
    llvm/lib/TargetParser/X86TargetParser.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index 0cffc76d3f2ce..a997614a65a86 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -802,7 +802,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
   if (HasAMXFP16)
     Builder.defineMacro("__AMX_FP16__");
   if (HasAMXCOMPLEX)
-    Builder.defineMacro("__AMXCOMPLEX__");
+    Builder.defineMacro("__AMX_COMPLEX__");
   if (HasCMPCCXADD)
     Builder.defineMacro("__CMPCCXADD__");
   if (HasRAOINT)

diff  --git a/clang/lib/Headers/immintrin.h b/clang/lib/Headers/immintrin.h
index d382ec88f30f7..dff4da2465d27 100644
--- a/clang/lib/Headers/immintrin.h
+++ b/clang/lib/Headers/immintrin.h
@@ -626,7 +626,7 @@ _storebe_i64(void * __P, long long __D) {
 #endif
 
 #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||      \
-    defined(__AMXCOMPLEX__)
+    defined(__AMX_COMPLEX__)
 #include <amxcomplexintrin.h>
 #endif
 

diff  --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c
index a64e5afa7aac3..fd84ea174856a 100644
--- a/clang/test/Preprocessor/predefined-arch-macros.c
+++ b/clang/test/Preprocessor/predefined-arch-macros.c
@@ -1798,6 +1798,7 @@
 // RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_GNR_M32
 // CHECK_GNR_M32: #define __AES__ 1
 // CHECK_GNR_M32: #define __AMX_BF16__ 1
+// CHECK_GNR_M32: #define __AMX_COMPLEX__ 1
 // CHECK_GNR_M32: #define __AMX_FP16__ 1
 // CHECK_GNR_M32: #define __AMX_INT8__ 1
 // CHECK_GNR_M32: #define __AMX_TILE__ 1
@@ -1872,6 +1873,7 @@
 // RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_GNR_M64
 // CHECK_GNR_M64: #define __AES__ 1
 // CHECK_GNR_M64: #define __AMX_BF16__ 1
+// CHECK_GNR_M64: #define __AMX_COMPLEX__ 1
 // CHECK_GNR_M64: #define __AMX_FP16__ 1
 // CHECK_GNR_M64: #define __AMX_INT8__ 1
 // CHECK_GNR_M64: #define __AMX_TILE__ 1

diff  --git a/clang/test/Preprocessor/x86_target_features.c b/clang/test/Preprocessor/x86_target_features.c
index 5bf38cc3b256b..4481351b4e791 100644
--- a/clang/test/Preprocessor/x86_target_features.c
+++ b/clang/test/Preprocessor/x86_target_features.c
@@ -562,14 +562,14 @@
 // RUN: %clang -target x86_64-unknown-linux-gnu -march=x86-64 -mamx-complex -x c \
 // RUN: -E -dM -o - %s | FileCheck  -check-prefix=AMX-COMPLEX %s
 
-// AMX-COMPLEX: #define __AMXCOMPLEX__ 1
+// AMX-COMPLEX: #define __AMX_COMPLEX__ 1
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -march=x86-64 -mno-amx-complex -x c \
 // RUN: -E -dM -o - %s | FileCheck  -check-prefix=NO-AMX-COMPLEX %s
 // RUN: %clang -target x86_64-unknown-linux-gnu -march=x86-64 -mamx-complex -mno-amx-tile \
 // RUN: -x c -E -dM -o - %s | FileCheck  -check-prefix=NO-AMX-COMPLEX %s
 
-// NO-AMX-COMPLEX-NOT: #define __AMXCOMPLEX__ 1
+// NO-AMX-COMPLEX-NOT: #define __AMX_COMPLEX__ 1
 
 // RUN: %clang -target i386-unknown-unknown -march=atom -mavxvnni -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVXVNNI %s
 

diff  --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td
index 7f6399c937aea..1337bc9d9a6da 100644
--- a/llvm/lib/Target/X86/X86.td
+++ b/llvm/lib/Target/X86/X86.td
@@ -1054,7 +1054,8 @@ def ProcessorFeatures {
 
   // Graniterapids
   list<SubtargetFeature> GNRAdditionalFeatures = [FeatureAMXFP16,
-                                                  FeaturePREFETCHI];
+                                                  FeaturePREFETCHI,
+                                                  FeatureAMXCOMPLEX];
   list<SubtargetFeature> GNRFeatures =
     !listconcat(SPRFeatures, GNRAdditionalFeatures);
 

diff  --git a/llvm/lib/TargetParser/X86TargetParser.cpp b/llvm/lib/TargetParser/X86TargetParser.cpp
index 8da45d96a8cc7..82fd181324a74 100644
--- a/llvm/lib/TargetParser/X86TargetParser.cpp
+++ b/llvm/lib/TargetParser/X86TargetParser.cpp
@@ -208,7 +208,8 @@ constexpr FeatureBitset FeaturesSapphireRapids =
     FeatureSERIALIZE | FeatureSHSTK | FeatureTSXLDTRK | FeatureUINTR |
     FeatureWAITPKG;
 constexpr FeatureBitset FeaturesGraniteRapids =
-    FeaturesSapphireRapids | FeatureAMX_FP16 | FeaturePREFETCHI;
+    FeaturesSapphireRapids | FeatureAMX_FP16 | FeaturePREFETCHI |
+    FeatureAMX_COMPLEX;
 
 // Intel Atom processors.
 // Bonnell has feature parity with Core2 and adds MOVBE.


        


More information about the cfe-commits mailing list