IDA C++ SDK 9.2
Loading...
Searching...
No Matches
fpvalue_t Struct Reference

Processor-independent representation of a floating point value. More...

#include <ieee.h>

Public Member Functions

void clear (void)
 DECLARE_COMPARISONS (fpvalue_t)
fpvalue_error_t from_half (uint16 fpval)
 Convert to the processor-independent representation.
fpvalue_error_t from_float (float fpval)
fpvalue_error_t from_double (double fpval)
fpvalue_error_t to_half (uint16 *fpval) const
 Convert from the processor-independent representation.
fpvalue_error_t to_float (float *fpval) const
fpvalue_error_t to_double (double *fpval) const
fpvalue_error_t from_10bytes (const void *fpval)
 Conversions for 10-byte floating point values.
fpvalue_error_t to_10bytes (void *fpval) const
fpvalue_error_t from_12bytes (const void *fpval)
 Conversions for 12-byte floating point values.
fpvalue_error_t to_12bytes (void *fpval) const
fpvalue_error_t from_str (const char **p_str)
 Convert string to IEEE.
void to_str (char *buf, size_t bufsize, uint mode) const
 Convert IEEE to string.
void from_sval (sval_t x)
 Convert integer to IEEE.
void from_int64 (int64 x)
void from_uint64 (uint64 x)
fpvalue_error_t to_sval (sval_t *out, bool round=false) const
 Convert IEEE to integer (+-0.5 if round)
fpvalue_error_t to_int64 (int64 *out, bool round=false) const
fpvalue_error_t to_uint64 (uint64 *out, bool round=false) const
fpvalue_error_t fadd (const fpvalue_t &y)
 Arithmetic operations.
fpvalue_error_t fsub (const fpvalue_t &y)
fpvalue_error_t fmul (const fpvalue_t &y)
fpvalue_error_t fdiv (const fpvalue_t &y)
fpvalue_error_t mul_pow2 (int32 power_of_2)
 Multiply by a power of 2.
void eabs ()
 Calculate absolute value.
bool is_negative () const
 Is negative value?
void negate ()
 Negate.
fpvalue_kind_t get_kind () const
 Get value kind.

Public Attributes

uint16 w [FPVAL_NWORDS]

Detailed Description

Processor-independent representation of a floating point value.

IDA uses this structure to store and manipulate floating point values.

Member Function Documentation

◆ clear()

void fpvalue_t::clear ( void )
inline

◆ DECLARE_COMPARISONS()

fpvalue_t::DECLARE_COMPARISONS ( fpvalue_t )
inline

◆ from_half()

fpvalue_error_t fpvalue_t::from_half ( uint16 fpval)
inline

Convert to the processor-independent representation.

◆ from_float()

fpvalue_error_t fpvalue_t::from_float ( float fpval)
inline

◆ from_double()

fpvalue_error_t fpvalue_t::from_double ( double fpval)
inline

◆ to_half()

fpvalue_error_t fpvalue_t::to_half ( uint16 * fpval) const
inline

Convert from the processor-independent representation.

◆ to_float()

fpvalue_error_t fpvalue_t::to_float ( float * fpval) const
inline

◆ to_double()

fpvalue_error_t fpvalue_t::to_double ( double * fpval) const
inline

◆ from_10bytes()

fpvalue_error_t fpvalue_t::from_10bytes ( const void * fpval)
inline

Conversions for 10-byte floating point values.

◆ to_10bytes()

fpvalue_error_t fpvalue_t::to_10bytes ( void * fpval) const
inline

◆ from_12bytes()

fpvalue_error_t fpvalue_t::from_12bytes ( const void * fpval)
inline

Conversions for 12-byte floating point values.

◆ to_12bytes()

fpvalue_error_t fpvalue_t::to_12bytes ( void * fpval) const
inline

◆ from_str()

fpvalue_error_t fpvalue_t::from_str ( const char ** p_str)
inline

Convert string to IEEE.

Parameters
p_strpointer to pointer to string. it will advanced.

◆ to_str()

void fpvalue_t::to_str ( char * buf,
size_t bufsize,
uint mode ) const
inline

Convert IEEE to string.

Parameters
bufthe output buffer
bufsizethe size of the output buffer
modebroken down into:
  • low byte: number of digits after '.'
  • second byte: FPNUM_LENGTH
  • third byte: FPNUM_DIGITS

◆ from_sval()

void fpvalue_t::from_sval ( sval_t x)
inline

Convert integer to IEEE.

◆ from_int64()

void fpvalue_t::from_int64 ( int64 x)
inline

◆ from_uint64()

void fpvalue_t::from_uint64 ( uint64 x)
inline

◆ to_sval()

fpvalue_error_t fpvalue_t::to_sval ( sval_t * out,
bool round = false ) const
inline

Convert IEEE to integer (+-0.5 if round)

◆ to_int64()

fpvalue_error_t fpvalue_t::to_int64 ( int64 * out,
bool round = false ) const
inline

◆ to_uint64()

fpvalue_error_t fpvalue_t::to_uint64 ( uint64 * out,
bool round = false ) const
inline

◆ fadd()

fpvalue_error_t fpvalue_t::fadd ( const fpvalue_t & y)
inline

Arithmetic operations.

◆ fsub()

fpvalue_error_t fpvalue_t::fsub ( const fpvalue_t & y)
inline

◆ fmul()

fpvalue_error_t fpvalue_t::fmul ( const fpvalue_t & y)
inline

◆ fdiv()

fpvalue_error_t fpvalue_t::fdiv ( const fpvalue_t & y)
inline

◆ mul_pow2()

fpvalue_error_t fpvalue_t::mul_pow2 ( int32 power_of_2)
inline

Multiply by a power of 2.

◆ eabs()

void fpvalue_t::eabs ( )
inline

Calculate absolute value.

◆ is_negative()

bool fpvalue_t::is_negative ( ) const
inline

Is negative value?

◆ negate()

void fpvalue_t::negate ( )
inline

Negate.

◆ get_kind()

fpvalue_kind_t fpvalue_t::get_kind ( ) const
inline

Get value kind.

Member Data Documentation

◆ w

uint16 fpvalue_t::w[FPVAL_NWORDS]

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