[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Aug 21 18:28:10 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelDAGToDAG.cpp updated: 1.19 -> 1.20
---
Log message:
Implement stores.
---
Diffs of the changes: (+26 -0)
PPC32ISelDAGToDAG.cpp | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+)
Index: llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.19 llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.20
--- llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp:1.19 Sun Aug 21 19:59:14 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelDAGToDAG.cpp Sun Aug 21 20:27:59 2005
@@ -894,6 +894,32 @@
break;
}
+ case ISD::TRUNCSTORE:
+ case ISD::STORE: {
+ SDOperand AddrOp1, AddrOp2;
+ bool isIdx = SelectAddr(N->getOperand(2), AddrOp1, AddrOp2);
+
+ unsigned Opc;
+ if (N->getOpcode() == ISD::STORE) {
+ switch (N->getOperand(1).getValueType()) {
+ default: assert(0 && "unknown Type in store");
+ case MVT::i32: Opc = isIdx ? PPC::STWX : PPC::STW; break;
+ case MVT::f64: Opc = isIdx ? PPC::STFDX : PPC::STFD; break;
+ case MVT::f32: Opc = isIdx ? PPC::STFSX : PPC::STFS; break;
+ }
+ } else { //ISD::TRUNCSTORE
+ switch(cast<VTSDNode>(N->getOperand(4))->getVT()) {
+ default: assert(0 && "unknown Type in store");
+ case MVT::i1:
+ case MVT::i8: Opc = isIdx ? PPC::STBX : PPC::STB; break;
+ case MVT::i16: Opc = isIdx ? PPC::STHX : PPC::STH; break;
+ }
+ }
+
+ CurDAG->SelectNodeTo(N, MVT::Other, Opc, Select(N->getOperand(1)),
+ AddrOp1, AddrOp2, Select(N->getOperand(0)));
+ break;
+ }
case ISD::RET: {
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
More information about the llvm-commits
mailing list