1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND

llvm-svn: 22319
This commit is contained in:
Andrew Lenharth 2005-06-30 19:22:37 +00:00
parent 02fe175f3d
commit 04aa18bd2a

View File

@ -522,6 +522,15 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
return Result.getValue(Op.ResNo);
case TargetLowering::Expand:
//f64 = EXTLOAD f32 should expand to LOAD, FP_EXTEND
if (SrcVT == MVT::f32 && Node->getValueType(0) == MVT::f64) {
SDOperand Load = DAG.getLoad(SrcVT, Tmp1, Tmp2, Node->getOperand(2));
Result =
DAG.getNode(ISD::FP_EXTEND, Node->getValueType(0), Load, SrcVT);
if (Op.ResNo)
return Load.getValue(1);
return Result;
}
assert(Node->getOpcode() != ISD::EXTLOAD &&
"EXTLOAD should always be supported!");
// Turn the unsupported load into an EXTLOAD followed by an explicit