Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
[oota-llvm.git] / include / llvm / ADT / APFloat.h
index 7a43843bf02b95da34e871c566b6d6ddce5f6fab..e4d4c8eb4209de4f95f66c73347f5ea4ec8b19ad 100644 (file)
 
 // APInt contains static functions implementing bignum arithmetic.
 #include "llvm/ADT/APInt.h"
+#include "llvm/Bitcode/SerializationFwd.h"
 #include "llvm/CodeGen/ValueTypes.h"
 
 namespace llvm {
@@ -181,6 +182,12 @@ namespace llvm {
     explicit APFloat(const APInt &, bool isIEEE = false);
     APFloat(const APFloat &);
     ~APFloat();
+    
+    /// @brief Used by the Bitcode serializer to emit APInts to Bitcode.
+    void Emit(Serializer& S) const;
+    
+    /// @brief Used by the Bitcode deserializer to deserialize APInts.
+    static APFloat ReadVal(Deserializer& D);
 
     /* Arithmetic.  */
     opStatus add(const APFloat &, roundingMode);
@@ -232,6 +239,7 @@ namespace llvm {
     const fltSemantics &getSemantics() const { return *semantics; }
     bool isZero() const { return category == fcZero; }
     bool isNonZero() const { return category != fcZero; }
+    bool isNaN() const { return category == fcNaN; }
     bool isNegative() const { return sign; }
     bool isPosZero() const { return isZero() && !isNegative(); }
     bool isNegZero() const { return isZero() && isNegative(); }
@@ -268,11 +276,14 @@ namespace llvm {
     opStatus multiplySpecials(const APFloat &);
 
     /* Miscellany.  */
+    void makeNaN(void);
     opStatus normalize(roundingMode, lostFraction);
     opStatus addOrSubtract(const APFloat &, roundingMode, bool subtract);
     cmpResult compareAbsoluteValue(const APFloat &) const;
     opStatus handleOverflow(roundingMode);
     bool roundAwayFromZero(roundingMode, lostFraction, unsigned int) const;
+    opStatus convertToSignExtendedInteger(integerPart *, unsigned int, bool,
+                                          roundingMode) const;
     opStatus convertFromUnsignedParts(const integerPart *, unsigned int,
                                       roundingMode);
     opStatus convertFromHexadecimalString(const char *, roundingMode);