diff options
| author | Dale Johannesen <dalej@apple.com> | 2010-05-07 21:35:53 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2010-05-07 21:35:53 +0000 |
| commit | 51c1695a0a5c8510e3b4f89fa6b04a5f83312931 (patch) | |
| tree | 3cc4affd4ffc10b41e51d1b53740856db920dd41 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
| parent | eb3e4f3481e817f2da33235fbc902c0d9a3541fa (diff) | |
| download | bcm5719-llvm-51c1695a0a5c8510e3b4f89fa6b04a5f83312931.tar.gz bcm5719-llvm-51c1695a0a5c8510e3b4f89fa6b04a5f83312931.zip | |
Fix PR 7087, and probably other things, by extending
getConstantFP to accept the two supported long double
target types. This was not the original intent, but
there are other places that assume this works and it's
easy enough to do.
llvm-svn: 103299
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4854ff25f2d..e9de6d56f9a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -964,8 +964,18 @@ SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) { EVT EltVT = VT.getScalarType(); if (EltVT==MVT::f32) return getConstantFP(APFloat((float)Val), VT, isTarget); - else + else if (EltVT==MVT::f64) return getConstantFP(APFloat(Val), VT, isTarget); + else if (EltVT==MVT::f80 || EltVT==MVT::f128) { + bool ignored; + APFloat apf = APFloat(Val); + apf.convert(*EVTToAPFloatSemantics(EltVT), APFloat::rmNearestTiesToEven, + &ignored); + return getConstantFP(apf, VT, isTarget); + } else { + assert(0 && "Unsupported type in getConstantFP"); + return SDValue(); + } } SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, |

