LLVM  3.7.0
Classes | Namespaces | Macros | Functions | Variables
APFloat.cpp File Reference
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <cstring>
#include <limits.h>
Include dependency graph for APFloat.cpp:

Go to the source code of this file.

Classes

struct  llvm::fltSemantics
 
struct  decimalInfo
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define PackCategoriesIntoKey(_lhs, _rhs)   ((_lhs) * 4 + (_rhs))
 A macro used to combine two fcCategory enums into one key which can be used in a switch statement to classify how the interaction of two APFloat's categories affects an operation. More...
 

Functions

static unsigned int partCountForBits (unsigned int bits)
 
static unsigned int decDigitValue (unsigned int c)
 
static int readExponent (StringRef::iterator begin, StringRef::iterator end)
 
static int totalExponent (StringRef::iterator p, StringRef::iterator end, int exponentAdjustment)
 
static StringRef::iterator skipLeadingZeroesAndAnyDot (StringRef::iterator begin, StringRef::iterator end, StringRef::iterator *dot)
 
static void interpretDecimal (StringRef::iterator begin, StringRef::iterator end, decimalInfo *D)
 
static lostFraction trailingHexadecimalFraction (StringRef::iterator p, StringRef::iterator end, unsigned int digitValue)
 
static lostFraction lostFractionThroughTruncation (const integerPart *parts, unsigned int partCount, unsigned int bits)
 
static lostFraction shiftRight (integerPart *dst, unsigned int parts, unsigned int bits)
 
static lostFraction combineLostFractions (lostFraction moreSignificant, lostFraction lessSignificant)
 
static unsigned int HUerrBound (bool inexactMultiply, unsigned int HUerr1, unsigned int HUerr2)
 
static integerPart ulpsFromBoundary (const integerPart *parts, unsigned int bits, bool isNearest)
 
static unsigned int powerOf5 (integerPart *dst, unsigned int power)
 
static unsigned int partAsHex (char *dst, integerPart part, unsigned int count, const char *hexDigitChars)
 
static char * writeUnsignedDecimal (char *dst, unsigned int n)
 
static char * writeSignedDecimal (char *dst, int value)
 

Variables

const unsigned int llvm::maxExponent = 16383
 
const unsigned int llvm::maxPrecision = 113
 
const unsigned int llvm::maxPowerOfFiveExponent = maxExponent + maxPrecision - 1
 
const unsigned int llvm::maxPowerOfFiveParts
 
static const char hexDigitsLower [] = "0123456789abcdef0"
 
static const char hexDigitsUpper [] = "0123456789ABCDEF0"
 
static const char infinityL [] = "infinity"
 
static const char infinityU [] = "INFINITY"
 
static const char NaNL [] = "nan"
 
static const char NaNU [] = "NAN"
 

Macro Definition Documentation

#define PackCategoriesIntoKey (   _lhs,
  _rhs 
)    ((_lhs) * 4 + (_rhs))

A macro used to combine two fcCategory enums into one key which can be used in a switch statement to classify how the interaction of two APFloat's categories affects an operation.

TODO: If clang source code is ever allowed to use constexpr in its own codebase, change this into a static inline function.

Definition at line 34 of file APFloat.cpp.

Referenced by llvm::APFloat::compare().

Function Documentation

static lostFraction combineLostFractions ( lostFraction  moreSignificant,
lostFraction  lessSignificant 
)
static
static unsigned int decDigitValue ( unsigned int  c)
inlinestatic

Definition at line 108 of file APFloat.cpp.

Referenced by interpretDecimal(), readExponent(), and totalExponent().

static unsigned int HUerrBound ( bool  inexactMultiply,
unsigned int  HUerr1,
unsigned int  HUerr2 
)
static

Definition at line 399 of file APFloat.cpp.

static void interpretDecimal ( StringRef::iterator  begin,
StringRef::iterator  end,
decimalInfo D 
)
static
static lostFraction lostFractionThroughTruncation ( const integerPart parts,
unsigned int  partCount,
unsigned int  bits 
)
static
static unsigned int partAsHex ( char *  dst,
integerPart  part,
unsigned int  count,
const char *  hexDigitChars 
)
static

Definition at line 529 of file APFloat.cpp.

References llvm::integerPartWidth.

static unsigned int partCountForBits ( unsigned int  bits)
inlinestatic
static unsigned int powerOf5 ( integerPart dst,
unsigned int  power 
)
static
static int readExponent ( StringRef::iterator  begin,
StringRef::iterator  end 
)
static

Definition at line 119 of file APFloat.cpp.

References llvm::sys::path::begin(), decDigitValue(), and llvm::sys::path::end().

Referenced by interpretDecimal().

static lostFraction shiftRight ( integerPart dst,
unsigned int  parts,
unsigned int  bits 
)
static

Definition at line 365 of file APFloat.cpp.

References lostFractionThroughTruncation(), and llvm::APInt::tcShiftRight().

Referenced by llvm::APFloat::convert().

static StringRef::iterator skipLeadingZeroesAndAnyDot ( StringRef::iterator  begin,
StringRef::iterator  end,
StringRef::iterator dot 
)
static

Definition at line 212 of file APFloat.cpp.

References llvm::sys::path::begin(), and llvm::sys::path::end().

Referenced by interpretDecimal().

static int totalExponent ( StringRef::iterator  p,
StringRef::iterator  end,
int  exponentAdjustment 
)
static

Definition at line 163 of file APFloat.cpp.

References decDigitValue(), and llvm::sys::path::end().

static lostFraction trailingHexadecimalFraction ( StringRef::iterator  p,
StringRef::iterator  end,
unsigned int  digitValue 
)
static
static integerPart ulpsFromBoundary ( const integerPart parts,
unsigned int  bits,
bool  isNearest 
)
static

Definition at line 413 of file APFloat.cpp.

References llvm::integerPartWidth.

static char* writeSignedDecimal ( char *  dst,
int  value 
)
static

Definition at line 565 of file APFloat.cpp.

References writeUnsignedDecimal().

static char* writeUnsignedDecimal ( char *  dst,
unsigned int  n 
)
static

Definition at line 547 of file APFloat.cpp.

Referenced by writeSignedDecimal().

Variable Documentation

const char hexDigitsLower[] = "0123456789abcdef0"
static

Definition at line 518 of file APFloat.cpp.

const char hexDigitsUpper[] = "0123456789ABCDEF0"
static

Definition at line 519 of file APFloat.cpp.

const char infinityL[] = "infinity"
static

Definition at line 520 of file APFloat.cpp.

Referenced by llvm::APFloat::convertToHexString().

const char infinityU[] = "INFINITY"
static

Definition at line 521 of file APFloat.cpp.

Referenced by llvm::APFloat::convertToHexString().

const char NaNL[] = "nan"
static

Definition at line 522 of file APFloat.cpp.

Referenced by llvm::APFloat::convertToHexString().

const char NaNU[] = "NAN"
static

Definition at line 523 of file APFloat.cpp.

Referenced by llvm::APFloat::convertToHexString().