RetroArch
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
spvutils::HexFloat< T, Traits > Class Template Reference

#include <hex_float.h>

Collaboration diagram for spvutils::HexFloat< T, Traits >:
[legend]

Public Types

typedef Traits::uint_type uint_type
 
typedef Traits::int_type int_type
 
typedef Traits::underlying_type underlying_type
 
typedef Traits::native_type native_type
 

Public Member Functions

 HexFloat (T f)
 
T value () const
 
void set_value (T f)
 
uint_type getBits () const
 
uint_type getUnsignedBits () const
 
const uint_type getExponentBits () const
 
const int_type getUnbiasedExponent () const
 
const uint_type getSignificandBits () const
 
const int_type getUnbiasedNormalizedExponent () const
 
const uint_type getNormalizedSignificand () const
 
bool isNegative () const
 
void setFromSignUnbiasedExponentAndNormalizedSignificand (bool negative, int_type exponent, uint_type significand, bool round_denorm_up)
 
template<typename int_type >
uint_type negatable_left_shift (int_type N, uint_type val)
 
template<typename int_type >
uint_type negatable_right_shift (int_type N, uint_type val)
 
template<typename other_T >
other_T::uint_type getRoundedNormalizedSignificand (round_direction dir, bool *carry_bit)
 
template<typename other_T >
void castTo (other_T &other, round_direction round_dir)
 

Static Public Member Functions

static uint_type incrementSignificand (uint_type significand, uint_type to_increment, bool *carry)
 

Static Public Attributes

static const uint32_t num_used_bits = Traits::num_used_bits
 
static const uint32_t exponent_bias = Traits::exponent_bias
 
static const uint32_t num_exponent_bits = Traits::num_exponent_bits
 
static const uint32_t num_fraction_bits = Traits::num_fraction_bits
 
static const uint32_t top_bit_left_shift = num_used_bits - 1
 
static const uint32_t fraction_nibbles = (num_fraction_bits + 3) / 4
 
static const uint32_t num_overflow_bits
 
static const uint_type fraction_represent_mask
 
static const uint_type fraction_top_bit
 
static const uint_type first_exponent_bit
 
static const uint_type fraction_encode_mask
 
static const uint_type sign_mask = uint_type(1) << top_bit_left_shift
 
static const uint_type exponent_mask
 
static const uint32_t exponent_left_shift = num_fraction_bits
 
static const uint32_t fraction_right_shift
 
static const int_type max_exponent
 
static const int_type min_exponent = -static_cast<int_type>(exponent_bias)
 

Private Attributes

T value_
 

Member Typedef Documentation

◆ int_type

template<typename T, typename Traits = HexFloatTraits<T>>
typedef Traits::int_type spvutils::HexFloat< T, Traits >::int_type

◆ native_type

template<typename T, typename Traits = HexFloatTraits<T>>
typedef Traits::native_type spvutils::HexFloat< T, Traits >::native_type

◆ uint_type

template<typename T, typename Traits = HexFloatTraits<T>>
typedef Traits::uint_type spvutils::HexFloat< T, Traits >::uint_type

◆ underlying_type

template<typename T, typename Traits = HexFloatTraits<T>>
typedef Traits::underlying_type spvutils::HexFloat< T, Traits >::underlying_type

Constructor & Destructor Documentation

◆ HexFloat()

template<typename T, typename Traits = HexFloatTraits<T>>
spvutils::HexFloat< T, Traits >::HexFloat ( T  f)
inlineexplicit

Member Function Documentation

◆ castTo()

