[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
Nate Begeman
natebegeman at mac.com
Thu Aug 25 17:28:12 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelDAGToDAG.cpp updated: 1.35 -> 1.36
---
Log message:
Implement SHL_PARTS and SRL_PARTS
---
Diffs of the changes: (+38 -0)
PPC32ISelDAGToDAG.cpp | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+)
Index: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.35 llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.36
--- llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.35 Thu Aug 25 18:36:49 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp Thu Aug 25 19:28:00 2005
@@ -1184,6 +1184,44 @@
CurDAG->ReplaceAllUsesWith(N, Result);
return Result[Op.ResNo];
}
+ case ISD::SHL_PARTS: {
+ SDOperand HI = Select(N->getOperand(0));
+ SDOperand LO = Select(N->getOperand(1));
+ SDOperand SH = Select(N->getOperand(2));
+ SDOperand SH_LO_R = CurDAG->getTargetNode(PPC::SUBFIC, MVT::i32, SH,
+ getI32Imm(32));
+ SDOperand SH_LO_L = CurDAG->getTargetNode(PPC::ADDI, MVT::i32, SH,
+ getI32Imm((unsigned)-32));
+ SDOperand HI_SHL = CurDAG->getTargetNode(PPC::SLW, MVT::i32, HI, SH);
+ SDOperand HI_LOR = CurDAG->getTargetNode(PPC::SRW, MVT::i32, LO, SH_LO_R);
+ SDOperand HI_LOL = CurDAG->getTargetNode(PPC::SLW, MVT::i32, LO, SH_LO_L);
+ SDOperand HI_OR = CurDAG->getTargetNode(PPC::OR, MVT::i32, HI_SHL, HI_LOR);
+
+ std::vector<SDOperand> Result;
+ Result.push_back(CurDAG->getTargetNode(PPC::SLW, MVT::i32, LO, SH));
+ Result.push_back(CurDAG->getTargetNode(PPC::OR, MVT::i32, HI_OR, HI_LOL));
+ CurDAG->ReplaceAllUsesWith(N, Result);
+ return Result[Op.ResNo];
+ }
+ case ISD::SRL_PARTS: {
+ SDOperand HI = Select(N->getOperand(0));
+ SDOperand LO = Select(N->getOperand(1));
+ SDOperand SH = Select(N->getOperand(2));
+ SDOperand SH_HI_L = CurDAG->getTargetNode(PPC::SUBFIC, MVT::i32, SH,
+ getI32Imm(32));
+ SDOperand SH_HI_R = CurDAG->getTargetNode(PPC::ADDI, MVT::i32, SH,
+ getI32Imm((unsigned)-32));
+ SDOperand LO_SHR = CurDAG->getTargetNode(PPC::SRW, MVT::i32, LO, SH);
+ SDOperand LO_HIL = CurDAG->getTargetNode(PPC::SLW, MVT::i32, HI, SH_HI_L);
+ SDOperand LO_HIR = CurDAG->getTargetNode(PPC::SRW, MVT::i32, HI, SH_HI_R);
+ SDOperand LO_OR = CurDAG->getTargetNode(PPC::OR, MVT::i32, LO_SHR, LO_HIL);
+
+ std::vector<SDOperand> Result;
+ Result.push_back(CurDAG->getTargetNode(PPC::OR, MVT::i32, LO_OR, LO_HIR));
+ Result.push_back(CurDAG->getTargetNode(PPC::SRW, MVT::i32, HI, SH));
+ CurDAG->ReplaceAllUsesWith(N, Result);
+ return Result[Op.ResNo];
+ }
case ISD::LOAD:
case ISD::EXTLOAD:
More information about the llvm-commits
mailing list