================
@@ -28773,6 +28774,42 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, 
const X86Subtarget &Subtarget,
       Chain = LockArith.getValue(1);
       return DAG.getMergeValues({getSETCC(CC, LockArith, DL, DAG), Chain}, DL);
     }
+    // ACE Tile Movement Intrinsics - handle both immediate and register index
+    // forms using a single intrinsic. Check if index is constant to select
+    // the appropriate instruction form.
+    case Intrinsic::x86_acev1_tilemovrowinsert:
+    case Intrinsic::x86_acev1_tilemovcolinsert: {
+      SDLoc DL(Op);
+      SDValue Chain = Op.getOperand(0);
+      unsigned TileID = Op.getConstantOperandVal(2);
+      SDValue Src = Op.getOperand(3);
+      SDValue Idx = Op.getOperand(4);
+
+      unsigned PseudoImm, PseudoReg;
+      if (IntNo == Intrinsic::x86_acev1_tilemovrowinsert) {
+        PseudoImm = X86::PTILEMOVROWtri;
+        PseudoReg = X86::PTILEMOVROWtre;
+      } else {
+        PseudoImm = X86::PTILEMOVCOLtri;
+        PseudoReg = X86::PTILEMOVCOLtre;
+      }
+
+      MachineSDNode *Node;
+      // Check if index is a compile-time constant
+      if (auto *CIdx = dyn_cast<ConstantSDNode>(Idx)) {
+        // Use immediate form
+        Node = DAG.getMachineNode(
+            PseudoImm, DL, MVT::Other,
+            {DAG.getTargetConstant(TileID, DL, MVT::i8), Src,
+             DAG.getTargetConstant(CIdx->getZExtValue(), DL, MVT::i8), Chain});
----------------
ganeshgit wrote:

Fixed. Added Sema checks as well for this. 

https://github.com/llvm/llvm-project/pull/208408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to