Shared type definitions for APFloat and its internal implementation classes.

Synopsis

Declared in <llvm/ADT/APFloat.h>

class APFloatBase;

Description

Holds floating‐point semantic enums, status/category codes, and accessors for built‐in fltSemantics. This class defines no non‐static data members.

Type Aliases

Name

Description

ExponentType

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

integerPart

Unsigned word type used for multi‐precision integer parts of a float.

roundingMode

IEEE‐754R 4.3: Rounding‐direction attributes.

Enums

Name

Description

IlogbErrorKinds

Enumeration of ilogb error results.

Semantics

@{ Identifiers for the built‐in floating‐point formats APFloat supports.

cmpResult

IEEE‐754R 5.11: Floating Point Comparison Relations.

fltCategory

Category of internally‐represented number.

opStatus

IEEE‐754R 7: Default exception handling.

uninitializedTag

Convenience enum used to construct an uninitialized APFloat.

Static Member Functions

Name

Description

BFloat

Return bfloat16 semantics.

Bogus

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

EnumToSemantics

Map a Semantics enumerator to its corresponding fltSemantics.

Float4E2M1FN

Return 4‐bit S1E2M1 finite‐only floating‐point semantics.

Float6E2M3FN

Return 6‐bit S1E2M3 finite‐only floating‐point semantics.

Float6E3M2FN

Return 6‐bit S1E3M2 finite‐only floating‐point semantics.

Float8E3M4

Return 8‐bit S1E3M4 floating‐point semantics.

Float8E4M3

Return 8‐bit S1E4M3 floating‐point semantics.

Float8E4M3B11FNUZ

Return 8‐bit S1E4M3 bias‐11 finite / unsigned‐zero floating‐point semantics.

Float8E4M3FN

Return 8‐bit S1E4M3 finite‐only floating‐point semantics.

Float8E4M3FNUZ

Return 8‐bit S1E4M3 finite / unsigned‐zero floating‐point semantics.

Float8E5M2

Return 8‐bit S1E5M2 floating‐point semantics.

Float8E5M2FNUZ

Return 8‐bit S1E5M2 finite / unsigned‐zero floating‐point semantics.

Float8E5M3FNU

Return 8‐bit S0E5M3 floating‐point semantics.

Float8E8M0FNU

Return 8‐bit unsigned E8M0 scale floating‐point semantics.

FloatTF32

Return TensorFloat‐32 semantics.

IEEEdouble

Return IEEE 754 binary64 (double) semantics.

IEEEhalf

Return IEEE 754 binary16 (half) semantics.

IEEEquad

Return IEEE 754 binary128 (quad) semantics.

IEEEsingle

Return IEEE 754 binary32 (single) semantics.

PPCDoubleDouble

Return IBM double‐double semantics.

PPCDoubleDoubleLegacy

Return legacy IBM double‐double (consecutive 106‐bit mantissa) semantics.

SemanticsToEnum

Map a fltSemantics object to its corresponding Semantics enumerator.

getArbitraryFPFormatSizeInBits

Return the size in bits of a valid arbitrary floating‐point format string.

getArbitraryFPSemantics

Returns the fltSemantics for a given arbitrary FP format string, or nullptr if invalid.

getSizeInBits

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

hasSignBitInMSB

Return true if the sign bit of Sem is the most significant bit.

isIEEELikeFP

Return true if Sem follows IEEE‐like encoding conventions.

isRepresentableAsNormalIn

Returns true if any number described by Src can be precisely represented by a normal (not subnormal) value in Dst.

isRepresentableBy

Return true if every finite value of semantics A is exactly representable in semantics B.

isValidArbitraryFPFormat

Return true if Format is a valid arbitrary floating‐point format string.

semanticsHasInf

Return true if Sem encodes infinities.

semanticsHasNaN

Return true if Sem encodes NaN values.

semanticsHasSignedRepr

Return true if Sem can represent signed values.

semanticsHasZero

Return true if Sem encodes a zero value.

semanticsIntSizeInBits

Return how many integer bits are needed to hold values of Sem.

semanticsMaxExponent

Return the maximum unbiased exponent of Sem.

semanticsMinExponent

Return the minimum normalized unbiased exponent of Sem.

semanticsPrecision

Return the significand precision (including the integer bit) of Sem.

semanticsSizeInBits

Return the storage size in bits of a value with semantics Sem.

x87DoubleExtended

Return x87 80‐bit double‐extended semantics.

Static Data Members

Name

Description

integerPartWidth

Number of bits in one integerPart word.

rmNearestTiesToAway

Round to nearest, ties away from zero.

rmNearestTiesToEven

Round to nearest, ties to even (IEEE default).

rmTowardNegative

Round toward negative infinity.

rmTowardPositive

Round toward positive infinity.

rmTowardZero

Round toward zero (truncate).

Friends

Name

Description

llvm::APFloat

Arbitrary‐precision floating‐point value.

Derived Classes

Name

Description

APFloat

Arbitrary‐precision floating‐point value.

Created with MrDocs