make isExactlyValue work for long double.
authorChris Lattner <sabre@nondot.org>
Sun, 27 Jan 2008 06:19:08 +0000 (06:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Jan 2008 06:19:08 +0000 (06:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46410 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h

index 395f1bf3fdce8eb9418843f47f8eeb35fde3e148..ecbb0bf5ff9b19b99318d81aaf781e424808534f 100644 (file)
@@ -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;