[llvm-branch-commits] [llvm-branch] r103329 - in /llvm/branches/Apple/Morbo: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/2010-05-07-ldconvert.ll
Dale Johannesen
dalej at apple.com
Fri May 7 16:40:53 PDT 2010
Author: johannes
Date: Fri May 7 18:40:53 2010
New Revision: 103329
URL: http://llvm.org/viewvc/llvm-project?rev=103329&view=rev
Log:
--- Merging r103299 into '.':
A test/CodeGen/X86/2010-05-07-ldconvert.ll
U include/llvm/CodeGen/SelectionDAG.h
U lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Added:
llvm/branches/Apple/Morbo/test/CodeGen/X86/2010-05-07-ldconvert.ll
- copied unchanged from r103299, llvm/trunk/test/CodeGen/X86/2010-05-07-ldconvert.ll
Modified:
llvm/branches/Apple/Morbo/include/llvm/CodeGen/SelectionDAG.h
llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/branches/Apple/Morbo/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/include/llvm/CodeGen/SelectionDAG.h?rev=103329&r1=103328&r2=103329&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/branches/Apple/Morbo/include/llvm/CodeGen/SelectionDAG.h Fri May 7 18:40:53 2010
@@ -339,6 +339,8 @@
SDValue getTargetConstant(const ConstantInt &Val, EVT VT) {
return getConstant(Val, VT, true);
}
+ // The forms below that take a double should only be used for simple
+ // constants that can be exactly represented in VT. No checks are made.
SDValue getConstantFP(double Val, EVT VT, bool isTarget = false);
SDValue getConstantFP(const APFloat& Val, EVT VT, bool isTarget = false);
SDValue getConstantFP(const ConstantFP &CF, EVT VT, bool isTarget = false);
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=103329&r1=103328&r2=103329&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri May 7 18:40:53 2010
@@ -970,8 +970,18 @@
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,
More information about the llvm-branch-commits
mailing list