From: Chris Lattner Date: Thu, 25 Aug 2005 05:04:11 +0000 (+0000) Subject: Implement support for taking the address of constant pool indices, which X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=34e17052a77e1a52cae58b2f6d203c663af97ece;p=oota-llvm.git Implement support for taking the address of constant pool indices, which is used by the int -> FP code among other things. This gets 2005-05-12-Int64ToFP past that failure, to dying on lack of support for add_parts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23042 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 62fe16537e6..0ed454033bb 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -557,6 +557,16 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) { getI32Imm(0)); break; } + case ISD::ConstantPool: { + unsigned CPIIdx = cast(N)->getIndex(); + SDOperand Tmp, CPI = CurDAG->getTargetConstantPool(CPIIdx, MVT::i32); + if (PICEnabled) + Tmp = CurDAG->getTargetNode(PPC::ADDIS, MVT::i32, getGlobalBaseReg(),CPI); + else + Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, CPI); + CurDAG->SelectNodeTo(N, MVT::i32, PPC::LA, Tmp, CPI); + break; + } case ISD::GlobalAddress: { GlobalValue *GV = cast(N)->getGlobal(); SDOperand Tmp;