[llvm-commits] [llvm] r60072 - in /llvm/trunk/lib: Support/APFloat.cpp Transforms/Scalar/IndVarSimplify.cpp

Evan Cheng evan.cheng at apple.com
Tue Nov 25 17:11:57 PST 2008


Author: evancheng
Date: Tue Nov 25 19:11:57 2008
New Revision: 60072

URL: http://llvm.org/viewvc/llvm-project?rev=60072&view=rev
Log:
Revert r60042. IndVarSimplify should check if APFloat is PPCDoubleDouble first before trying to convert it to an integer.

Modified:
    llvm/trunk/lib/Support/APFloat.cpp
    llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=60072&r1=60071&r2=60072&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Tue Nov 25 19:11:57 2008
@@ -117,11 +117,6 @@
            && "Compile-time arithmetic does not support these semantics");
   }
 
-  static inline bool
-  isArithmeticOk(const llvm::fltSemantics &semantics) {
-    return semantics.arithmeticOK;
-  }
-
   /* Return the value of a decimal exponent of the form
      [+-]ddddddd.
 
@@ -1792,8 +1787,7 @@
   const integerPart *src;
   unsigned int dstPartsCount, truncatedBits;
 
-  if (!isArithmeticOk(*semantics))
-    return opInvalidOp;
+  assertArithmeticOK(*semantics);
 
   *isExact = false;
 

Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=60072&r1=60071&r2=60072&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Nov 25 19:11:57 2008
@@ -742,6 +742,8 @@
 static bool convertToInt(const APFloat &APF, uint64_t *intVal) {
 
   bool isExact = false;
+  if (&APF.getSemantics() == &APFloat::PPCDoubleDouble)
+    return false;
   if (APF.convertToInteger(intVal, 32, APF.isNegative(), 
                            APFloat::rmTowardZero, &isExact)
       != APFloat::opOK)





More information about the llvm-commits mailing list