From: Chris Lattner Date: Sun, 27 Jan 2008 06:19:08 +0000 (+0000) Subject: make isExactlyValue work for long double. X-Git-Tag: android-x86-6.0-r1~1003^2~30616 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=84cd0e7fa30af43c47ad9533d84debb144596e48;p=android-x86%2Fexternal-llvm.git make isExactlyValue work for long double. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46410 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 395f1bf3fdc..ecbb0bf5ff9 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1208,10 +1208,9 @@ public: /// convenient to write "2.0" and the like. Without this function we'd /// have to duplicate its logic everywhere it's called. bool isExactlyValue(double V) const { - if (getValueType(0)==MVT::f64) - return isExactlyValue(APFloat(V)); - else - return isExactlyValue(APFloat((float)V)); + APFloat Tmp(V); + Tmp.convert(Value.getSemantics(), APFloat::rmNearestTiesToEven); + return isExactlyValue(Tmp); } bool isExactlyValue(const APFloat& V) const;