Revert r60042. IndVarSimplify should check if APFloat is PPCDoubleDouble first before...
authorEvan Cheng <evan.cheng@apple.com>
Wed, 26 Nov 2008 01:11:57 +0000 (01:11 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 26 Nov 2008 01:11:57 +0000 (01:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60072 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APFloat.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp

index 128fee4f01fe8fa2ba3d463684a6e62b15619c26..a65e55afb56d4a50eadbcc199e4efd3d5018d7e5 100644 (file)
@@ -117,11 +117,6 @@ namespace {
            && "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 @@ APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width,
   const integerPart *src;
   unsigned int dstPartsCount, truncatedBits;
 
-  if (!isArithmeticOk(*semantics))
-    return opInvalidOp;
+  assertArithmeticOK(*semantics);
 
   *isExact = false;
 
index 128b19778fcb0fa5d274f47737d6a6e7922cf1e5..fabbf6e19e58e0b5a1dff6f74f9f4c07a705b60e 100644 (file)
@@ -742,6 +742,8 @@ static bool useSIToFPInst(ConstantFP &InitV, ConstantFP &ExitV,
 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)