[llvm-commits] [llvm] r43314 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Dale Johannesen dalej at apple.com
Wed Oct 24 15:26:08 PDT 2007


Author: johannes
Date: Wed Oct 24 17:26:08 2007
New Revision: 43314

URL: http://llvm.org/viewvc/llvm-project?rev=43314&view=rev
Log:
Another expansion for i64 multiply, suitable for PPC.


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=43314&r1=43313&r2=43314&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Oct 24 17:26:08 2007
@@ -5930,6 +5930,15 @@
         Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
         break;
       }
+      if (HasMULHU) {
+        Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
+        Hi = DAG.getNode(ISD::MULHU, NVT, LL, RL);
+        RH = DAG.getNode(ISD::MUL, NVT, LL, RH);
+        LH = DAG.getNode(ISD::MUL, NVT, LH, RL);
+        Hi = DAG.getNode(ISD::ADD, NVT, Hi, RH);
+        Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
+        break;
+      }
     }
 
     // If nothing else, we can make a libcall.





More information about the llvm-commits mailing list