aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-28 02:40:33 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-28 02:40:33 +0000
commit8f17a36d3107bdc4ffed53ce782c1724ef6460e7 (patch)
tree68daae8400bd7b6a3faf6d0aaa7a7f9e6235f905 /lib/CodeGen
parent202249a6984a1fae296f5a9e8e5d4292251a7ce6 (diff)
downloadexternal_llvm-8f17a36d3107bdc4ffed53ce782c1724ef6460e7.tar.gz
external_llvm-8f17a36d3107bdc4ffed53ce782c1724ef6460e7.tar.bz2
external_llvm-8f17a36d3107bdc4ffed53ce782c1724ef6460e7.zip
Allow targets to specify the return type of libcalls that are generated for floating point comparisons, rather than hard-coding them as i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp3
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 84e39b4803..2831617ebd 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -637,7 +637,8 @@ void DAGTypeLegalizer::SoftenSetCCOperands(SDValue &NewLHS, SDValue &NewRHS,
}
}
- EVT RetVT = MVT::i32; // FIXME: is this the correct return type?
+ // Use the target specific return value for comparions lib calls.
+ EVT RetVT = TLI.getCmpLibcallReturnType();
SDValue Ops[2] = { LHSInt, RHSInt };
NewLHS = MakeLibCall(LC1, RetVT, Ops, 2, false/*sign irrelevant*/, dl);
NewRHS = DAG.getConstant(0, RetVT);
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 1026169151..d9a5a13666 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -713,6 +713,10 @@ MVT::SimpleValueType TargetLowering::getSetCCResultType(EVT VT) const {
return PointerTy.SimpleTy;
}
+MVT::SimpleValueType TargetLowering::getCmpLibcallReturnType() const {
+ return MVT::i32; // return the default value
+}
+
/// getVectorTypeBreakdown - Vector types are broken down into some number of
/// legal first class types. For example, MVT::v8f32 maps to 2 MVT::v4f32
/// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack.