LLVM 19.0.0git
Public Member Functions | Friends | List of all members
llvm::detail::DoubleAPFloat Class Referencefinal

#include "llvm/ADT/APFloat.h"

Inheritance diagram for llvm::detail::DoubleAPFloat:
Inheritance graph
[legend]

Public Member Functions

 DoubleAPFloat (const fltSemantics &S)
 
 DoubleAPFloat (const fltSemantics &S, uninitializedTag)
 
 DoubleAPFloat (const fltSemantics &S, integerPart)
 
 DoubleAPFloat (const fltSemantics &S, const APInt &I)
 
 DoubleAPFloat (const fltSemantics &S, APFloat &&First, APFloat &&Second)
 
 DoubleAPFloat (const DoubleAPFloat &RHS)
 
 DoubleAPFloat (DoubleAPFloat &&RHS)
 
DoubleAPFloatoperator= (const DoubleAPFloat &RHS)
 
DoubleAPFloatoperator= (DoubleAPFloat &&RHS)
 
bool needsCleanup () const
 
APFloatgetFirst ()
 
const APFloatgetFirst () const
 
APFloatgetSecond ()
 
const APFloatgetSecond () const
 
opStatus add (const DoubleAPFloat &RHS, roundingMode RM)
 
opStatus subtract (const DoubleAPFloat &RHS, roundingMode RM)
 
opStatus multiply (const DoubleAPFloat &RHS, roundingMode RM)
 
opStatus divide (const DoubleAPFloat &RHS, roundingMode RM)
 
opStatus remainder (const DoubleAPFloat &RHS)
 
opStatus mod (const DoubleAPFloat &RHS)
 
opStatus fusedMultiplyAdd (const DoubleAPFloat &Multiplicand, const DoubleAPFloat &Addend, roundingMode RM)
 
opStatus roundToIntegral (roundingMode RM)
 
void changeSign ()
 
cmpResult compareAbsoluteValue (const DoubleAPFloat &RHS) const
 
fltCategory getCategory () const
 
bool isNegative () const
 
void makeInf (bool Neg)
 
void makeZero (bool Neg)
 
void makeLargest (bool Neg)
 
void makeSmallest (bool Neg)
 
void makeSmallestNormalized (bool Neg)
 
void makeNaN (bool SNaN, bool Neg, const APInt *fill)
 
cmpResult compare (const DoubleAPFloat &RHS) const
 
bool bitwiseIsEqual (const DoubleAPFloat &RHS) const
 
APInt bitcastToAPInt () const
 
Expected< opStatusconvertFromString (StringRef, roundingMode)
 
opStatus next (bool nextDown)
 
opStatus convertToInteger (MutableArrayRef< integerPart > Input, unsigned int Width, bool IsSigned, roundingMode RM, bool *IsExact) const
 
opStatus convertFromAPInt (const APInt &Input, bool IsSigned, roundingMode RM)
 
