54#ifndef __SYSTEMC_EXT_DT_FX_SCFX_IEEE_HH__
55#define __SYSTEMC_EXT_DT_FX_SCFX_IEEE_HH__
65class scfx_ieee_double;
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;
186inline 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;
472inline 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);
static const scfx_ieee_double nan()
unsigned int mantissa1() const
static const scfx_ieee_double inf(int)
unsigned int mantissa0() const
scfx_ieee_double & operator=(double)
bool is_subnormal() const
unsigned int negative() const
unsigned int mantissa() const
scfx_ieee_float & operator=(float)
unsigned int negative() const
bool is_subnormal() const
const int SCFX_IEEE_FLOAT_E_MIN
const unsigned int SCFX_IEEE_DOUBLE_M1_SIZE
const int SCFX_IEEE_DOUBLE_E_MIN
double uint64_to_double(uint64 a)
const unsigned int SCFX_IEEE_DOUBLE_E_SIZE
const int SCFX_IEEE_DOUBLE_E_MAX
const unsigned int SCFX_IEEE_DOUBLE_M0_SIZE
const int SCFX_IEEE_FLOAT_E_MAX
const unsigned int SCFX_IEEE_FLOAT_E_SIZE
const unsigned int SCFX_IEEE_DOUBLE_M_SIZE
const unsigned int SCFX_IEEE_DOUBLE_BIAS
const unsigned int SCFX_IEEE_FLOAT_BIAS
double scfx_pow2(int exp)
const unsigned int SCFX_IEEE_FLOAT_M_SIZE
#define LSB_STATEMENT(x, n)
#define MSB_STATEMENT(x, n)
struct sc_dt::ieee_double::@376 s
struct sc_dt::ieee_float::@377 s