Skip to content

Conversation

lei137
Copy link
Contributor

@lei137 lei137 commented Sep 3, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2025

@llvm/pr-subscribers-backend-powerpc

Author: Lei Huang (lei137)

Changes

Patch is 37.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156749.diff

1 Files Affected:

  • (modified) llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td (+296-294)
diff --git a/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td b/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
index 94af8a65b8228..a3a75c0e41468 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
@@ -14,7 +14,7 @@
 
 class XX3Form_AT3_XABp5_P1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
                            string asmstr, list<dag> pattern>
-  : I<opcode, OOL, IOL, asmstr, NoItinerary> {
+    : I<opcode, OOL, IOL, asmstr, NoItinerary> {
   bits<3> AT;
   bits<5> XAp;
   bits<5> XBp;
@@ -22,13 +22,13 @@ class XX3Form_AT3_XABp5_P1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
 
   let Pattern = pattern;
 
-  let Inst{6-8} = AT{2-0};
-  let Inst{9-10} = 0;
-  let Inst{11-14} = XAp{3-0};
+  let Inst{6 -8} = AT{2 -0};
+  let Inst{9 -10} = 0;
+  let Inst{11 -14} = XAp{3 -0};
   let Inst{15} = P;
-  let Inst{16-19} = XBp{3-0};
+  let Inst{16 -19} = XBp{3 -0};
   let Inst{20} = 0;
-  let Inst{21-28} = xo;
+  let Inst{21 -28} = xo;
   let Inst{29} = XAp{4};
   let Inst{30} = XBp{4};
   let Inst{31} = 0;
@@ -36,65 +36,64 @@ class XX3Form_AT3_XABp5_P1<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
 
 class XX2Form_AT3_XBp5_P2<bits<6> opcode, bits<9> xo, dag OOL, dag IOL,
                           string asmstr, list<dag> pattern>
-  : I<opcode, OOL, IOL, asmstr, NoItinerary> {
+    : I<opcode, OOL, IOL, asmstr, NoItinerary> {
   bits<3> AT;
   bits<5> XBp;
   bits<2> P;
 
   let Pattern = pattern;
 
-  let Inst{6-8} = AT{2-0};
-  let Inst{9-14} = 0;
+  let Inst{6 -8} = AT{2 -0};
+  let Inst{9 -14} = 0;
   let Inst{15} = P{0};
-  let Inst{16-19} = XBp{3-0};
+  let Inst{16 -19} = XBp{3 -0};
   let Inst{20} = P{1};
-  let Inst{21-29} = xo;
+  let Inst{21 -29} = xo;
   let Inst{30} = XBp{4};
   let Inst{31} = 0;
 }
 
 class XForm_ATB3<bits<6> opcode, bits<5> o, bits<10> xo, dag OOL, dag IOL,
                  string asmstr, list<dag> pattern>
-  : I <opcode, OOL, IOL, asmstr, NoItinerary> {
+    : I<opcode, OOL, IOL, asmstr, NoItinerary> {
   bits<3> AT;
   bits<3> AB;
 
   let Pattern = pattern;
 
-  let Inst{6-8} = AT{2-0};
-  let Inst{9-10} = 0;
-  let Inst{11-15} = o;
-  let Inst{16-18} = AB{2-0};
-  let Inst{19-20} = 0;
-  let Inst{21-30} = xo;
+  let Inst{6 -8} = AT{2 -0};
+  let Inst{9 -10} = 0;
+  let Inst{11 -15} = o;
+  let Inst{16 -18} = AB{2 -0};
+  let Inst{19 -20} = 0;
+  let Inst{21 -30} = xo;
   let Inst{31} = 0;
 }
 
 class XX3Form_AT3_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
-                           string asmstr, InstrItinClass itin,
-                           list<dag> pattern>
-  : I<opcode, OOL, IOL, asmstr, itin> {
+                         string asmstr, InstrItinClass itin, list<dag> pattern>
+    : I<opcode, OOL, IOL, asmstr, itin> {
   bits<3> AT;
   bits<5> XAp;
   bits<6> XB;
 
   let Pattern = pattern;
 
-  let Inst{6-8} = AT;
-  let Inst{9-10} = 0;
-  let Inst{11-14} = XAp{3-0};
+  let Inst{6 -8} = AT;
+  let Inst{9 -10} = 0;
+  let Inst{11 -14} = XAp{3 -0};
   let Inst{15} = 0;
-  let Inst{16-20} = XB{4-0};
-  let Inst{21-28} = xo;
-  let Inst{29}    = XAp{4};
-  let Inst{30}    = XB{5};
+  let Inst{16 -20} = XB{4 -0};
+  let Inst{21 -28} = xo;
+  let Inst{29} = XAp{4};
+  let Inst{30} = XB{5};
   let Inst{31} = 0;
 }
 
 class MMIRR_XX3Form_X8YP4_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
                                  string asmstr, InstrItinClass itin,
                                  list<dag> pattern>
-  : PI<1, opcode, OOL, IOL, asmstr, itin> {
+    : PI<1, opcode, OOL, IOL, asmstr, itin> {
   bits<3> AT;
   bits<5> XAp;
   bits<6> XB;
@@ -105,29 +104,29 @@ class MMIRR_XX3Form_X8YP4_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
   let Pattern = pattern;
 
   // The prefix.
-  let Inst{6-7} = 3;
-  let Inst{8-11} = 9;
-  let Inst{12-15} = 0;
-  let Inst{16-19} = PMSK;
-  let Inst{20-27} = XMSK;
-  let Inst{28-31} = YMSK;
+  let Inst{6 -7} = 3;
+  let Inst{8 -11} = 9;
+  let Inst{12 -15} = 0;
+  let Inst{16 -19} = PMSK;
+  let Inst{20 -27} = XMSK;
+  let Inst{28 -31} = YMSK;
 
   // The instruction.
-  let Inst{38-40} = AT;
-  let Inst{41-42} = 0;
-  let Inst{43-46} = XAp{3-0};
+  let Inst{38 -40} = AT;
+  let Inst{41 -42} = 0;
+  let Inst{43 -46} = XAp{3 -0};
   let Inst{47} = 0;
-  let Inst{48-52} = XB{4-0};
-  let Inst{53-60} = xo;
+  let Inst{48 -52} = XB{4 -0};
+  let Inst{53 -60} = xo;
   let Inst{61} = XAp{4};
   let Inst{62} = XB{5};
   let Inst{63} = 0;
 }
 
 class MMIRR_XX3Form_X8Y4P2_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
-                                 string asmstr, InstrItinClass itin,
-                                 list<dag> pattern>
-  : PI<1, opcode, OOL, IOL, asmstr, itin> {
+                                  string asmstr, InstrItinClass itin,
+                                  list<dag> pattern>
+    : PI<1, opcode, OOL, IOL, asmstr, itin> {
   bits<3> AT;
   bits<5> XAp;
   bits<6> XB;
@@ -138,21 +137,21 @@ class MMIRR_XX3Form_X8Y4P2_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
   let Pattern = pattern;
 
   // The prefix.
-  let Inst{6-7} = 3;
-  let Inst{8-11} = 9;
-  let Inst{12-15} = 0;
-  let Inst{16-17} = PMSK;
-  let Inst{18-19} = 0;
-  let Inst{20-27} = XMSK;
-  let Inst{28-31} = YMSK;
+  let Inst{6 -7} = 3;
+  let Inst{8 -11} = 9;
+  let Inst{12 -15} = 0;
+  let Inst{16 -17} = PMSK;
+  let Inst{18 -19} = 0;
+  let Inst{20 -27} = XMSK;
+  let Inst{28 -31} = YMSK;
 
   // The instruction.
-  let Inst{38-40} = AT;
-  let Inst{41-42} = 0;
-  let Inst{43-46} = XAp{3-0};
+  let Inst{38 -40} = AT;
+  let Inst{41 -42} = 0;
+  let Inst{43 -46} = XAp{3 -0};
   let Inst{47} = 0;
-  let Inst{48-52} = XB{4-0};
-  let Inst{53-60} = xo;
+  let Inst{48 -52} = XB{4 -0};
+  let Inst{53 -60} = xo;
   let Inst{61} = XAp{4};
   let Inst{62} = XB{5};
   let Inst{63} = 0;
@@ -161,14 +160,15 @@ class MMIRR_XX3Form_X8Y4P2_XAp5B6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL,
 multiclass DMR_UM_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
                        string asmstr> {
   let Predicates = [MMA, IsISAFuture] in {
-  def NAME :
-    XX3Form_AT3_XAp5B6<opcode, !or(xo, 0x01), (outs dmr:$AT), IOL,
-                     !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
-    RegConstraint<"@earlyclobber $AT">;
-  def PP :
-    XX3Form_AT3_XAp5B6<opcode, xo, (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-                     !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def NAME
+        : XX3Form_AT3_XAp5B6<opcode, !or(xo, 0x01), (outs dmr:$AT), IOL,
+                             !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"@earlyclobber $AT">;
+    def PP
+        : XX3Form_AT3_XAp5B6<opcode, xo, (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
@@ -176,202 +176,217 @@ multiclass DMR_UM_M448_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
                             string asmstr> {
   defm NAME : DMR_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
   let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
-  def PM#NAME :
-    MMIRR_XX3Form_X8YP4_XAp5B6<
-      opcode, !or(xo, 0x01), (outs dmr:$AT),
-      !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK)),
-      !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"@earlyclobber $AT">;
-  def PM#NAME#PP :
-    MMIRR_XX3Form_X8YP4_XAp5B6<
-      opcode, xo, (outs dmr:$AT),
-      !con((ins dmr:$ATi),
-           !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK))),
-      !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def PM#NAME
+        : MMIRR_XX3Form_X8YP4_XAp5B6<
+              opcode, !or(xo, 0x01), (outs dmr:$AT),
+              !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK)),
+              !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"@earlyclobber $AT">;
+    def PM#NAME#PP
+        : MMIRR_XX3Form_X8YP4_XAp5B6<
+              opcode, xo, (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK))),
+              !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
 multiclass DMR_BF16_UM_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
-                       string asmstr> {
+                            string asmstr> {
   let Predicates = [MMA, IsISAFuture] in {
-  def NAME :
-    XX3Form_AT3_XAp5B6<opcode, !or(xo, 0x11), (outs dmr:$AT), IOL,
-                     !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
-    RegConstraint<"@earlyclobber $AT">;
-  def PP :
-    XX3Form_AT3_XAp5B6<opcode, xo, (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-                     !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def NAME
+        : XX3Form_AT3_XAp5B6<opcode, !or(xo, 0x11), (outs dmr:$AT), IOL,
+                             !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"@earlyclobber $AT">;
+    def PP
+        : XX3Form_AT3_XAp5B6<opcode, xo, (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
-multiclass DMR_BF16_UM_M284_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
-                            string asmstr> {
+multiclass DMR_BF16_UM_M284_XOEO<bits<6> opcode, bits<8> xo, dag IOL,
+                                 string asmbase, string asmstr> {
   defm NAME : DMR_BF16_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
   let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
-  def PM#NAME :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !or(xo, 0x11), (outs dmr:$AT),
-      !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
-      !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"@earlyclobber $AT">;
-  def PM#NAME#PP :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, xo, (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def PM#NAME
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !or(xo, 0x11), (outs dmr:$AT),
+              !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
+              !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"@earlyclobber $AT">;
+    def PM#NAME#PP
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, xo, (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
-multiclass DMR_F16_UM_M284_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
-                            string asmstr> {
+multiclass DMR_F16_UM_M284_XOEO<bits<6> opcode, bits<8> xo, dag IOL,
+                                string asmbase, string asmstr> {
   defm NAME : DMR_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
   let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
-  def PM#NAME :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !or(xo, 0x01), (outs dmr:$AT),
-      !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
-      !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"@earlyclobber $AT">;
-  def PM#NAME#PP :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, xo, (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def PM#NAME
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !or(xo, 0x01), (outs dmr:$AT),
+              !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
+              !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"@earlyclobber $AT">;
+    def PM#NAME#PP
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, xo, (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
 multiclass DMR_NEG_UM_M284_XOXORf939a0<bits<6> opcode, bits<8> xo, dag IOL,
-                                  string asmbase, string asmstr> {
+                                       string asmbase, string asmstr> {
   defm NAME : DMR_BF16_UM_M284_XOEO<opcode, xo, IOL, asmbase, asmstr>;
   let Predicates = [MMA, IsISAFuture] in {
-  def PN : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0xF9), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
-  def NP : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0x39), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
-  def NN : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0xA0), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
+    def PN
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0xF9), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def NP
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0x39), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def NN
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0xA0), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
   let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
-   def PM#NAME#PN :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0xF9), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
-  def PM#NAME#NP :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0x39), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
-  def PM#NAME#NN :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0xA0), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def PM#NAME#PN
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !xor(xo, 0xF9), (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def PM#NAME#NP
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !xor(xo, 0x39), (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def PM#NAME#NN
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !xor(xo, 0xA0), (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
 }
 
 multiclass DMR_NEG_UM_M284_XOXORd11188<bits<6> opcode, bits<8> xo, dag IOL,
-                                  string asmbase, string asmstr> {
+                                       string asmbase, string asmstr> {
   defm NAME : DMR_F16_UM_M284_XOEO<opcode, xo, IOL, asmbase, asmstr>;
   let Predicates = [MMA, IsISAFuture] in {
-  def PN : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0xD1), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
-  def NP : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0x11), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
-  def NN : XX3Form_AT3_XAp5B6<
-             opcode, !xor(xo, 0x88), (outs dmr:$AT), !con((ins dmr:$ATi), IOL),
-             !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
-           RegConstraint<"$ATi = $AT">;
+    def PN
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0xD1), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def NP
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0x11), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def NN
+        : XX3Form_AT3_XAp5B6<opcode, !xor(xo, 0x88), (outs dmr:$AT),
+                             !con((ins dmr:$ATi), IOL),
+                             !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
   }
   let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
-   def PM#NAME#PN :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0xD1), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
-  def PM#NAME#NP :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0x11), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
-  def PM#NAME#NN :
-    MMIRR_XX3Form_X8Y4P2_XAp5B6<
-      opcode, !xor(xo, 0x88), (outs dmr:$AT),
-      !con((ins dmr:$ATi), !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
-      !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK, $PMSK"),
-      IIC_VecFP, []>,
-    RegConstraint<"$ATi = $AT">;
+    def PM#NAME#PN
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !xor(xo, 0xD1), (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+    def PM#NAME#NP
+        : MMIRR_XX3Form_X8Y4P2_XAp5B6<
+              opcode, !xor(xo, 0x11), (outs dmr:$AT),
+              !con((ins dmr:$ATi),
+                   !con(IOL, (ins u8imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
+              !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
+              IIC_VecFP, []>,
+          RegConstraint<"$ATi = $AT">;
+  ...
[truncated]

@lei137 lei137 merged commit 1b12bc4 into llvm:main Sep 3, 2025
11 checks passed
@lei137 lei137 deleted the clangfmtPPCInstrFutureMMA branch September 3, 2025 22:25
Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which clang-format version did you use? Last time I tried it only made formatting worse.
I'm impressed with the current result.

let Inst{6-8} = AT{2-0};
let Inst{9-10} = 0;
let Inst{11-14} = XAp{3-0};
let Inst{6 -8} = AT{2 -0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While here, maybe replace deprecated '-' with the modern '...'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the clang-format that is built with latest ToT.

Sorry I only saw your message after I merged. I didn't know '-' have been deprecated, this is used in all the PPC td files. Can you please point me to the PR that deprecates this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please point me to the PR that deprecates this?

196e6f9

PPC backend is much older than this change, but if you're going to reformat all files, maybe it is a good time to modernize the syntax...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't planning to do all. Just did this one as I had to refactor it. Is there plans to remove '-' as the range list specifier?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there plans to remove '-' as the range list specifier?

I'm not aware of such plans, but I think it is not going to happen in our time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ckoparkar added a commit to ckoparkar/llvm-project that referenced this pull request Sep 4, 2025
* main: (1483 commits)
  [clang] fix error recovery for invalid nested name specifiers (llvm#156772)
  Revert "[lldb] Add count for errors of DWO files in statistics and combine DWO file count functions" (llvm#156777)
  AMDGPU: Add agpr variants of multi-data DS instructions (llvm#156420)
  [libc][NFC] disable localtime on aarch64/baremetal (llvm#156776)
  [win/asan] Improve SharedReAlloc with HEAP_REALLOC_IN_PLACE_ONLY. (llvm#132558)
  [LLDB] Make internal shell the default for running LLDB lit tests. (llvm#156729)
  [lldb][debugserver] Max response size for qSpeedTest (llvm#156099)
  [AMDGPU] Define 1024 VGPRs on gfx1250 (llvm#156765)
  [flang] Check for BIND(C) name conflicts with alternate entries (llvm#156563)
  [RISCV] Add exhausted_gprs_fprs test to calling-conv-half.ll. NFC (llvm#156586)
  [NFC] Remove trailing whitespaces from `clang/include/clang/Basic/AttrDocs.td`
  [lldb] Mark scripted frames as synthetic instead of artificial (llvm#153117)
  [docs] Refine some of the wording in the quality developer policy (llvm#156555)
  [MLIR] Apply clang-tidy fixes for readability-identifier-naming in TransformOps.cpp (NFC)
  [MLIR] Add LDBG() tracing to VectorTransferOpTransforms.cpp (NFC)
  [NFC] Apply clang-format to PPCInstrFutureMMA.td (llvm#156749)
  [libc] implement template functions for localtime (llvm#110363)
  [llvm-objcopy][COFF] Update .symidx values after stripping (llvm#153322)
  Add documentation on debugging LLVM.
  [lldb] Add count for errors of DWO files in statistics and combine DWO file count functions (llvm#155023)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants