aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-03-27 20:23:40 +0000
committerDuncan Sands <baldrick@free.fr>2008-03-27 20:23:40 +0000
commit14ea39cf3c62fad781b8a00cda9e4a15e61520dc (patch)
tree91b26d7e4ab2c4445d696be90eeb50e778d7838a /lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp
parent86e1ebf9bbde7408a1d7859ea207981457e11cc2 (diff)
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp11
1 files changed, 11 insertions, 0 deletions
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<LoadSDNode>(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..