From 9d416f713e8b9e4f0c0c2b3f6f57ce2dd8993209 Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Thu, 30 Jun 2005 19:22:37 +0000 Subject: [PATCH] FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22319 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0f168435da4..bf97fea2a45 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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