LLVM 22.0.0git
|
#include "llvm/ADT/APFloat.h"
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 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 |
typedef int32_t llvm::APFloatBase::ExponentType |
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 |
|
inlinestatic |
Definition at line 295 of file APFloat.h.
Referenced by EnumToSemantics(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::ConstantDataSequential::getElementAsAPFloat(), llvm::MVT::getFltSemantics(), getOpFltSemantics(), llvm::ConstantFP::isValueValidForType(), llvm::NVPTXFloatMCExpr::printImpl(), llvm::APFixedPoint::promoteFloatSemantics(), SemanticsToEnum(), shrinkFPConstant(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().
|
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().
|
static |
Definition at line 174 of file APFloat.cpp.
References BFloat(), Float4E2M1FN(), Float6E2M3FN(), Float6E3M2FN(), Float8E3M4(), Float8E4M3(), Float8E4M3B11FNUZ(), Float8E4M3FN(), Float8E4M3FNUZ(), Float8E5M2(), Float8E5M2FNUZ(), Float8E8M0FNU(), FloatTF32(), IEEEdouble(), IEEEhalf(), IEEEquad(), IEEEsingle(), llvm_unreachable, PPCDoubleDouble(), PPCDoubleDoubleLegacy(), S_BFloat, S_Float4E2M1FN, S_Float6E2M3FN, S_Float6E3M2FN, S_Float8E3M4, S_Float8E4M3, S_Float8E4M3B11FNUZ, S_Float8E4M3FN, S_Float8E4M3FNUZ, S_Float8E5M2, S_Float8E5M2FNUZ, S_Float8E8M0FNU, S_FloatTF32, S_IEEEdouble, S_IEEEhalf, S_IEEEquad, S_IEEEsingle, S_PPCDoubleDouble, S_PPCDoubleDoubleLegacy, S_x87DoubleExtended, and x87DoubleExtended().
|
inlinestatic |
Definition at line 316 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 315 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 314 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 311 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 305 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 308 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 306 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 307 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 303 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 304 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 313 of file APFloat.h.
Referenced by EnumToSemantics(), llvm::APFloat::hasSignificand(), and SemanticsToEnum().
|
inlinestatic |
Definition at line 312 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
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().
|
static |
Definition at line 342 of file APFloat.cpp.
References llvm::fltSemantics::hasSignBitInMSB.
Referenced by llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitOr(), and llvm::InstCombinerImpl::visitXor().
|
inlinestatic |
Definition at line 297 of file APFloat.h.
Referenced by llvm::APFloat::APFloat(), combineBitcast(), constantFoldFpUnary(), convertIntToDoubleImm(), emitDebugValueComment(), EnumToSemantics(), fixFuncEntryCount(), llvm::SelectionDAG::FoldConstantArithmetic(), getConstantVector(), getConstantVector(), llvm::ConstantDataSequential::getElementAsAPFloat(), llvm::getFltSemanticForLLT(), getFltSemantics(), llvm::MVT::getFltSemantics(), llvm::RISCVLoadFPImm::getLoadFPImm(), getOneFP(), getOpFltSemantics(), getZeroFP(), isInv2Pi(), isInv2Pi(), llvm::ConstantFP::isValueValidForType(), llvm::AMDGPULegalizerInfo::legalizeFroundeven(), llvm::AMDGPULegalizerInfo::legalizeRsqClampIntrinsic(), LLVMConstRealGetDouble(), llvm::LegalizerHelper::lowerFPTOUI(), llvm::AMDGPUTargetLowering::LowerFROUNDEVEN(), llvm::ARMAsmPrinter::lowerOperand(), LowerUINT_TO_FP_i64(), lowerUINT_TO_FP_vXi32(), llvm::SDNode::print_details(), llvm::NVPTXFloatMCExpr::printImpl(), llvm::WebAssemblyInstPrinter::printOperand(), llvm::APFixedPoint::promoteFloatSemantics(), SemanticsToEnum(), shrinkFPConstant(), and writeAPFloatInternal().
|
inlinestatic |
Definition at line 294 of file APFloat.h.
Referenced by canSafelyConvertTo16Bit(), convertNvvmIntrinsicToLlvm(), EnumToSemantics(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::getAPFloatFromSize(), getConstantVector(), getConstantVector(), llvm::ConstantDataSequential::getElementAsAPFloat(), llvm::getFltSemanticForLLT(), getFltSemantics(), llvm::MVT::getFltSemantics(), llvm::RISCVLoadFPImm::getLoadFPImm(), getOneFP(), getOpFltSemantics(), getZeroFP(), llvm::GCNTTIImpl::instCombineIntrinsic(), isFPExtFromF16OrConst(), isInv2Pi(), isInv2Pi(), llvm::ConstantFP::isValueValidForType(), matchFPExtFromF16(), llvm::NVPTXFloatMCExpr::printImpl(), llvm::APFixedPoint::promoteFloatSemantics(), SemanticsToEnum(), shrinkFPConstant(), strictFPExtFromF16(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().
|
inlinestatic |
Definition at line 298 of file APFloat.h.
Referenced by EnumToSemantics(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::getFltSemanticForLLT(), llvm::MVT::getFltSemantics(), llvm::ConstantFP::isValueValidForType(), llvm::APFixedPoint::promoteFloatSemantics(), SemanticsToEnum(), llvm::SystemZVectorConstantInfo::SystemZVectorConstantInfo(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().
|
inlinestatic |
Definition at line 296 of file APFloat.h.
Referenced by llvm::APFloat::APFloat(), llvm::checkConvertToNonDenormSingle(), convertNvvmIntrinsicToLlvm(), llvm::convertToNonDenormSingle(), EnumToSemantics(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::generateReadImageInst(), getConstantVector(), getConstantVector(), llvm::ConstantDataSequential::getElementAsAPFloat(), getF32Constant(), llvm::getFltSemanticForLLT(), getFltSemantics(), llvm::MVT::getFltSemantics(), llvm::RISCVLoadFPImm::getLoadFPImm(), getOneFP(), getOpFltSemantics(), llvm::AMDGPULegalizerInfo::getScaledLogInput(), llvm::AMDGPUTargetLowering::getScaledLogInput(), getZeroFP(), llvm::Attributor::identifyDefaultAbstractAttributes(), isInv2Pi(), isInv2Pi(), llvm::ConstantFP::isValueValidForType(), llvm::AMDGPULegalizerInfo::legalizeFExp(), llvm::AMDGPULegalizerInfo::legalizeFlogCommon(), llvm::AMDGPULegalizerInfo::legalizeRsqClampIntrinsic(), llvm::AMDGPUTargetLowering::lowerFEXP(), llvm::LegalizerHelper::lowerFPTOUI(), lowerUINT_TO_FP_vXi32(), llvm::AMDGPUTargetLowering::needsDenormHandlingF32(), needsDenormHandlingF32(), llvm::SDNode::print_details(), llvm::NVPTXFloatMCExpr::printImpl(), llvm::WebAssemblyInstPrinter::printOperand(), llvm::APFixedPoint::promoteFloatSemantics(), SemanticsToEnum(), shrinkFPConstant(), llvm::pdb::Variant::toAPFloat(), llvm::NVPTXTargetLowering::useF32FTZ(), valueHasFloatPrecision(), and writeAPFloatInternal().
|
static |
Definition at line 337 of file APFloat.cpp.
References S_IEEEquad, and SemanticsToEnum().
|
static |
Definition at line 346 of file APFloat.cpp.
Referenced by computeKnownFPClass().
|
static |
Definition at line 266 of file APFloat.cpp.
Referenced by llvm::APFloat::convertToDouble(), and llvm::APFloat::convertToFloat().
|
inlinestatic |
Definition at line 299 of file APFloat.h.
Referenced by EnumToSemantics(), llvm::detail::frexp(), llvm::MVT::getFltSemantics(), llvm::ConstantFP::isValueValidForType(), llvm::detail::scalbn(), SemanticsToEnum(), and writeAPFloatInternal().
|
inlinestatic |
Definition at line 300 of file APFloat.h.
Referenced by EnumToSemantics(), and SemanticsToEnum().
|
static |
Definition at line 329 of file APFloat.cpp.
References llvm::IEEE754, and llvm::fltSemantics::nonFiniteBehavior.
|
static |
Definition at line 333 of file APFloat.cpp.
References llvm::FiniteOnly, and llvm::fltSemantics::nonFiniteBehavior.
|
static |
Definition at line 325 of file APFloat.cpp.
References llvm::fltSemantics::hasSignedRepr.
|
static |
Definition at line 321 of file APFloat.cpp.
References llvm::fltSemantics::hasZero.
|
static |
Definition at line 310 of file APFloat.cpp.
References isSigned(), and semanticsMaxExponent().
Referenced by canEvaluateTruncated(), and isSaturatingMinMax().
|
static |
Definition at line 300 of file APFloat.cpp.
References llvm::fltSemantics::maxExponent.
Referenced by llvm::FunctionComparator::cmpAPFloats(), and semanticsIntSizeInBits().
|
static |
Definition at line 304 of file APFloat.cpp.
References llvm::fltSemantics::minExponent.
Referenced by llvm::FunctionComparator::cmpAPFloats().
|
static |
Definition at line 296 of file APFloat.cpp.
References llvm::fltSemantics::precision.
Referenced by CastIntSETCCtoFP(), llvm::FunctionComparator::cmpAPFloats(), computeKnownFPClass(), FoldIntToFPToInt(), getEstimate(), lowerFTRUNC_FCEIL_FFLOOR_FROUND(), lowerVectorFTRUNC_FCEIL_FFLOOR_FROUND(), lowerVectorStrictFTRUNC_FCEIL_FFLOOR_FROUND(), and llvm::detail::IEEEFloat::roundToIntegral().
|
static |
Definition at line 307 of file APFloat.cpp.
References llvm::fltSemantics::sizeInBits.
Referenced by llvm::FunctionComparator::cmpAPFloats().
|
static |
Definition at line 221 of file APFloat.cpp.
References BFloat(), Float4E2M1FN(), Float6E2M3FN(), Float6E3M2FN(), Float8E3M4(), Float8E4M3(), Float8E4M3B11FNUZ(), Float8E4M3FN(), Float8E4M3FNUZ(), Float8E5M2(), Float8E5M2FNUZ(), Float8E8M0FNU(), FloatTF32(), IEEEdouble(), IEEEhalf(), IEEEquad(), IEEEsingle(), llvm_unreachable, PPCDoubleDouble(), PPCDoubleDoubleLegacy(), S_BFloat, S_Float4E2M1FN, S_Float6E2M3FN, S_Float6E3M2FN, S_Float8E3M4, S_Float8E4M3, S_Float8E4M3B11FNUZ, S_Float8E4M3FN, S_Float8E4M3FNUZ, S_Float8E5M2, S_Float8E5M2FNUZ, S_Float8E8M0FNU, S_FloatTF32, S_IEEEdouble, S_IEEEhalf, S_IEEEquad, S_IEEEsingle, S_PPCDoubleDouble, S_PPCDoubleDoubleLegacy, S_x87DoubleExtended, and x87DoubleExtended().
Referenced by isIEEELikeFP(), and llvm::SIInstrInfo::isInlineConstant().
|
inlinestatic |
Definition at line 317 of file APFloat.h.
Referenced by EnumToSemantics(), llvm::ExecutionEngine::getConstantValue(), llvm::MVT::getFltSemantics(), llvm::ConstantFP::isValueValidForType(), SemanticsToEnum(), toStringAPFloat(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().
|
friend |
Definition at line 291 of file APFloat.h.
References APFloat.
Referenced by APFloat, llvm::APFloat::convert(), and llvm::APFloat::getAllOnesValue().
|
friend |
|
friend |
|
staticconstexpr |
Definition at line 152 of file APFloat.h.
Referenced by llvm::lostFractionThroughTruncation(), llvm::partAsHex(), llvm::partCountForBits(), and llvm::ulpsFromBoundary().
|
staticconstexpr |
Definition at line 349 of file APFloat.h.
Referenced by llvm::FixedPointSemantics::fitsInFloatSemantics().
|
staticconstexpr |
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().
|
staticconstexpr |
Definition at line 347 of file APFloat.h.
Referenced by llvm::SelectionDAG::FoldConstantArithmetic(), llvm::nvvm::GetFAddRoundingMode(), llvm::nvvm::GetFDivRoundingMode(), llvm::nvvm::GetFMARoundingMode(), llvm::nvvm::GetFMulRoundingMode(), llvm::nvvm::GetFPToIntegerRoundingMode(), and llvm::nvvm::GetRCPRoundingMode().
|
staticconstexpr |
Definition at line 346 of file APFloat.h.
Referenced by llvm::SelectionDAG::FoldConstantArithmetic(), llvm::nvvm::GetFAddRoundingMode(), llvm::nvvm::GetFDivRoundingMode(), llvm::nvvm::GetFMARoundingMode(), llvm::nvvm::GetFMulRoundingMode(), llvm::nvvm::GetFPToIntegerRoundingMode(), and llvm::nvvm::GetRCPRoundingMode().
|
staticconstexpr |
Definition at line 348 of file APFloat.h.
Referenced by canSafelyConvertTo16Bit(), checkCVTFixedPointOperandWithFBits(), llvm::ConstantFoldCastInstruction(), llvm::APFixedPoint::convertToFloat(), ConvertToSInt(), llvm::TargetLowering::expandFP_TO_INT_SAT(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), llvm::BuildVectorSDNode::getConstantFPSplatPow2ToLog2Int(), llvm::ExecutionEngine::getConstantValue(), llvm::APFloat::getExactInverse(), llvm::nvvm::GetFAddRoundingMode(), llvm::nvvm::GetFDivRoundingMode(), llvm::nvvm::GetFMARoundingMode(), llvm::nvvm::GetFMulRoundingMode(), llvm::nvvm::GetFPToIntegerRoundingMode(), llvm::APFixedPoint::getFromFloatValue(), llvm::nvvm::GetRCPRoundingMode(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::PPCTargetLowering::isFPImmLegal(), llvm::LegalizerHelper::lowerFPTOINT_SAT(), llvm::ARMAsmPrinter::lowerOperand(), and PerformVMulVCTPCombine().