Go to the documentation of this file.
54 #ifndef __SYSTEMC_EXT_DT_FX_SCFX_IEEE_HH__
55 #define __SYSTEMC_EXT_DT_FX_SCFX_IEEE_HH__
57 #include "../../utils/endian.hh"
65 class scfx_ieee_double;
67 class scfx_ieee_float;
69 #define SCFX_MASK_(Size) ((1u << (Size))-1u)
83 #if defined(SC_BOOST_BIG_ENDIAN)
86 unsigned mantissa0:20;
87 unsigned mantissa1:32;
88 #elif defined(SC_BOOST_LITTLE_ENDIAN)
89 unsigned mantissa1:32;
90 unsigned mantissa0:20;
126 operator double()
const;
172 inline scfx_ieee_double &
179 inline scfx_ieee_double &
186 inline scfx_ieee_double::operator double()
const
194 return m_id.
s.negative;
219 return m_id.
s.mantissa0;
231 return m_id.
s.mantissa1;
291 #define MSB_STATEMENT(x,n) if ( x >> n ) { x >>= n; i += n; }
306 }
else if (m1 != 0) {
321 #define LSB_STATEMENT(x,n) if ( x << n ) { x <<= n; i -= n; }
336 }
else if (m0 != 0) {
379 #if defined(SC_BOOST_BIG_ENDIAN)
382 unsigned mantissa:23;
383 #elif defined(SC_BOOST_LITTLE_ENDIAN)
384 unsigned mantissa:23;
419 operator float()
const;
458 inline scfx_ieee_float &
465 inline scfx_ieee_float &
472 inline scfx_ieee_float::operator float()
const
480 return m_if.
s.negative;
505 return m_if.
s.mantissa;
575 if ((exp += 20) >= 0) {
576 r.mantissa0(1U << exp);
577 }
else if ((exp += 32) >= 0) {
578 r.mantissa1(1U << exp);
600 #if defined(__clang__)
602 double tmp =
static_cast<double>(
static_cast<int64>(
a));
605 return static_cast<double>(
a);
613 #endif // __SYSTEMC_EXT_DT_FX_SCFX_IEEE_HH__
struct sc_dt::ieee_float::@118 s
const int SCFX_IEEE_DOUBLE_E_MAX
const unsigned int SCFX_IEEE_FLOAT_BIAS
const int SCFX_IEEE_DOUBLE_E_MIN
const unsigned int SCFX_IEEE_DOUBLE_E_SIZE
double uint64_to_double(uint64 a)
struct sc_dt::ieee_double::@117 s
const unsigned int SCFX_IEEE_DOUBLE_M_SIZE
const int SCFX_IEEE_FLOAT_E_MIN
double scfx_pow2(int exp)
static const scfx_ieee_double inf(int)
const unsigned int SCFX_IEEE_DOUBLE_BIAS
#define LSB_STATEMENT(x, n)
bool is_subnormal() const
unsigned int mantissa() const
const unsigned int SCFX_IEEE_FLOAT_E_SIZE
const unsigned int SCFX_IEEE_DOUBLE_M1_SIZE
scfx_ieee_double & operator=(double)
unsigned int mantissa0() const
const unsigned int SCFX_IEEE_FLOAT_M_SIZE
unsigned int mantissa1() const
bool is_subnormal() const
unsigned int negative() const
unsigned int negative() const
const unsigned int SCFX_IEEE_DOUBLE_M0_SIZE
static const scfx_ieee_double nan()
scfx_ieee_float & operator=(float)
const int SCFX_IEEE_FLOAT_E_MAX
#define MSB_STATEMENT(x, n)
Generated on Wed Sep 30 2020 14:02:15 for gem5 by doxygen 1.8.17