[llvm] 3586588 - [NFCI][AMDGPU] Add `FeatureMadMacF32Insts` to all R600 processors (#177509)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 23 05:54:18 PST 2026


Author: Shilei Tian
Date: 2026-01-23T08:54:13-05:00
New Revision: 3586588cc9d0b9b76ce8370505db4d5dbf1d5b70

URL: https://github.com/llvm/llvm-project/commit/3586588cc9d0b9b76ce8370505db4d5dbf1d5b70
DIFF: https://github.com/llvm/llvm-project/commit/3586588cc9d0b9b76ce8370505db4d5dbf1d5b70.diff

LOG: [NFCI][AMDGPU] Add `FeatureMadMacF32Insts` to all R600 processors (#177509)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
    llvm/lib/Target/AMDGPU/R600Processors.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
index 09df36e953129..7882df23b9b20 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
@@ -26,9 +26,6 @@
 //   bool HasXXX = false;                      // member declaration
 //   bool hasXXX() const { return HasXXX; }    // getter
 //
-// AMDGPU_SUBTARGET_HAS_FEATURE_MEMBER_ONLY: Features with member only
-//   bool HasXXX = false;                      // member declaration only
-//
 // AMDGPU_SUBTARGET_ENABLE_FEATURE_MEMBER_ONLY: Features with member only
 //   bool EnableXXX = false;                   // member declaration only
 //
@@ -46,12 +43,11 @@
 // to GCNSubtarget.h instead.
 //===----------------------------------------------------------------------===//
 
-#define AMDGPU_SUBTARGET_HAS_FEATURE_MEMBER_ONLY(X) X(MadMacF32Insts)
-
 #define AMDGPU_SUBTARGET_HAS_FEATURE(X)                                        \
   X(16BitInsts)                                                                \
   X(FastFMAF32)                                                                \
   X(Inv2PiInlineImm)                                                           \
+  X(MadMacF32Insts)                                                            \
   X(SDWA)                                                                      \
   X(True16BitInsts)                                                            \
   X(VOP3PInsts)
@@ -97,7 +93,6 @@ class AMDGPUSubtarget {
 
 #define DECL_HAS_MEMBER(Name) bool Has##Name = false;
   AMDGPU_SUBTARGET_HAS_FEATURE(DECL_HAS_MEMBER)
-  AMDGPU_SUBTARGET_HAS_FEATURE_MEMBER_ONLY(DECL_HAS_MEMBER)
 #undef DECL_HAS_MEMBER
 #undef AMDGPU_SUBTARGET_HAS_FEATURE_MEMBER_ONLY
 
@@ -253,10 +248,6 @@ class AMDGPUSubtarget {
 
   bool hasD16Writes32BitVgpr() const;
 
-  bool hasMadMacF32Insts() const {
-    return HasMadMacF32Insts || !isGCN();
-  }
-
   bool hasMulI24() const {
     return HasMulI24;
   }

diff  --git a/llvm/lib/Target/AMDGPU/R600Processors.td b/llvm/lib/Target/AMDGPU/R600Processors.td
index 0265a976c9825..d30228b6970dd 100644
--- a/llvm/lib/Target/AMDGPU/R600Processors.td
+++ b/llvm/lib/Target/AMDGPU/R600Processors.td
@@ -40,26 +40,32 @@ def FeatureCFALUBug : SubtargetFeature<"cfalubug",
   "GPU has CF_ALU bug"
 >;
 
+def FeatureMadMacF32Insts : SubtargetFeature<"mad-mac-f32-insts",
+  "HasMadMacF32Insts",
+  "true",
+  "Has v_mad_f32/v_mac_f32/v_madak_f32/v_madmk_f32 instructions"
+>;
+
 class R600SubtargetFeatureGeneration <string Value, string FeatureName,
                                   list<SubtargetFeature> Implies> :
         SubtargetFeatureGeneration <Value, FeatureName, "R600Subtarget", Implies>;
 
 def FeatureR600 : R600SubtargetFeatureGeneration<"R600", "r600",
-  [FeatureR600ALUInst, FeatureFetchLimit8]
+  [FeatureR600ALUInst, FeatureFetchLimit8, FeatureMadMacF32Insts]
 >;
 
 def FeatureR700 : R600SubtargetFeatureGeneration<"R700", "r700",
-  [FeatureFetchLimit16]
+  [FeatureFetchLimit16, FeatureMadMacF32Insts]
 >;
 
 def FeatureEvergreen : R600SubtargetFeatureGeneration<"EVERGREEN", "evergreen",
-  [FeatureFetchLimit16, FeatureAddressableLocalMemorySize32768]
+  [FeatureFetchLimit16, FeatureAddressableLocalMemorySize32768, FeatureMadMacF32Insts]
 >;
 
 def FeatureNorthernIslands : R600SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
   "northern-islands",
   [FeatureFetchLimit16, FeatureWavefrontSize64,
-   FeatureAddressableLocalMemorySize32768]
+   FeatureAddressableLocalMemorySize32768, FeatureMadMacF32Insts]
 >;
 
 


        


More information about the llvm-commits mailing list