[llvm] [PowerPC] Add intrinsics and tests for basic Dense Math enablement instructions (PR #129913)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 5 11:04:54 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-powerpc

Author: None (RolandF77)

<details>
<summary>Changes</summary>

Add intrinsics and tests for Dense Math basic enablement instructions dmsetdmrz, dmmr, dmxor.

---
Full diff: https://github.com/llvm/llvm-project/pull/129913.diff


2 Files Affected:

- (modified) llvm/include/llvm/IR/IntrinsicsPowerPC.td (+10) 
- (modified) llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td (+6-3) 


``````````diff
diff --git a/llvm/include/llvm/IR/IntrinsicsPowerPC.td b/llvm/include/llvm/IR/IntrinsicsPowerPC.td
index 6f49ed39d8a09..af66b8206182e 100644
--- a/llvm/include/llvm/IR/IntrinsicsPowerPC.td
+++ b/llvm/include/llvm/IR/IntrinsicsPowerPC.td
@@ -1644,6 +1644,16 @@ let TargetPrefix = "ppc" in {
   def int_ppc_mma_xxsetaccz :
       DefaultAttrsIntrinsic<[llvm_v512i1_ty], [], [IntrNoMem]>;
 
+  def int_ppc_mma_dmsetdmrz :
+      DefaultAttrsIntrinsic<[llvm_v1024i1_ty], [], [IntrNoMem]>;
+
+  def int_ppc_mma_dmmr :
+      DefaultAttrsIntrinsic<[llvm_v1024i1_ty], [llvm_v1024i1_ty], [IntrNoMem]>;
+
+  def int_ppc_mma_dmxor :
+      DefaultAttrsIntrinsic<[llvm_v1024i1_ty], [llvm_v1024i1_ty,
+                             llvm_v1024i1_ty], [IntrNoMem]>;
+
   // MMA Reduced-Precision: Outer Product Intrinsic Definitions.
   defm int_ppc_mma_xvi4ger8 :
         PowerPC_MMA_ACC_PP_Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty]>;
diff --git a/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td b/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
index 4da2969857d55..b7100462cb967 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrFutureMMA.td
@@ -105,12 +105,15 @@ let Predicates = [IsISAFuture] in {
                                             "dmxxinstfdmr256 $AT, $XBp, $P", []>;
 
   def DMMR : XForm_ATB3<31, 6, 177, (outs dmr:$AT), (ins dmr:$AB),
-                        "dmmr $AT, $AB", []>;
+                        "dmmr $AT, $AB", 
+                        [(set v1024i1:$AT, (int_ppc_mma_dmmr v1024i1:$AB))]>;
 
   def DMXOR : XForm_ATB3<31, 7, 177, (outs dmr:$AT), (ins dmr:$ATi, dmr:$AB),
-                         "dmxor $AT, $AB", []>,
+                         "dmxor $AT, $AB",
+                         [(set v1024i1:$AT, (int_ppc_mma_dmxor v1024i1:$ATi, v1024i1:$AB))]>,
                          RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
 
   def DMSETDMRZ : XForm_AT3<31, 2, 177, (outs dmr:$AT), (ins),
-                            "dmsetdmrz $AT", NoItinerary, []>;
+                            "dmsetdmrz $AT", NoItinerary,
+                            [(set v1024i1:$AT, (int_ppc_mma_dmsetdmrz))]>;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/129913


More information about the llvm-commits mailing list