diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-17 22:30:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-17 22:30:00 +0000 |
commit | ee3d5fba54c658382926cbd40ef471245b61b19c (patch) | |
tree | 5c6a98b341e5acd781aa778a598914cd3ee2a97b /lib/Target/Sparc | |
parent | 37949f5c2b48c128e31361f638fdd44c966ee4d0 (diff) |
implement MULHU/MULHS for 64-bit multiplies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 0e9210dcfe..5d60a1bf5e 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -278,6 +278,17 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) { switch (N->getOpcode()) { default: break; + case ISD::MULHU: + case ISD::MULHS: { + SDOperand MulLHS = Select(N->getOperand(0)); + SDOperand MulRHS = Select(N->getOperand(1)); + unsigned Opcode = N->getOpcode() == ISD::MULHU ? V8::UMULrr : V8::SMULrr; + SDOperand Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag, + MulLHS, MulRHS); + // The high part is in the Y register. + return CurDAG->SelectNodeTo(N, V8::RDY, MVT::i32, Mul.getValue(1)); + } + case ISD::RET: { if (N->getNumOperands() == 2) { SDOperand Chain = Select(N->getOperand(0)); // Token chain. |