LLVM  14.0.0git
Classes | Namespaces | Macros | Functions | Variables
APFloat.cpp File Reference
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cstring>
#include <limits.h>
Include dependency graph for APFloat.cpp:

Go to the source code of this file.


struct  llvm::fltSemantics
struct  llvm::decimalInfo


 This is an optimization pass for GlobalISel generic memory operations.


#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...


static Error llvm::createError (const Twine &Err)
static unsigned int llvm::partCountForBits (unsigned int bits)
static unsigned int llvm::decDigitValue (unsigned int c)
static Expected< intllvm::readExponent (StringRef::iterator begin, StringRef::iterator end)
static Expected< intllvm::totalExponent (StringRef::iterator p, StringRef::iterator end, int exponentAdjustment)
static Expected< StringRef::iteratorllvm::skipLeadingZeroesAndAnyDot (StringRef::iterator begin, StringRef::iterator end, StringRef::iterator *dot)
static Error llvm::interpretDecimal (StringRef::iterator begin, StringRef::iterator end, decimalInfo *D)
static Expected< lostFractionllvm::trailingHexadecimalFraction (StringRef::iterator p, StringRef::iterator end, unsigned int digitValue)
static lostFraction llvm::lostFractionThroughTruncation (const APFloatBase::integerPart *parts, unsigned int partCount, unsigned int bits)
static lostFraction llvm::shiftRight (APFloatBase::integerPart *dst, unsigned int parts, unsigned int bits)
static lostFraction llvm::combineLostFractions (lostFraction moreSignificant, lostFraction lessSignificant)
static unsigned int llvm::HUerrBound (bool inexactMultiply, unsigned int HUerr1, unsigned int HUerr2)
static APFloatBase::integerPart llvm::ulpsFromBoundary (const APFloatBase::integerPart *parts, unsigned int bits, bool isNearest)
static unsigned int llvm::powerOf5 (APFloatBase::integerPart *dst, unsigned int power)
static unsigned int llvm::partAsHex (char *dst, APFloatBase::integerPart part, unsigned int count, const char *hexDigitChars)
static char * llvm::writeUnsignedDecimal (char *dst, unsigned int n)
static char * llvm::writeSignedDecimal (char *dst, int value)
static void llvm::detail::tcSetLeastSignificantBits (APInt::WordType *dst, unsigned parts, unsigned bits)
hash_code llvm::detail::hash_value (const IEEEFloat &Arg)
int llvm::detail::ilogb (const IEEEFloat &Arg)
IEEEFloat llvm::detail::scalbn (IEEEFloat X, int Exp, IEEEFloat::roundingMode)
IEEEFloat llvm::detail::frexp (const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM)
hash_code llvm::detail::hash_value (const DoubleAPFloat &Arg)
DoubleAPFloat llvm::detail::scalbn (const DoubleAPFloat &Arg, int Exp, APFloat::roundingMode RM)
DoubleAPFloat llvm::detail::frexp (const DoubleAPFloat &Arg, int &Exp, APFloat::roundingMode RM)
hash_code llvm::hash_value (const APFloat &Arg)
 See friend declarations above. More...


static const fltSemantics llvm::semIEEEhalf = {15, -14, 11, 16}
static const fltSemantics llvm::semBFloat = {127, -126, 8, 16}
static const fltSemantics llvm::semIEEEsingle = {127, -126, 24, 32}
static const fltSemantics llvm::semIEEEdouble = {1023, -1022, 53, 64}
static const fltSemantics llvm::semIEEEquad = {16383, -16382, 113, 128}
static const fltSemantics llvm::semX87DoubleExtended = {16383, -16382, 64, 80}
static const fltSemantics llvm::semBogus = {0, 0, 0, 0}
static const fltSemantics llvm::semPPCDoubleDouble = {-1, 0, 0, 128}
static const fltSemantics llvm::semPPCDoubleDoubleLegacy
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 = 2 + ((maxPowerOfFiveExponent * 815) / (351 * APFloatBase::integerPartWidth))
static const char llvm::hexDigitsLower [] = "0123456789abcdef0"
static const char llvm::hexDigitsUpper [] = "0123456789ABCDEF0"
static const char llvm::infinityL [] = "infinity"
static const char llvm::infinityU [] = "INFINITY"
static const char llvm::NaNL [] = "nan"
static const char llvm::NaNU [] = "NAN"

Macro Definition Documentation


do { \
if (usesLayout<IEEEFloat>(getSemantics())) \
if (usesLayout<DoubleAPFloat>(getSemantics())) \
return U.Double.METHOD_CALL; \
llvm_unreachable("Unexpected semantics"); \
} while (false)

Definition at line 29 of file APFloat.cpp.

◆ PackCategoriesIntoKey

#define PackCategoriesIntoKey (   _lhs,
)    ((_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 46 of file APFloat.cpp.