diff options
| author | Duraid Madina <duraid@octopus.com.au> | 2005-11-04 17:55:53 +0000 |
|---|---|---|
| committer | Duraid Madina <duraid@octopus.com.au> | 2005-11-04 17:55:53 +0000 |
| commit | 31071b74714f1e973df56eb2bb9c5a48aeadc276 (patch) | |
| tree | 210fd4d17dd2b8844b2db8c929e844149eb40b5b | |
| parent | d3260128af60e9d0df90610550dfa5985a6f2e0e (diff) | |
| download | bcm5719-llvm-31071b74714f1e973df56eb2bb9c5a48aeadc276.tar.gz bcm5719-llvm-31071b74714f1e973df56eb2bb9c5a48aeadc276.zip | |
oops, forgot to load GP for indirect calls, though the old code now commented
out failed (e.g. methcall) - now the code compiles, though it's not quite
right just yet (tm) ;)
would fix this but it's 3am! :O
llvm-svn: 24186
| -rw-r--r-- | llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp index 129d381636a..902c38235bb 100644 --- a/llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp +++ b/llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp @@ -185,23 +185,40 @@ SDOperand IA64DAGToDAGISel::SelectCALL(SDOperand Op) { } else { // otherwise we need to load the function descriptor, // load the branch target (function)'s entry point and GP, - // branch (call) then restore the - // GP + // branch (call) then restore the GP SDOperand FnDescriptor = Select(N->getOperand(1)); // load the branch target's entry point [mem] and // GP value [mem+8] + SDOperand targetEntryPoint=CurDAG->getTargetNode(IA64::LD8, MVT::i64, + FnDescriptor); + Chain = targetEntryPoint.getValue(1); + SDOperand targetGPAddr=CurDAG->getTargetNode(IA64::ADDS, MVT::i64, + FnDescriptor, CurDAG->getConstant(8, MVT::i64)); + Chain = targetGPAddr.getValue(1); + SDOperand targetGP=CurDAG->getTargetNode(IA64::LD8, MVT::i64, + targetGPAddr); + Chain = targetGP.getValue(1); + +/* FIXME! (methcall still fails) SDOperand targetEntryPoint=CurDAG->getLoad(MVT::i64, Chain, FnDescriptor, CurDAG->getSrcValue(0)); SDOperand targetGPAddr=CurDAG->getNode(ISD::ADD, MVT::i64, FnDescriptor, CurDAG->getConstant(8, MVT::i64)); SDOperand targetGP=CurDAG->getLoad(MVT::i64, Chain, targetGPAddr, - CurDAG->getSrcValue(0)); + CurDAG->getSrcValue(0)); + */ + + // Copy the callee GP into r1 + SDOperand r1 = CurDAG->getRegister(IA64::r1, MVT::i64); + Chain = CurDAG->getNode(ISD::CopyToReg, MVT::i64, Chain, r1, + targetGP); + // Copy the callee address into the b6 branch register SDOperand B6 = CurDAG->getRegister(IA64::B6, MVT::i64); - Chain = CurDAG->getNode(ISD::CopyToReg, MVT::Other, Chain, B6, + Chain = CurDAG->getNode(ISD::CopyToReg, MVT::i64, Chain, B6, targetEntryPoint); CallOperands.push_back(B6); |

