[llvm-commits] [llvm] r46410 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner sabre at nondot.org
Sat Jan 26 22:19:08 PST 2008


Author: lattner
Date: Sun Jan 27 00:19:08 2008
New Revision: 46410

URL: http://llvm.org/viewvc/llvm-project?rev=46410&view=rev
Log:
make isExactlyValue work for long double.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46410&r1=46409&r2=46410&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Sun Jan 27 00:19:08 2008
@@ -1208,10 +1208,9 @@
   /// 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;
 





More information about the llvm-commits mailing list