aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-22 01:27:59 +0000
committerChris Lattner <sabre@nondot.org>2005-08-22 01:27:59 +0000
commitf7f22555053a8992b2f97db77a62458ff8a69d7f (patch)
treeacc6aa01a202f09785d7b75603ffe0d160d24977
parent23553cfb4a7f859e0dbfef2f9fb739526bad8984 (diff)
Implement stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22963 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCISelDAGToDAG.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 8e3e89c757..d949bce741 100644
--- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -894,6 +894,32 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
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.