[PATCH] D34423: Create TD nodes for ADDCARRY and SUBCARRY opcodes

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 15:11:14 PDT 2017


rampitec created this revision.
Herald added a subscriber: wdng.

These are nodes for newly added ISD opcodes ADDCARRY and SUBCARRY.
They are going to be first used in https://reviews.llvm.org/D34300 instead of those defined in target.


Repository:
  rL LLVM

https://reviews.llvm.org/D34423

Files:
  include/llvm/Target/TargetSelectionDAG.td


Index: include/llvm/Target/TargetSelectionDAG.td
===================================================================
--- include/llvm/Target/TargetSelectionDAG.td
+++ include/llvm/Target/TargetSelectionDAG.td
@@ -156,6 +156,11 @@
 def SDTFPToIntOp : SDTypeProfile<1, 1, [    // fp_to_[su]int
   SDTCisInt<0>, SDTCisFP<1>, SDTCisSameNumEltsAs<0, 1>
 ]>;
+
+def SDTCarryOp : SDTypeProfile<2, 3, [      // addcarry, subcarry
+  SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<0>, SDTCisVT<1, i1>, SDTCisVT<4, i1>
+]>;
+
 def SDTExtInreg : SDTypeProfile<1, 2, [     // sext_inreg
   SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisVT<2, OtherVT>,
   SDTCisVTSmallerThanOp<2, 1>
@@ -394,10 +399,12 @@
                         [SDNPCommutative, SDNPAssociative]>;
 def addc       : SDNode<"ISD::ADDC"      , SDTIntBinOp,
                         [SDNPCommutative, SDNPOutGlue]>;
+def addcarry   : SDNode<"ISD::ADDCARRY"  , SDTCarryOp>;
 def adde       : SDNode<"ISD::ADDE"      , SDTIntBinOp,
                         [SDNPCommutative, SDNPOutGlue, SDNPInGlue]>;
 def subc       : SDNode<"ISD::SUBC"      , SDTIntBinOp,
                         [SDNPOutGlue]>;
+def subcarry   : SDNode<"ISD::SUBCARRY"  , SDTCarryOp>;
 def sube       : SDNode<"ISD::SUBE"      , SDTIntBinOp,
                         [SDNPOutGlue, SDNPInGlue]>;
 def smin       : SDNode<"ISD::SMIN"      , SDTIntBinOp,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34423.103272.patch
Type: text/x-patch
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170620/d84056d3/attachment.bin>


More information about the llvm-commits mailing list