template<typename T, typename Traits = HexFloatTraits<T>>
template<typename other_T >
void spvutils::HexFloat< T, Traits >::castTo ( other_T &  other,
round_direction  round_dir 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBits()

template<typename T, typename Traits = HexFloatTraits<T>>
uint_type spvutils::HexFloat< T, Traits >::getBits ( ) const
inline
Here is the caller graph for this function:

◆ getExponentBits()

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::getExponentBits ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNormalizedSignificand()

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::getNormalizedSignificand ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRoundedNormalizedSignificand()

template<typename T, typename Traits = HexFloatTraits<T>>
template<typename other_T >
other_T::uint_type spvutils::HexFloat< T, Traits >::getRoundedNormalizedSignificand ( round_direction  dir,
bool carry_bit 
)
inline
Here is the call graph for this function:

◆ getSignificandBits()

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::getSignificandBits ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnbiasedExponent()

template<typename T, typename Traits = HexFloatTraits<T>>
const int_type spvutils::HexFloat< T, Traits >::getUnbiasedExponent ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnbiasedNormalizedExponent()

template<typename T, typename Traits = HexFloatTraits<T>>
const int_type spvutils::HexFloat< T, Traits >::getUnbiasedNormalizedExponent ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUnsignedBits()

template<typename T, typename Traits = HexFloatTraits<T>>
uint_type spvutils::HexFloat< T, Traits >::getUnsignedBits ( ) const
inline
Here is the caller graph for this function:

◆ incrementSignificand()

template<typename T, typename Traits = HexFloatTraits<T>>
static uint_type spvutils::HexFloat< T, Traits >::incrementSignificand ( uint_type  significand,
uint_type  to_increment,
bool carry 
)
inlinestatic
Here is the caller graph for this function:

◆ isNegative()

template<typename T, typename Traits = HexFloatTraits<T>>
bool spvutils::HexFloat< T, Traits >::isNegative ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ negatable_left_shift()

template<typename T, typename Traits = HexFloatTraits<T>>
template<typename int_type >
uint_type spvutils::HexFloat< T, Traits >::negatable_left_shift ( int_type  N,
uint_type  val 
)
inline
Here is the caller graph for this function:

◆ negatable_right_shift()

template<typename T, typename Traits = HexFloatTraits<T>>
template<typename int_type >
uint_type spvutils::HexFloat< T, Traits >::negatable_right_shift ( int_type  N,
uint_type  val 
)
inline
Here is the caller graph for this function:

◆ set_value()

template<typename T, typename Traits = HexFloatTraits<T>>
void spvutils::HexFloat< T, Traits >::set_value ( T  f)
inline
Here is the caller graph for this function:

◆ setFromSignUnbiasedExponentAndNormalizedSignificand()

template<typename T, typename Traits = HexFloatTraits<T>>
void spvutils::HexFloat< T, Traits >::setFromSignUnbiasedExponentAndNormalizedSignificand ( bool  negative,
int_type  exponent,
uint_type  significand,
bool  round_denorm_up 
)
inline

◆ value()

template<typename T, typename Traits = HexFloatTraits<T>>
T spvutils::HexFloat< T, Traits >::value ( ) const
inline
Here is the caller graph for this function:

Member Data Documentation

◆ exponent_bias

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::exponent_bias = Traits::exponent_bias
static

◆ exponent_left_shift

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::exponent_left_shift = num_fraction_bits
static

◆ exponent_mask

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::exponent_mask
static

◆ first_exponent_bit

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::first_exponent_bit
static
Initial value:

◆ fraction_encode_mask

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::fraction_encode_mask
static

◆ fraction_nibbles

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::fraction_nibbles = (num_fraction_bits + 3) / 4
static

◆ fraction_represent_mask

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::fraction_represent_mask
static

◆ fraction_right_shift

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::fraction_right_shift
static
Initial value:
=
static_cast<uint32_t>(sizeof(uint_type) * 8) - num_fraction_bits

◆ fraction_top_bit

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::fraction_top_bit
static
Initial value:

◆ max_exponent

template<typename T, typename Traits = HexFloatTraits<T>>
const int_type spvutils::HexFloat< T, Traits >::max_exponent
static

◆ min_exponent

template<typename T, typename Traits = HexFloatTraits<T>>
const int_type spvutils::HexFloat< T, Traits >::min_exponent = -static_cast<int_type>(exponent_bias)
static

◆ num_exponent_bits

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::num_exponent_bits = Traits::num_exponent_bits
static

◆ num_fraction_bits

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::num_fraction_bits = Traits::num_fraction_bits
static

◆ num_overflow_bits

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::num_overflow_bits
static
Initial value:

◆ num_used_bits

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::num_used_bits = Traits::num_used_bits
static

◆ sign_mask

template<typename T, typename Traits = HexFloatTraits<T>>
const uint_type spvutils::HexFloat< T, Traits >::sign_mask = uint_type(1) << top_bit_left_shift
static

◆ top_bit_left_shift

template<typename T, typename Traits = HexFloatTraits<T>>
const uint32_t spvutils::HexFloat< T, Traits >::top_bit_left_shift = num_used_bits - 1
static

◆ value_

template<typename T, typename Traits = HexFloatTraits<T>>
T spvutils::HexFloat< T, Traits >::value_
private

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