opStatus convertFromSignExtendedInteger (const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
 
opStatus convertFromZeroExtendedInteger (const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
 
unsigned int convertToHexString (char *DST, unsigned int HexDigits, bool UpperCase, roundingMode RM) const
 
bool isDenormal () const
 
bool isSmallest () const
 
bool isSmallestNormalized () const
 
bool isLargest () const
 
bool isInteger () const
 
void toString (SmallVectorImpl< char > &Str, unsigned FormatPrecision, unsigned FormatMaxPadding, bool TruncateZero=true) const
 
bool getExactInverse (APFloat *inv) const
 
LLVM_READONLY int getExactLog2 () const
 
LLVM_READONLY int getExactLog2Abs () const
 

Friends

DoubleAPFloat scalbn (const DoubleAPFloat &X, int Exp, roundingMode)
 
DoubleAPFloat frexp (const DoubleAPFloat &X, int &Exp, roundingMode)
 
hash_code hash_value (const DoubleAPFloat &Arg)
 

Additional Inherited Members

- Public Types inherited from llvm::APFloatBase
enum  cmpResult { cmpLessThan , cmpEqual , cmpGreaterThan , cmpUnordered }
 IEEE-754R 5.11: Floating Point Comparison Relations. More...
 
enum  opStatus {
  opOK = 0x00 , opInvalidOp = 0x01 , opDivByZero = 0x02 , opOverflow = 0x04 ,
  opUnderflow = 0x08 , opInexact = 0x10
}
 IEEE-754R 7: Default exception handling. More...
 
enum  fltCategory { fcInfinity , fcNaN , fcNormal , fcZero }
 Category of internally-represented number. More...
 
enum  uninitializedTag { uninitialized }
 Convenience enum used to construct an uninitialized APFloat. More...
 
enum  IlogbErrorKinds { IEK_Zero = INT_MIN + 1 , IEK_NaN = INT_MIN , IEK_Inf = INT_MAX }
 Enumeration of ilogb error results. More...
 
typedef APInt::WordType integerPart
 
typedef int32_t ExponentType
 A signed type to represent a floating point numbers unbiased exponent.
 
using roundingMode = llvm::RoundingMode
 IEEE-754R 4.3: Rounding-direction attributes.
 
enum  Semantics {
  S_IEEEhalf , S_BFloat , S_IEEEsingle , S_IEEEdouble ,
  S_IEEEquad , S_PPCDoubleDouble , S_Float8E5M2 , S_Float8E5M2FNUZ ,
  S_Float8E4M3FN , S_Float8E4M3FNUZ , S_Float8E4M3B11FNUZ , S_FloatTF32 ,
  S_x87DoubleExtended , S_MaxSemantics = S_x87DoubleExtended
}
 
- Static Public Member Functions inherited from llvm::APFloatBase
static unsigned int semanticsPrecision (const fltSemantics &)
 
static ExponentType semanticsMinExponent (const fltSemantics &)
 
static ExponentType semanticsMaxExponent (const fltSemantics &)
 
static unsigned int semanticsSizeInBits (const fltSemantics &)
 
static unsigned int semanticsIntSizeInBits (const fltSemantics &, bool)
 
static bool isRepresentableAsNormalIn (const fltSemantics &Src, const fltSemantics &Dst)
 
static unsigned getSizeInBits (const fltSemantics &Sem)
 Returns the size of the floating point number (in bits) in the given semantics.
 
static const llvm::fltSemanticsEnumToSemantics (Semantics S)
 
static Semantics SemanticsToEnum (const llvm::fltSemantics &Sem)
 
static const fltSemanticsIEEEhalf () LLVM_READNONE
 
static const fltSemanticsBFloat () LLVM_READNONE
 
static const fltSemanticsIEEEsingle () LLVM_READNONE
 
static const fltSemanticsIEEEdouble () LLVM_READNONE
 
static const fltSemanticsIEEEquad () LLVM_READNONE
 
static const fltSemanticsPPCDoubleDouble () LLVM_READNONE
 
static const fltSemanticsFloat8E5M2 () LLVM_READNONE
 
static const fltSemanticsFloat8E5M2FNUZ () LLVM_READNONE
 
static const fltSemanticsFloat8E4M3FN () LLVM_READNONE
 
static const fltSemanticsFloat8E4M3FNUZ () LLVM_READNONE
 
static const fltSemanticsFloat8E4M3B11FNUZ () LLVM_READNONE
 
static const fltSemanticsFloatTF32 () LLVM_READNONE
 
static const fltSemanticsx87DoubleExtended () LLVM_READNONE
 
static const fltSemanticsBogus () LLVM_READNONE
 A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.
 
- Static Public Attributes inherited from llvm::APFloatBase
static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD
 
static constexpr roundingMode rmNearestTiesToEven
 
static constexpr roundingMode rmTowardPositive = RoundingMode::TowardPositive
 
static constexpr roundingMode rmTowardNegative = RoundingMode::TowardNegative
 
static constexpr roundingMode rmTowardZero = RoundingMode::TowardZero
 
static constexpr roundingMode rmNearestTiesToAway
 

Detailed Description

Definition at line 680 of file APFloat.h.

Constructor & Destructor Documentation

◆ DoubleAPFloat() [1/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const fltSemantics S)

Definition at line 4562 of file APFloat.cpp.

References llvm::semIEEEdouble.

◆ DoubleAPFloat() [2/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const fltSemantics S,
uninitializedTag   
)

Definition at line 4568 of file APFloat.cpp.

References llvm::semIEEEdouble, and llvm::APFloatBase::uninitialized.

◆ DoubleAPFloat() [3/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const fltSemantics S,
integerPart  I 
)

Definition at line 4575 of file APFloat.cpp.

References I, and llvm::semIEEEdouble.

◆ DoubleAPFloat() [4/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const fltSemantics S,
const APInt I 
)

Definition at line 4581 of file APFloat.cpp.

References I, and llvm::semIEEEdouble.

◆ DoubleAPFloat() [5/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const fltSemantics S,
APFloat &&  First,
APFloat &&  Second 
)

Definition at line 4589 of file APFloat.cpp.

References llvm::First.

◆ DoubleAPFloat() [6/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( const DoubleAPFloat RHS)

Definition at line 4598 of file APFloat.cpp.

References RHS.

◆ DoubleAPFloat() [7/7]

llvm::detail::DoubleAPFloat::DoubleAPFloat ( DoubleAPFloat &&  RHS)

Definition at line 4606 of file APFloat.cpp.

References assert(), RHS, llvm::semBogus, and llvm::semPPCDoubleDouble.

Member Function Documentation

◆ add()

APFloat::opStatus llvm::detail::DoubleAPFloat::add ( const DoubleAPFloat RHS,
roundingMode  RM 
)

Definition at line 4751 of file APFloat.cpp.

References RHS.

Referenced by subtract().

◆ bitcastToAPInt()

APInt llvm::detail::DoubleAPFloat::bitcastToAPInt ( ) const

◆ bitwiseIsEqual()

bool llvm::detail::DoubleAPFloat::bitwiseIsEqual ( const DoubleAPFloat RHS) const

Definition at line 4975 of file APFloat.cpp.

References RHS.

◆ changeSign()

void llvm::detail::DoubleAPFloat::changeSign ( )

Definition at line 4898 of file APFloat.cpp.

Referenced by makeLargest(), and subtract().

◆ compare()

APFloat::cmpResult llvm::detail::DoubleAPFloat::compare ( const DoubleAPFloat RHS) const

Definition at line 4967 of file APFloat.cpp.

References llvm::APFloatBase::cmpEqual, and RHS.

Referenced by isLargest(), isSmallest(), and isSmallestNormalized().

◆ compareAbsoluteValue()

APFloat::cmpResult llvm::detail::DoubleAPFloat::compareAbsoluteValue ( const DoubleAPFloat RHS) const

◆ convertFromAPInt()

APFloat::opStatus llvm::detail::DoubleAPFloat::convertFromAPInt ( const APInt Input,
bool  IsSigned,
roundingMode  RM 
)

◆ convertFromSignExtendedInteger()

APFloat::opStatus llvm::detail::DoubleAPFloat::convertFromSignExtendedInteger ( const integerPart Input,
unsigned int  InputSize,
bool  IsSigned,
roundingMode  RM 
)

◆ convertFromString()

Expected< APFloat::opStatus > llvm::detail::DoubleAPFloat::convertFromString ( StringRef  S,
roundingMode  RM 
)

◆ convertFromZeroExtendedInteger()

APFloat::opStatus llvm::detail::DoubleAPFloat::convertFromZeroExtendedInteger ( const integerPart Input,
unsigned int  InputSize,
bool  IsSigned,
roundingMode  RM 
)

◆ convertToHexString()

unsigned int llvm::detail::DoubleAPFloat::convertToHexString ( char DST,
unsigned int  HexDigits,
bool  UpperCase,
roundingMode  RM 
) const

◆ convertToInteger()

APFloat::opStatus llvm::detail::DoubleAPFloat::convertToInteger ( MutableArrayRef< integerPart Input,
unsigned int  Width,
bool  IsSigned,
roundingMode  RM,
bool IsExact 
) const

◆ divide()

APFloat::opStatus llvm::detail::DoubleAPFloat::divide ( const DoubleAPFloat RHS,
APFloat::roundingMode  RM 
)

◆ fusedMultiplyAdd()

APFloat::opStatus llvm::detail::DoubleAPFloat::fusedMultiplyAdd ( const DoubleAPFloat Multiplicand,
const DoubleAPFloat Addend,
APFloat::roundingMode  RM 
)

◆ getCategory()

APFloat::fltCategory llvm::detail::DoubleAPFloat::getCategory ( ) const

◆ getExactInverse()

bool llvm::detail::DoubleAPFloat::getExactInverse ( APFloat inv) const

◆ getExactLog2()

int llvm::detail::DoubleAPFloat::getExactLog2 ( ) const

Definition at line 5119 of file APFloat.cpp.

◆ getExactLog2Abs()

int llvm::detail::DoubleAPFloat::getExactLog2Abs ( ) const

Definition at line 5124 of file APFloat.cpp.

◆ getFirst() [1/2]

APFloat & llvm::detail::DoubleAPFloat::getFirst ( )
inline

Definition at line 1460 of file APFloat.h.

◆ getFirst() [2/2]

const APFloat & llvm::detail::DoubleAPFloat::getFirst ( ) const
inline

Definition at line 1461 of file APFloat.h.

◆ getSecond() [1/2]

APFloat & llvm::detail::DoubleAPFloat::getSecond ( )
inline

Definition at line 1462 of file APFloat.h.

◆ getSecond() [2/2]

const APFloat & llvm::detail::DoubleAPFloat::getSecond ( ) const
inline

Definition at line 1463 of file APFloat.h.

◆ isDenormal()

bool llvm::detail::DoubleAPFloat::isDenormal ( ) const

Definition at line 5062 of file APFloat.cpp.

References llvm::APFloatBase::fcNormal, and getCategory().

◆ isInteger()

bool llvm::detail::DoubleAPFloat::isInteger ( ) const

Definition at line 5094 of file APFloat.cpp.

References assert(), and llvm::semPPCDoubleDouble.

◆ isLargest()

bool llvm::detail::DoubleAPFloat::isLargest ( ) const

◆ isNegative()

bool llvm::detail::DoubleAPFloat::isNegative ( ) const

Definition at line 4928 of file APFloat.cpp.

Referenced by isLargest(), isSmallest(), and isSmallestNormalized().

◆ isSmallest()

bool llvm::detail::DoubleAPFloat::isSmallest ( ) const

◆ isSmallestNormalized()

bool llvm::detail::DoubleAPFloat::isSmallestNormalized ( ) const

◆ makeInf()

void llvm::detail::DoubleAPFloat::makeInf ( bool  Neg)

Definition at line 4930 of file APFloat.cpp.

◆ makeLargest()

void llvm::detail::DoubleAPFloat::makeLargest ( bool  Neg)

Definition at line 4940 of file APFloat.cpp.

References assert(), changeSign(), llvm::semIEEEdouble, and llvm::semPPCDoubleDouble.

Referenced by isLargest().

◆ makeNaN()

void llvm::detail::DoubleAPFloat::makeNaN ( bool  SNaN,
bool  Neg,
const APInt fill 
)

Definition at line 4962 of file APFloat.cpp.

◆ makeSmallest()

void llvm::detail::DoubleAPFloat::makeSmallest ( bool  Neg)

Definition at line 4948 of file APFloat.cpp.

References assert(), and llvm::semPPCDoubleDouble.

Referenced by isSmallest().

◆ makeSmallestNormalized()

void llvm::detail::DoubleAPFloat::makeSmallestNormalized ( bool  Neg)

Definition at line 4954 of file APFloat.cpp.

References assert(), llvm::semIEEEdouble, and llvm::semPPCDoubleDouble.

Referenced by isSmallestNormalized().

◆ makeZero()

void llvm::detail::DoubleAPFloat::makeZero ( bool  Neg)

Definition at line 4935 of file APFloat.cpp.

◆ mod()

APFloat::opStatus llvm::detail::DoubleAPFloat::mod ( const DoubleAPFloat RHS)

◆ multiply()

APFloat::opStatus llvm::detail::DoubleAPFloat::multiply ( const DoubleAPFloat RHS,
APFloat::roundingMode  RM 
)

◆ needsCleanup()

bool llvm::detail::DoubleAPFloat::needsCleanup ( ) const
inline

Definition at line 703 of file APFloat.h.

◆ next()

APFloat::opStatus llvm::detail::DoubleAPFloat::next ( bool  nextDown)

◆ operator=() [1/2]

DoubleAPFloat & llvm::detail::DoubleAPFloat::operator= ( const DoubleAPFloat RHS)

Definition at line 4612 of file APFloat.cpp.

References RHS.

◆ operator=() [2/2]

DoubleAPFloat & llvm::detail::DoubleAPFloat::operator= ( DoubleAPFloat &&  RHS)
inline

Definition at line 1452 of file APFloat.h.

References RHS.

◆ remainder()

APFloat::opStatus llvm::detail::DoubleAPFloat::remainder ( const DoubleAPFloat RHS)

◆ roundToIntegral()

APFloat::opStatus llvm::detail::DoubleAPFloat::roundToIntegral ( APFloat::roundingMode  RM)

◆ subtract()

APFloat::opStatus llvm::detail::DoubleAPFloat::subtract ( const DoubleAPFloat RHS,
roundingMode  RM 
)

Definition at line 4756 of file APFloat.cpp.

References add(), changeSign(), and RHS.

◆ toString()

void llvm::detail::DoubleAPFloat::toString ( SmallVectorImpl< char > &  Str,
unsigned  FormatPrecision,
unsigned  FormatMaxPadding,
bool  TruncateZero = true 
) const

Friends And Related Function Documentation

◆ frexp

DoubleAPFloat frexp ( const DoubleAPFloat X,
int &  Exp,
roundingMode   
)
friend

◆ hash_value

hash_code hash_value ( const DoubleAPFloat Arg)
friend

Definition at line 4980 of file APFloat.cpp.

◆ scalbn

DoubleAPFloat scalbn ( const DoubleAPFloat X,
int  Exp,
roundingMode   
)
friend

The documentation for this class was generated from the following files: