LLVM 22.0.0git
llvm::APFloatBase Class Reference

#include "llvm/ADT/APFloat.h"

Inheritance diagram for llvm::APFloatBase:
[legend]

Public Types

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.

Static Public Member Functions

static LLVM_ABI unsigned int semanticsPrecision (const fltSemantics &)
static LLVM_ABI ExponentType semanticsMinExponent (const fltSemantics &)
static LLVM_ABI ExponentType semanticsMaxExponent (const fltSemantics &)
static LLVM_ABI unsigned int semanticsSizeInBits (const fltSemantics &)
static LLVM_ABI unsigned int semanticsIntSizeInBits (const fltSemantics &, bool)
static LLVM_ABI bool semanticsHasZero (const fltSemantics &)
static LLVM_ABI bool semanticsHasSignedRepr (const fltSemantics &)
static LLVM_ABI bool semanticsHasInf (const fltSemantics &)
static LLVM_ABI bool semanticsHasNaN (const fltSemantics &)
static LLVM_ABI bool isIEEELikeFP (const fltSemantics &)
static LLVM_ABI bool hasSignBitInMSB (const fltSemantics &)
static LLVM_ABI bool isRepresentableAsNormalIn (const fltSemantics &Src, const fltSemantics &Dst)
static LLVM_ABI unsigned getSizeInBits (const fltSemantics &Sem)
 Returns the size of the floating point number (in bits) in the given semantics.

Static Public Attributes

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

Floating Point Semantics.

enum  Semantics {
  S_IEEEhalf , S_BFloat , S_IEEEsingle , S_IEEEdouble ,
  S_IEEEquad , S_PPCDoubleDouble , S_PPCDoubleDoubleLegacy , S_Float8E5M2 ,
  S_Float8E5M2FNUZ , S_Float8E4M3 , S_Float8E4M3FN , S_Float8E4M3FNUZ ,
  S_Float8E4M3B11FNUZ , S_Float8E3M4 , S_FloatTF32 , S_Float8E8M0FNU ,
  S_Float6E3M2FN , S_Float6E2M3FN , S_Float4E2M1FN , S_x87DoubleExtended ,
  S_MaxSemantics = S_x87DoubleExtended
}
class detail::IEEEFloat
class detail::DoubleAPFloat
class APFloat
static LLVM_ABI const llvm::fltSemanticsEnumToSemantics (Semantics S)
static LLVM_ABI Semantics SemanticsToEnum (const llvm::fltSemantics &Sem)
static const fltSemanticsIEEEhalf ()
static const fltSemanticsBFloat ()
static const fltSemanticsIEEEsingle ()
static const fltSemanticsIEEEdouble ()
static const fltSemanticsIEEEquad ()
static const fltSemanticsPPCDoubleDouble ()
static const fltSemanticsPPCDoubleDoubleLegacy ()
static const fltSemanticsFloat8E5M2 ()
static const fltSemanticsFloat8E5M2FNUZ ()
static const fltSemanticsFloat8E4M3 ()
static const fltSemanticsFloat8E4M3FN ()
static const fltSemanticsFloat8E4M3FNUZ ()
static const fltSemanticsFloat8E4M3B11FNUZ ()
static const fltSemanticsFloat8E3M4 ()
static const fltSemanticsFloatTF32 ()
static const fltSemanticsFloat8E8M0FNU ()
static const fltSemanticsFloat6E3M2FN ()
static const fltSemanticsFloat6E2M3FN ()
static const fltSemanticsFloat4E2M1FN ()
static const fltSemanticsx87DoubleExtended ()
static const fltSemanticsBogus ()
 A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.
static LLVM_ABI bool isRepresentableBy (const fltSemantics &A, const fltSemantics &B)

Detailed Description

Definition at line 149 of file APFloat.h.

Member Typedef Documentation

◆ ExponentType

A signed type to represent a floating point numbers unbiased exponent.

Definition at line 155 of file APFloat.h.

◆ integerPart

Definition at line 151 of file APFloat.h.

◆ roundingMode

IEEE-754R 4.3: Rounding-direction attributes.

Definition at line 342 of file APFloat.h.

Member Enumeration Documentation

◆ cmpResult

IEEE-754R 5.11: Floating Point Comparison Relations.

Enumerator
cmpLessThan 
cmpEqual 
cmpGreaterThan 
cmpUnordered 

Definition at line 334 of file APFloat.h.

◆ fltCategory

Category of internally-represented number.

Enumerator
fcInfinity 
fcNaN 
fcNormal 
fcZero 

Definition at line 370 of file APFloat.h.

◆ IlogbErrorKinds

Enumeration of ilogb error results.

Enumerator
IEK_Zero 
IEK_NaN 
IEK_Inf 

Definition at line 383 of file APFloat.h.

◆ opStatus

IEEE-754R 7: Default exception handling.

opUnderflow or opOverflow are always returned or-ed with opInexact.

APFloat models this behavior specified by IEEE-754: "For operations producing results in floating-point format, the default result of an operation that signals the invalid operation exception shall be a quiet NaN."

Enumerator
opOK 
opInvalidOp 
opDivByZero 
opOverflow 
opUnderflow 
opInexact 

Definition at line 360 of file APFloat.h.

◆ Semantics

Enumerator
S_IEEEhalf 
S_BFloat 
S_IEEEsingle 
S_IEEEdouble 
S_IEEEquad 
S_PPCDoubleDouble 
S_PPCDoubleDoubleLegacy 
S_Float8E5M2 
S_Float8E5M2FNUZ 
S_Float8E4M3 
S_Float8E4M3FN 
S_Float8E4M3FNUZ 
S_Float8E4M3B11FNUZ 
S_Float8E3M4 
S_FloatTF32 
S_Float8E8M0FNU 
S_Float6E3M2FN 
S_Float6E2M3FN 
S_Float4E2M1FN 
S_x87DoubleExtended 
S_MaxSemantics 

Definition at line 159 of file APFloat.h.

◆ uninitializedTag

Convenience enum used to construct an uninitialized APFloat.

Enumerator
uninitialized 

Definition at line 378 of file APFloat.h.

Member Function Documentation

◆ BFloat()

◆ Bogus()

const fltSemantics & llvm::APFloatBase::Bogus ( )
inlinestatic

A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.

Definition at line 323 of file APFloat.h.

Referenced by llvm::DenseMapInfo< APFloat >::getEmptyKey(), and llvm::DenseMapInfo< APFloat >::getTombstoneKey().

◆ EnumToSemantics()

◆ Float4E2M1FN()

const fltSemantics & llvm::APFloatBase::Float4E2M1FN ( )
inlinestatic

Definition at line 316 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float6E2M3FN()

const fltSemantics & llvm::APFloatBase::Float6E2M3FN ( )
inlinestatic

Definition at line 315 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float6E3M2FN()

const fltSemantics & llvm::APFloatBase::Float6E3M2FN ( )
inlinestatic

Definition at line 314 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E3M4()

const fltSemantics & llvm::APFloatBase::Float8E3M4 ( )
inlinestatic

Definition at line 311 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E4M3()

const fltSemantics & llvm::APFloatBase::Float8E4M3 ( )
inlinestatic

Definition at line 305 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E4M3B11FNUZ()

const fltSemantics & llvm::APFloatBase::Float8E4M3B11FNUZ ( )
inlinestatic

Definition at line 308 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E4M3FN()

const fltSemantics & llvm::APFloatBase::Float8E4M3FN ( )
inlinestatic

Definition at line 306 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E4M3FNUZ()

const fltSemantics & llvm::APFloatBase::Float8E4M3FNUZ ( )
inlinestatic

Definition at line 307 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E5M2()

const fltSemantics & llvm::APFloatBase::Float8E5M2 ( )
inlinestatic

Definition at line 303 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E5M2FNUZ()

const fltSemantics & llvm::APFloatBase::Float8E5M2FNUZ ( )
inlinestatic

Definition at line 304 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ Float8E8M0FNU()

const fltSemantics & llvm::APFloatBase::Float8E8M0FNU ( )
inlinestatic

Definition at line 313 of file APFloat.h.

Referenced by EnumToSemantics(), llvm::APFloat::hasSignificand(), and SemanticsToEnum().

◆ FloatTF32()

const fltSemantics & llvm::APFloatBase::FloatTF32 ( )
inlinestatic

Definition at line 312 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ getSizeInBits()

unsigned llvm::APFloatBase::getSizeInBits ( const fltSemantics & Sem)
static

Returns the size of the floating point number (in bits) in the given semantics.

Definition at line 360 of file APFloat.cpp.

References llvm::fltSemantics::sizeInBits.

Referenced by llvm::MachineIRBuilder::buildFConstant().

◆ hasSignBitInMSB()

bool llvm::APFloatBase::hasSignBitInMSB ( const fltSemantics & semantics)
static

◆ IEEEdouble()

◆ IEEEhalf()

◆ IEEEquad()

◆ IEEEsingle()

◆ isIEEELikeFP()

bool llvm::APFloatBase::isIEEELikeFP ( const fltSemantics & semantics)
static

Definition at line 337 of file APFloat.cpp.

References S_IEEEquad, and SemanticsToEnum().

◆ isRepresentableAsNormalIn()

bool llvm::APFloatBase::isRepresentableAsNormalIn ( const fltSemantics & Src,
const fltSemantics & Dst )
static

Definition at line 346 of file APFloat.cpp.

Referenced by computeKnownFPClass().

◆ isRepresentableBy()

bool llvm::APFloatBase::isRepresentableBy ( const fltSemantics & A,
const fltSemantics & B )
static

Definition at line 266 of file APFloat.cpp.

References A(), and B().

Referenced by llvm::APFloat::convertToDouble(), and llvm::APFloat::convertToFloat().

◆ PPCDoubleDouble()

◆ PPCDoubleDoubleLegacy()

const fltSemantics & llvm::APFloatBase::PPCDoubleDoubleLegacy ( )
inlinestatic

Definition at line 300 of file APFloat.h.

Referenced by EnumToSemantics(), and SemanticsToEnum().

◆ semanticsHasInf()

bool llvm::APFloatBase::semanticsHasInf ( const fltSemantics & semantics)
static

Definition at line 329 of file APFloat.cpp.

References llvm::IEEE754, and llvm::fltSemantics::nonFiniteBehavior.

◆ semanticsHasNaN()

bool llvm::APFloatBase::semanticsHasNaN ( const fltSemantics & semantics)
static

Definition at line 333 of file APFloat.cpp.

References llvm::FiniteOnly, and llvm::fltSemantics::nonFiniteBehavior.

◆ semanticsHasSignedRepr()

bool llvm::APFloatBase::semanticsHasSignedRepr ( const fltSemantics & semantics)
static

Definition at line 325 of file APFloat.cpp.

References llvm::fltSemantics::hasSignedRepr.

◆ semanticsHasZero()

bool llvm::APFloatBase::semanticsHasZero ( const fltSemantics & semantics)
static

Definition at line 321 of file APFloat.cpp.

References llvm::fltSemantics::hasZero.

◆ semanticsIntSizeInBits()

unsigned int llvm::APFloatBase::semanticsIntSizeInBits ( const fltSemantics & semantics,
bool isSigned )
static

Definition at line 310 of file APFloat.cpp.

References isSigned(), and semanticsMaxExponent().

Referenced by canEvaluateTruncated(), and isSaturatingMinMax().

◆ semanticsMaxExponent()

APFloatBase::ExponentType llvm::APFloatBase::semanticsMaxExponent ( const fltSemantics & semantics)
static

◆ semanticsMinExponent()

APFloatBase::ExponentType llvm::APFloatBase::semanticsMinExponent ( const fltSemantics & semantics)
static

Definition at line 304 of file APFloat.cpp.

References llvm::fltSemantics::minExponent.

Referenced by llvm::FunctionComparator::cmpAPFloats().

◆ semanticsPrecision()

◆ semanticsSizeInBits()

unsigned int llvm::APFloatBase::semanticsSizeInBits ( const fltSemantics & semantics)
static

Definition at line 307 of file APFloat.cpp.

References llvm::fltSemantics::sizeInBits.

Referenced by llvm::FunctionComparator::cmpAPFloats().

◆ SemanticsToEnum()

◆ x87DoubleExtended()

◆ APFloat

friend class APFloat
friend

Definition at line 291 of file APFloat.h.

References APFloat.

Referenced by APFloat, llvm::APFloat::convert(), and llvm::APFloat::getAllOnesValue().

◆ detail::DoubleAPFloat

friend class detail::DoubleAPFloat
friend

Definition at line 290 of file APFloat.h.

◆ detail::IEEEFloat

friend class detail::IEEEFloat
friend

Definition at line 289 of file APFloat.h.

Member Data Documentation

◆ integerPartWidth

unsigned llvm::APFloatBase::integerPartWidth = APInt::APINT_BITS_PER_WORD
staticconstexpr

◆ rmNearestTiesToAway

RoundingMode llvm::APFloatBase::rmNearestTiesToAway
staticconstexpr
Initial value:

Definition at line 349 of file APFloat.h.

Referenced by llvm::FixedPointSemantics::fitsInFloatSemantics().

◆ rmNearestTiesToEven

RoundingMode llvm::APFloatBase::rmNearestTiesToEven
staticconstexpr
Initial value:

Definition at line 344 of file APFloat.h.

Referenced by llvm::APFloat::APFloat(), canLosslesslyConvertToFPType(), llvm::checkConvertToNonDenormSingle(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldFPBinOp(), constantFoldFpUnary(), llvm::ConstantFoldIntToFloat(), llvm::APFloat::convertToDouble(), llvm::APFixedPoint::convertToFloat(), llvm::APFloat::convertToFloat(), llvm::convertToNonDenormSingle(), emitDebugValueComment(), llvm::TargetLowering::expandFP_TO_UINT(), fitsInFPType(), fixFuncEntryCount(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SelectionDAG::foldConstantFPMath(), foldFCmpFpTrunc(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), foldFrexpOfSelect(), llvm::ConstantFP::get(), llvm::getAPFloatFromSize(), llvm::StringRef::getAsDouble(), llvm::SelectionDAG::getConstantFP(), llvm::ExecutionEngine::getConstantValue(), llvm::nvvm::GetFAddRoundingMode(), llvm::nvvm::GetFDivRoundingMode(), llvm::nvvm::GetFMARoundingMode(), llvm::nvvm::GetFMulRoundingMode(), llvm::nvvm::GetFPToIntegerRoundingMode(), llvm::RISCVLoadFPImm::getLoadFPImm(), llvm::SelectionDAG::getNode(), llvm::nvvm::GetRCPRoundingMode(), llvm::harrisonUlp(), llvm::detail::IEEEFloat::ilogb, llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::APFloat::isExactlyValue(), llvm::ConstantFP::isExactlyValue(), isFPExtFromF16OrConst(), llvm::ConstantFP::isValueValidForType(), llvm::ConstantFPSDNode::isValueValidForType(), LLVMConstRealGetDouble(), llvm::LegalizerHelper::lowerFPTOUI(), LowerFROUND(), lowerFTRUNC_FCEIL_FFLOOR_FROUND(), lowerVectorFTRUNC_FCEIL_FFLOOR_FROUND(), lowerVectorStrictFTRUNC_FCEIL_FFLOOR_FROUND(), llvm::CombinerHelper::matchConstantFoldFMA(), matchFPExtFromF16(), llvm::APFloat::operator*(), llvm::APFloat::operator+(), llvm::APFloat::operator-(), llvm::APFloat::operator/(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), llvm::NVPTXFloatMCExpr::printImpl(), strictFPExtFromF16(), toString(), valueHasFloatPrecision(), llvm::InstCombinerImpl::visitFCmpInst(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().

◆ rmTowardNegative

◆ rmTowardPositive

◆ rmTowardZero


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