diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-02-07 23:02:23 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-02-07 23:02:23 +0000 |
commit | 760270da519f87a4edc2cf3ada69f0f4e543ef1c (patch) | |
tree | 2ff7d363f01a5e8c6fc9a39ca88b5b93591e1eac /lib/Target/Alpha/AlphaISelPattern.cpp | |
parent | bcc70bcb258d9078f4edccfd7b19b2ab55e57d4b (diff) |
fix store issue and an FP conversion (segfault) issue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelPattern.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelPattern.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp index a173fa3793..ccc10d3fde 100644 --- a/lib/Target/Alpha/AlphaISelPattern.cpp +++ b/lib/Target/Alpha/AlphaISelPattern.cpp @@ -1164,14 +1164,16 @@ unsigned ISel::SelectExpr(SDOperand N) { void ISel::Select(SDOperand N) { unsigned Tmp1, Tmp2, Opc; + unsigned opcode = N.getOpcode(); // FIXME: Disable for our current expansion model! if (/*!N->hasOneUse() &&*/ !ExprMap.insert(std::make_pair(N, notIn)).second) return; // Already selected. SDNode *Node = N.Val; + - switch (N.getOpcode()) { + switch (opcode) { default: Node->dump(); std::cerr << "\n"; @@ -1267,16 +1269,24 @@ void ISel::Select(SDOperand N) { Select(Chain); Tmp1 = SelectExpr(Value); //value - switch(Value.getValueType()) { - default: assert(0 && "unknown Type in store"); - case MVT::i64: Opc = Alpha::STQ; break; - case MVT::f64: Opc = Alpha::STT; break; - case MVT::f32: Opc = Alpha::STS; break; - case MVT::i1: //FIXME: DAG does not promote this load - case MVT::i8: Opc = Alpha::STB; break; - case MVT::i16: Opc = Alpha::STW; break; - case MVT::i32: Opc = Alpha::STL; break; + + if (opcode == ISD::STORE) { + switch(Value.getValueType()) { + default: assert(0 && "unknown Type in store"); + case MVT::i64: Opc = Alpha::STQ; break; + case MVT::f64: Opc = Alpha::STT; break; + case MVT::f32: Opc = Alpha::STS; break; + } + } else { //ISD::TRUNCSTORE + switch(cast<MVTSDNode>(Node)->getExtraValueType()) { + default: assert(0 && "unknown Type in store"); + case MVT::i1: //FIXME: DAG does not promote this load + case MVT::i8: Opc = Alpha::STB; break; + case MVT::i16: Opc = Alpha::STW; break; + case MVT::i32: Opc = Alpha::STL; break; + } } + if (Address.getOpcode() == ISD::GlobalAddress) { AlphaLowering.restoreGP(BB); |