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
This commit is contained in:
Chris Lattner 2005-08-25 05:04:11 +00:00
parent 4025a9c2cc
commit 34e17052a7

View File

@ -557,6 +557,16 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
getI32Imm(0));
break;
}
case ISD::ConstantPool: {
unsigned CPIIdx = cast<ConstantPoolSDNode>(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<GlobalAddressSDNode>(N)->getGlobal();
SDOperand Tmp;