[llvm-commits] [llvm] r49994 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Dale Johannesen dalej at apple.com
Sun Apr 20 11:23:46 PDT 2008


Author: johannes
Date: Sun Apr 20 13:23:46 2008
New Revision: 49994

URL: http://llvm.org/viewvc/llvm-project?rev=49994&view=rev
Log:
Check we aren't trying to convert PPC long double.
This fixes the testsuite failure on ppcf128-4.ll.


Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

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

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Sun Apr 20 13:23:46 2008
@@ -1500,7 +1500,10 @@
   /// We leave the version with the double argument here because it's just so
   /// 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 { 
+  bool isExactlyValue(double V) const {
+    // convert is not supported on this type
+    if (&Value.getSemantics() == &APFloat::PPCDoubleDouble)
+      return false;
     APFloat Tmp(V);
     Tmp.convert(Value.getSemantics(), APFloat::rmNearestTiesToEven);
     return isExactlyValue(Tmp);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49994&r1=49993&r2=49994&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sun Apr 20 13:23:46 2008
@@ -74,12 +74,9 @@
                                            const APFloat& Val) {
   assert(MVT::isFloatingPoint(VT) && "Can only convert between FP types");
   
-  // Anything can be extended to ppc long double.
-  if (VT == MVT::ppcf128)
-    return true;
-  
-  // PPC long double cannot be shrunk to anything though.
-  if (&Val.getSemantics() == &APFloat::PPCDoubleDouble)
+  // PPC long double cannot be converted to any other type.
+  if (VT == MVT::ppcf128 ||
+      &Val.getSemantics() == &APFloat::PPCDoubleDouble)
     return false;
   
   // convert modifies in place, so make a copy.





More information about the llvm-commits mailing list