From 14ea39cf3c62fad781b8a00cda9e4a15e61520dc Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 27 Mar 2008 20:23:40 +0000 Subject: Implement LegalizeTypes support for softfloat LOAD. In order to handle indexed nodes I had to introduce a new constructor, and since I was there I factorized the code in the various load constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48894 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp') diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp index 53f3143fca..3c98898915 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp @@ -53,6 +53,7 @@ void DAGTypeLegalizer::FloatToIntResult(SDNode *N, unsigned ResNo) { case ISD::BIT_CONVERT: R = FloatToIntRes_BIT_CONVERT(N); break; case ISD::BUILD_PAIR: R = FloatToIntRes_BUILD_PAIR(N); break; case ISD::FCOPYSIGN: R = FloatToIntRes_FCOPYSIGN(N); break; + case ISD::LOAD: R = FloatToIntRes_LOAD(N); break; } // If R is null, the sub-method took care of registering the result. @@ -111,6 +112,16 @@ SDOperand DAGTypeLegalizer::FloatToIntRes_FCOPYSIGN(SDNode *N) { return DAG.getNode(ISD::OR, LVT, LHS, SignBit); } +SDOperand DAGTypeLegalizer::FloatToIntRes_LOAD(SDNode *N) { + MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + LoadSDNode *L = cast(N); + + return DAG.getAnyLoad(L->getAddressingMode(), L->getExtensionType(), + NVT, L->getChain(), L->getBasePtr(), L->getOffset(), + L->getSrcValue(), L->getSrcValueOffset(), + L->getMemoryVT(), L->isVolatile(), L->getAlignment()); +} + //===----------------------------------------------------------------------===// // Operand Float to Integer Conversion.. -- cgit v1.2.3-18-g5258