template <FPType fp_type, typename RetT>

struct FPRepImpl

Defined at line 615 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

'FPRepImpl' is the bottom of the class hierarchy that only deals with

'FPType'. The operations dealing with specific float semantics are

implemented by 'FPRepSem' above and specialized when needed.

The 'RetT' type is being propagated up to 'FPRepSem' so that the functions

creating new values (Builders) can return the appropriate type. That is, when

creating a value through 'FPBits' below the builder will return an 'FPBits'

value.

FPBits

<float

>::zero(); // returns an FPBits

<

>

When we don't care about specific C++ floating point type we can use

'FPRep' and specify the 'FPType' directly.

FPRep

<FPType

::IEEE754_Binary32:>::zero() // returns an FPRep

<

>

Public Members

static const int MAX_BIASED_EXPONENT

Public Methods

void FPRepImpl<fp_type, RetT> ()

CTors

Defined at line 643 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

void FPRepImpl<fp_type, RetT> (StorageType x)

Defined at line 644 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

StorageType uintval ()

Representation

Defined at line 655 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

void set_uintval (StorageType value)

Defined at line 656 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

RetT abs ()

Modifiers

Defined at line 672 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

bool is_inf_or_nan ()

Defined at line 688 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

bool is_neg ()

Defined at line 689 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

bool is_pos ()

Defined at line 690 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

uint16_t get_biased_exponent ()

Defined at line 692 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

void set_biased_exponent (StorageType biased)

Defined at line 696 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

int get_exponent ()

Defined at line 700 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

int get_explicit_exponent ()

If the number is subnormal, the exponent is treated as if it were the

minimum exponent for a normal number. This is to keep continuity between

the normal and subnormal ranges, but it causes problems for functions where

values are calculated from the exponent, since just subtracting the bias

will give a slightly incorrect result. Additionally, zero has an exponent

of zero, and that should actually be treated as zero.

Defined at line 710 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

StorageType get_mantissa ()

Defined at line 719 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

void set_mantissa (StorageType mantVal)

Defined at line 723 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

void set_significand (StorageType sigVal)

Defined at line 727 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

RetT create_value (Sign sign, StorageType biased_exp, StorageType mantissa)

Unsafe function to create a floating point representation.

It simply packs the sign, biased exponent and mantissa values without

checking bound nor normalization.

WARNING: For X86 Extended Precision, implicit bit needs to be set correctly

in the 'mantissa' by the caller. This function will not check for its

validity.

FIXME: Use an uint32_t for 'biased_exp'.

Defined at line 739 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

RetT make_value (StorageType number, int ep)

The function converts integer number and unbiased exponent to proper

float T type:

Result = number * 2^(ep+1 - exponent_bias)

Be careful!

1) "ep" is the raw exponent value.

2) The function adds +1 to ep for seamless normalized to denormalized

transition.

3) The function does not check exponent high limit.

4) "number" zero value is not processed correctly.

5) Number is unsigned, so the result can be only positive.

Defined at line 755 of file ../../third_party/llvm-libc/src/src/__support/FPUtil/FPBits.h

Friends

template <FPType fp_type, typename RetT>
bool FPRepImpl (FPRepImpl<fp_type, RetT> a, FPRepImpl<fp_type, RetT> b)
template <FPType fp_typetypename RetT>
bool FPRepImpl (FPRepImpl<fp_type, RetT> aFPRepImpl<fp_type, RetT> b)