クラス sc_dt::sc_fxnum_fast

#include <sc_fxnum.h>

sc_dt::sc_fxnum_fastに対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

const sc_fxval_fast operator- () const
const sc_fxval_fast operator+ () const
 DECL_BIN_OP_T (/, int64) DECL_BIN_OP_T(/
uint64 DECL_BIN_OP_T (/, const sc_int_base &) DECL_BIN_OP_T(/
uint64 const sc_uint_baseDECL_BIN_OP_T (/, const sc_signed &) friend const sc_fxval_fast operator<< (const sc_fxnum_fast &
const sc_fxval_fast operator++ (int)
const sc_fxval_fast operator-- (int)
sc_fxnum_fastoperator++ ()
sc_fxnum_fastoperator-- ()
const sc_fxnum_fast_bitref operator[] (int) const
sc_fxnum_fast_bitref operator[] (int)
const sc_fxnum_fast_bitref bit (int) const
sc_fxnum_fast_bitref bit (int)
const sc_fxnum_fast_subref operator() (int, int) const
sc_fxnum_fast_subref operator() (int, int)
const sc_fxnum_fast_subref range (int, int) const
sc_fxnum_fast_subref range (int, int)
const sc_fxnum_fast_subref operator() () const
sc_fxnum_fast_subref operator() ()
const sc_fxnum_fast_subref range () const
sc_fxnum_fast_subref range ()
 operator double () const
short to_short () const
unsigned short to_ushort () const
int to_int () const
unsigned int to_uint () const
long to_long () const
unsigned long to_ulong () const
int64 to_int64 () const
uint64 to_uint64 () const
float to_float () const
double to_double () const
const std::string to_string () const
const std::string to_string (sc_numrep) const
const std::string to_string (sc_numrep, bool) const
const std::string to_string (sc_fmt) const
const std::string to_string (sc_numrep, sc_fmt) const
const std::string to_string (sc_numrep, bool, sc_fmt) const
const std::string to_dec () const
const std::string to_bin () const
const std::string to_oct () const
const std::string to_hex () const
bool is_neg () const
bool is_zero () const
bool is_normal () const
bool quantization_flag () const
bool overflow_flag () const
const sc_fxval_fast value () const
int wl () const
int iwl () const
sc_q_mode q_mode () const
sc_o_mode o_mode () const
int n_bits () const
const sc_fxtype_paramstype_params () const
const sc_fxcast_switchcast_switch () const
void print (::std::ostream &=::std::cout) const
void scan (::std::istream &=::std::cin)
void dump (::std::ostream &=::std::cout) const
void observer_read () const
bool get_bit (int) const

Public 変数

uint64 const sc_uint_baseint

Protected メソッド

sc_fxnum_fast_observerobserver () const
void cast ()
 sc_fxnum_fast (const sc_fxtype_params &, sc_enc, const sc_fxcast_switch &, sc_fxnum_fast_observer *)
 ~sc_fxnum_fast ()
double get_val () const
bool set_bit (int, bool)
bool get_slice (int, int, sc_bv_base &) const
bool set_slice (int, int, const sc_bv_base &)
sc_fxnum_fast_observerlock_observer () const
void unlock_observer (sc_fxnum_fast_observer *) const

Private メソッド

 sc_fxnum_fast ()
 sc_fxnum_fast (const sc_fxnum_fast &)

Private 変数

double m_val
scfx_params m_params
bool m_q_flag
bool m_o_flag
sc_fxnum_fast_observerm_observer

フレンド

class sc_fxval_fast
class sc_fxnum_bitref
class sc_fxnum_subref
class sc_fxnum_fast_bitref
class sc_fxnum_fast_subref
class sc_core::vcd_sc_fxnum_fast_trace
class sc_core::wif_sc_fxnum_fast_trace
void neg (sc_fxval_fast &, const sc_fxnum_fast &)
void neg (sc_fxnum_fast &, const sc_fxnum_fast &)
const sc_fxval_fast operator/ (const sc_fxnum_fast &, const sc_fxnum_fast &)
const sc_fxval_fast operator>> (const sc_fxnum_fast &, int)
void lshift (sc_fxval_fast &, const sc_fxnum_fast &, int)
void rshift (sc_fxval_fast &, const sc_fxnum_fast &, int)
void lshift (sc_fxnum_fast &, const sc_fxnum_fast &, int)
void rshift (sc_fxnum_fast &, const sc_fxnum_fast &, int)


説明

sc_fxnum.h970 行で定義されています。


コンストラクタとデストラクタ

sc_dt::sc_fxnum_fast::sc_fxnum_fast ( const sc_fxtype_params type_params_,
sc_enc  enc_,
const sc_fxcast_switch cast_sw,
sc_fxnum_fast_observer observer_ 
) [inline, protected]

sc_fxnum.h3663 行で定義されています。

03667 : m_val( 0.0 ),
03668   m_params( type_params_, enc_, cast_sw ),
03669   m_q_flag( false ),
03670   m_o_flag( false ),
03671   m_observer( observer_ )
03672 {
03673     SC_FXNUM_FAST_OBSERVER_DEFAULT_
03674     SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(*this)
03675 }

sc_dt::sc_fxnum_fast::~sc_fxnum_fast (  )  [inline, protected]

sc_fxnum.h3746 行で定義されています。

03747 {
03748     SC_FXNUM_FAST_OBSERVER_DESTRUCT_( *this )
03749 }

sc_dt::sc_fxnum_fast::sc_fxnum_fast (  )  [private]

sc_dt::sc_fxnum_fast::sc_fxnum_fast ( const sc_fxnum_fast  )  [private]


関数

sc_fxnum_fast_observer * sc_dt::sc_fxnum_fast::observer (  )  const [inline, protected]

sc_fxnum.h3654 行で定義されています。

03655 {
03656     return m_observer;
03657 }

void sc_dt::sc_fxnum_fast::cast (  )  [protected]

sc_fxnum.cpp612 行で定義されています。

00613 {
00614     scfx_ieee_double id( m_val );
00615     SC_ERROR_IF_( id.is_nan() || id.is_inf(), sc_core::SC_ID_INVALID_FX_VALUE_);
00616 
00617     if( m_params.cast_switch() == SC_ON )
00618     {
00619         m_q_flag = false;
00620         m_o_flag = false;
00621 
00622         // check for special cases
00623 
00624         if( id.is_zero() )
00625         {
00626             if( id.negative() != 0 )
00627                 m_val = -m_val;
00628             return;
00629         }
00630 
00631         // perform casting
00632 
00633         sc_dt::quantization( m_val, m_params, m_q_flag );
00634         sc_dt::overflow( m_val, m_params, m_o_flag );
00635 
00636         // check for special case: -0
00637 
00638         id = m_val;
00639         if( id.is_zero() && id.negative() != 0 ) {
00640             m_val = -m_val;
00641         }
00642 
00643         // check for special case: NaN of Inf
00644 
00645         if( id.is_nan() || id.is_inf() ) {
00646             m_val = 0.0;
00647         }
00648     }
00649 }

double sc_dt::sc_fxnum_fast::get_val (  )  const [inline, protected]

sc_fxnum.h3755 行で定義されています。

03756 {
03757     SC_FXNUM_FAST_OBSERVER_READ_( *this )
03758     return m_val;
03759 }

const sc_fxval_fast sc_dt::sc_fxnum_fast::operator- (  )  const [inline]

sc_fxnum.h3766 行で定義されています。

03767 {
03768     SC_FXNUM_FAST_OBSERVER_READ_( *this )
03769     return sc_fxval_fast( - m_val );
03770 }

const sc_fxval_fast sc_dt::sc_fxnum_fast::operator+ (  )  const [inline]

sc_fxnum.h3774 行で定義されています。

03775 {
03776     SC_FXNUM_FAST_OBSERVER_READ_( *this )
03777     return sc_fxval_fast( m_val );
03778 }

sc_dt::sc_fxnum_fast::DECL_BIN_OP_T ( ,
int64   
)

uint64 sc_dt::sc_fxnum_fast::DECL_BIN_OP_T ( ,
const sc_int_base  
)

uint64 const sc_uint_base& sc_dt::sc_fxnum_fast::DECL_BIN_OP_T ( ,
const sc_signed  
) const

const sc_fxval_fast sc_dt::sc_fxnum_fast::operator++ ( int   )  [inline]

sc_dt::sc_fix_fast, sc_dt::sc_fixed_fast< W, I, Q, O, N >, sc_dt::sc_ufix_fast, と sc_dt::sc_ufixed_fast< W, I, Q, O, N >で再定義されています。

sc_fxnum.h4338 行で定義されています。

04339 {
04340     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04341     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04342     double c = m_val;
04343     m_val = m_val + 1;
04344     cast();
04345     SC_FXNUM_FAST_OBSERVER_WRITE_( *this )
04346     return sc_fxval_fast( c );
04347 }

const sc_fxval_fast sc_dt::sc_fxnum_fast::operator-- ( int   )  [inline]

sc_dt::sc_fix_fast, sc_dt::sc_fixed_fast< W, I, Q, O, N >, sc_dt::sc_ufix_fast, と sc_dt::sc_ufixed_fast< W, I, Q, O, N >で再定義されています。

sc_fxnum.h4351 行で定義されています。

04352 {
04353     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04354     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04355     double c = m_val;
04356     m_val = m_val - 1;
04357     cast();
04358     SC_FXNUM_FAST_OBSERVER_WRITE_( *this )
04359     return sc_fxval_fast( c );
04360 }

sc_fxnum_fast & sc_dt::sc_fxnum_fast::operator++ (  )  [inline]

sc_dt::sc_fix_fast, sc_dt::sc_fixed_fast< W, I, Q, O, N >, sc_dt::sc_ufix_fast, と sc_dt::sc_ufixed_fast< W, I, Q, O, N >で再定義されています。

sc_fxnum.h4364 行で定義されています。

04365 {
04366     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04367     m_val = m_val + 1;
04368     cast();
04369     SC_FXNUM_FAST_OBSERVER_WRITE_( *this )
04370     return *this;
04371 }

sc_fxnum_fast & sc_dt::sc_fxnum_fast::operator-- (  )  [inline]

sc_dt::sc_fix_fast, sc_dt::sc_fixed_fast< W, I, Q, O, N >, sc_dt::sc_ufix_fast, と sc_dt::sc_ufixed_fast< W, I, Q, O, N >で再定義されています。

sc_fxnum.h4375 行で定義されています。

04376 {
04377     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04378     m_val = m_val - 1;
04379     cast();
04380     SC_FXNUM_FAST_OBSERVER_WRITE_( *this )
04381     return *this;
04382 }

const sc_fxnum_fast_bitref sc_dt::sc_fxnum_fast::operator[] ( int  i  )  const [inline]

sc_fxnum.h4389 行で定義されています。

04390 {
04391     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04392     return sc_fxnum_fast_bitref( const_cast<sc_fxnum_fast&>( *this ),
04393                                  i - m_params.fwl() );
04394 }

sc_fxnum_fast_bitref sc_dt::sc_fxnum_fast::operator[] ( int  i  )  [inline]

sc_fxnum.h4398 行で定義されています。

04399 {
04400     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04401     return sc_fxnum_fast_bitref( *this, i - m_params.fwl() );
04402 }

const sc_fxnum_fast_bitref sc_dt::sc_fxnum_fast::bit ( int  i  )  const [inline]

sc_fxnum.h4406 行で定義されています。

04407 {
04408     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04409     return sc_fxnum_fast_bitref( const_cast<sc_fxnum_fast&>( *this ),
04410                                  i - m_params.fwl() );
04411 }

sc_fxnum_fast_bitref sc_dt::sc_fxnum_fast::bit ( int  i  )  [inline]

sc_fxnum.h4415 行で定義されています。

04416 {
04417     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04418     return sc_fxnum_fast_bitref( *this, i - m_params.fwl() );
04419 }

const sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::operator() ( int  i,
int  j 
) const [inline]

sc_fxnum.h4426 行で定義されています。

04427 {
04428     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04429     SC_ERROR_IF_( j < 0 || j >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04430 
04431     return sc_fxnum_fast_subref( const_cast<sc_fxnum_fast&>( *this ),
04432                                  i - m_params.fwl(), j - m_params.fwl() );
04433 }

sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::operator() ( int  i,
int  j 
) [inline]

sc_fxnum.h4437 行で定義されています。

04438 {
04439     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04440     SC_ERROR_IF_( j < 0 || j >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04441 
04442     return sc_fxnum_fast_subref( *this,
04443                                  i - m_params.fwl(), j - m_params.fwl() );
04444 }

const sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::range ( int  i,
int  j 
) const [inline]

sc_fxnum.h4448 行で定義されています。

04449 {
04450     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04451     SC_ERROR_IF_( j < 0 || j >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04452 
04453     return sc_fxnum_fast_subref( const_cast<sc_fxnum_fast&>( *this ),
04454                                  i - m_params.fwl(), j - m_params.fwl() );
04455 }

sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::range ( int  i,
int  j 
) [inline]

sc_fxnum.h4459 行で定義されています。

04460 {
04461     SC_ERROR_IF_( i < 0 || i >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04462     SC_ERROR_IF_( j < 0 || j >= m_params.wl(), sc_core::SC_ID_OUT_OF_RANGE_ );
04463 
04464     return sc_fxnum_fast_subref( *this,
04465                                  i - m_params.fwl(), j - m_params.fwl() );
04466 }

const sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::operator() (  )  const [inline]

sc_fxnum.h4470 行で定義されています。

04471 {
04472     return this->operator () ( m_params.wl() - 1, 0 );
04473 }

sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::operator() (  )  [inline]

sc_fxnum.h4477 行で定義されています。

04478 {
04479     return this->operator () ( m_params.wl() - 1, 0 );
04480 }

const sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::range (  )  const [inline]

sc_fxnum.h4484 行で定義されています。

04485 {
04486     return this->range( m_params.wl() - 1, 0 );
04487 }

sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::range (  )  [inline]

sc_fxnum.h4491 行で定義されています。

04492 {
04493     return this->range( m_params.wl() - 1, 0 );
04494 }

sc_dt::sc_fxnum_fast::operator double (  )  const [inline]

sc_fxnum.h4500 行で定義されています。

04501 {
04502     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04503     return m_val;
04504 }

short sc_dt::sc_fxnum_fast::to_short (  )  const [inline]

sc_fxnum.h4511 行で定義されています。

04512 {
04513     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04514     return static_cast<short>( m_val );
04515 }

unsigned short sc_dt::sc_fxnum_fast::to_ushort (  )  const [inline]

sc_fxnum.h4519 行で定義されています。

04520 {
04521     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04522     return static_cast<unsigned short>( m_val );
04523 }

int sc_dt::sc_fxnum_fast::to_int (  )  const [inline]

sc_fxnum.h4527 行で定義されています。

04528 {
04529     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04530     return static_cast<int>( m_val );
04531 }

unsigned int sc_dt::sc_fxnum_fast::to_uint (  )  const [inline]

sc_fxnum.h4543 行で定義されています。

04544 {
04545     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04546     return static_cast<unsigned int>( m_val );
04547 }

long sc_dt::sc_fxnum_fast::to_long (  )  const [inline]

sc_fxnum.h4559 行で定義されています。

04560 {
04561     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04562     return static_cast<long>( m_val );
04563 }

unsigned long sc_dt::sc_fxnum_fast::to_ulong (  )  const [inline]

sc_fxnum.h4567 行で定義されています。

04568 {
04569     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04570     return static_cast<unsigned long>( m_val );
04571 }

int64 sc_dt::sc_fxnum_fast::to_int64 (  )  const [inline]

sc_fxnum.h4535 行で定義されています。

04536 {
04537     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04538     return static_cast<int64>( m_val );
04539 }

uint64 sc_dt::sc_fxnum_fast::to_uint64 (  )  const [inline]

sc_fxnum.h4551 行で定義されています。

04552 {
04553     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04554     return static_cast<uint64>( m_val );
04555 }

float sc_dt::sc_fxnum_fast::to_float (  )  const [inline]

sc_fxnum.h4575 行で定義されています。

04576 {
04577     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04578     return static_cast<float>( m_val );
04579 }

double sc_dt::sc_fxnum_fast::to_double (  )  const [inline]

sc_fxnum.h4583 行で定義されています。

04584 {
04585     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04586     return m_val;
04587 }

const std::string sc_dt::sc_fxnum_fast::to_string (  )  const

sc_fxnum.cpp665 行で定義されています。

00666 {
00667     return std::string( sc_dt::to_string( m_val, SC_DEC, -1, SC_F, &m_params ) );
00668 }

const std::string sc_dt::sc_fxnum_fast::to_string ( sc_numrep  numrep  )  const

sc_fxnum.cpp671 行で定義されています。

00672 {
00673     return std::string( sc_dt::to_string( m_val, numrep, -1, SC_F, &m_params ) );
00674 }

const std::string sc_dt::sc_fxnum_fast::to_string ( sc_numrep  numrep,
bool  w_prefix 
) const

sc_fxnum.cpp677 行で定義されています。

00678 {
00679     return std::string( sc_dt::to_string( m_val, numrep, (w_prefix ? 1 : 0),
00680                                         SC_F, &m_params ) );
00681 }

const std::string sc_dt::sc_fxnum_fast::to_string ( sc_fmt  fmt  )  const

sc_fxnum.cpp684 行で定義されています。

00685 {
00686     return std::string( sc_dt::to_string( m_val, SC_DEC, -1, fmt, &m_params ) );
00687 }

const std::string sc_dt::sc_fxnum_fast::to_string ( sc_numrep  numrep,
sc_fmt  fmt 
) const

sc_fxnum.cpp690 行で定義されています。

00691 {
00692     return std::string( sc_dt::to_string( m_val, numrep, -1, fmt, &m_params ) );
00693 }

const std::string sc_dt::sc_fxnum_fast::to_string ( sc_numrep  numrep,
bool  w_prefix,
sc_fmt  fmt 
) const

sc_fxnum.cpp696 行で定義されています。

00697 {
00698     return std::string( sc_dt::to_string( m_val, numrep, (w_prefix ? 1 : 0),
00699                                         fmt, &m_params ) );
00700 }

const std::string sc_dt::sc_fxnum_fast::to_dec (  )  const

sc_fxnum.cpp704 行で定義されています。

00705 {
00706     return std::string( sc_dt::to_string( m_val, SC_DEC, -1, SC_F, &m_params ) );
00707 }

const std::string sc_dt::sc_fxnum_fast::to_bin (  )  const

sc_fxnum.cpp710 行で定義されています。

00711 {
00712     return std::string( sc_dt::to_string( m_val, SC_BIN, -1, SC_F, &m_params ) );
00713 }

const std::string sc_dt::sc_fxnum_fast::to_oct (  )  const

sc_fxnum.cpp716 行で定義されています。

00717 {
00718     return std::string( sc_dt::to_string( m_val, SC_OCT, -1, SC_F, &m_params ) );
00719 }

const std::string sc_dt::sc_fxnum_fast::to_hex (  )  const

sc_fxnum.cpp722 行で定義されています。

00723 {
00724     return std::string( sc_dt::to_string( m_val, SC_HEX, -1, SC_F, &m_params ) );
00725 }

bool sc_dt::sc_fxnum_fast::is_neg (  )  const [inline]

sc_fxnum.h4594 行で定義されています。

04595 {
04596     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04597     scfx_ieee_double id( m_val );
04598     return ( id.negative() != 0 );
04599 }

bool sc_dt::sc_fxnum_fast::is_zero (  )  const [inline]

sc_fxnum.h4603 行で定義されています。

04604 {
04605     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04606     scfx_ieee_double id( m_val );
04607     return id.is_zero();
04608 }

bool sc_dt::sc_fxnum_fast::is_normal (  )  const [inline]

sc_fxnum.h4613 行で定義されています。

04614 {
04615     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04616     scfx_ieee_double id( m_val );
04617     return ( id.is_normal() || id.is_subnormal() || id.is_zero() );
04618 }

bool sc_dt::sc_fxnum_fast::quantization_flag (  )  const [inline]

sc_fxnum.h4623 行で定義されています。

04624 {
04625     return m_q_flag;
04626 }

bool sc_dt::sc_fxnum_fast::overflow_flag (  )  const [inline]

sc_fxnum.h4630 行で定義されています。

04631 {
04632     return m_o_flag;
04633 }

const sc_fxval_fast sc_dt::sc_fxnum_fast::value (  )  const [inline]

sc_fxnum.h4638 行で定義されています。

04639 {
04640     SC_FXNUM_FAST_OBSERVER_READ_( *this )
04641     return sc_fxval_fast( m_val );
04642 }

int sc_dt::sc_fxnum_fast::wl (  )  const [inline]

sc_fxnum.h4649 行で定義されています。

04650 {
04651     return m_params.wl();
04652 }

int sc_dt::sc_fxnum_fast::iwl (  )  const [inline]

sc_fxnum.h4656 行で定義されています。

04657 {
04658     return m_params.iwl();
04659 }

sc_q_mode sc_dt::sc_fxnum_fast::q_mode (  )  const [inline]

sc_fxnum.h4663 行で定義されています。

04664 {
04665     return m_params.q_mode();
04666 }

sc_o_mode sc_dt::sc_fxnum_fast::o_mode (  )  const [inline]

sc_fxnum.h4670 行で定義されています。

04671 {
04672     return m_params.o_mode();
04673 }

int sc_dt::sc_fxnum_fast::n_bits (  )  const [inline]

sc_fxnum.h4677 行で定義されています。

04678 {
04679     return m_params.n_bits();
04680 }

const sc_fxtype_params & sc_dt::sc_fxnum_fast::type_params (  )  const [inline]

sc_fxnum.h4685 行で定義されています。

04686 {
04687     return m_params.type_params();
04688 }

const sc_fxcast_switch & sc_dt::sc_fxnum_fast::cast_switch (  )  const [inline]

sc_fxnum.h4693 行で定義されています。

04694 {
04695     return m_params.cast_switch();
04696 }

void sc_dt::sc_fxnum_fast::print ( ::std::ostream &  os = ::std::cout  )  const

sc_fxnum.cpp731 行で定義されています。

00732 {
00733     os << sc_dt::to_string( m_val, SC_DEC, -1, SC_F, &m_params );
00734 }

void sc_dt::sc_fxnum_fast::scan ( ::std::istream &  is = ::std::cin  ) 

sc_fxnum.cpp737 行で定義されています。

00738 {
00739     std::string s;
00740     is >> s;
00741     *this = s.c_str();
00742 }

void sc_dt::sc_fxnum_fast::dump ( ::std::ostream &  os = ::std::cout  )  const

sc_fxnum.cpp745 行で定義されています。

00746 {
00747     os << "sc_fxnum_fast" << ::std::endl;
00748     os << "(" << ::std::endl;
00749     os << "val      = " << m_val << ::std::endl;
00750     os << "params   = ";
00751     m_params.dump( os );
00752     os << "q_flag   = " << m_q_flag << ::std::endl;
00753     os << "o_flag   = " << m_o_flag << ::std::endl;
00754     // TO BE COMPLETED
00755     // os << "observer = ";
00756     // if( m_observer != 0 )
00757     //     m_observer->dump( os );
00758     // else
00759     //     os << "0" << ::std::endl;
00760     os << ")" << ::std::endl;
00761 }

void sc_dt::sc_fxnum_fast::observer_read (  )  const [inline]

sc_fxnum.h4702 行で定義されています。

04703 {
04704     SC_FXNUM_OBSERVER_READ_( *this );
04705 }

bool sc_dt::sc_fxnum_fast::get_bit ( int  i  )  const

sc_fxnum.cpp766 行で定義されています。

00767 {
00768     scfx_ieee_double id( m_val );
00769     if( id.is_zero() || id.is_nan() || id.is_inf() )
00770         return false;
00771 
00772     // convert to two's complement
00773 
00774     unsigned int m0 = id.mantissa0();
00775     unsigned int m1 = id.mantissa1();
00776 
00777     if( id.is_normal() )
00778         m0 += 1U << 20;
00779 
00780     if( id.negative() != 0 )
00781     {
00782         m0 = ~ m0;
00783         m1 = ~ m1;
00784         unsigned int tmp = m1;
00785         m1 += 1U;
00786         if( m1 <= tmp )
00787             m0 += 1U;
00788     }
00789 
00790     // get the right bit
00791 
00792     int j = i - id.exponent();
00793     if( ( j += 20 ) >= 32 )
00794         return ( ( m0 & 1U << 31 ) != 0 );
00795     else if( j >= 0 )
00796         return ( ( m0 & 1U << j ) != 0 );
00797     else if( ( j += 32 ) >= 0 )
00798         return ( ( m1 & 1U << j ) != 0 );
00799     else
00800         return false;
00801 }

bool sc_dt::sc_fxnum_fast::set_bit ( int  i,
bool  high 
) [protected]

sc_fxnum.cpp805 行で定義されています。

00806 {
00807     scfx_ieee_double id( m_val );
00808     if( id.is_nan() || id.is_inf() )
00809         return false;
00810 
00811     if( high )
00812     {
00813         if( get_bit( i ) )
00814             return true;
00815 
00816         if( m_params.enc() == SC_TC_ && i == m_params.iwl() - 1 )
00817             m_val -= scfx_pow2( i );
00818         else
00819             m_val += scfx_pow2( i );
00820     }
00821     else
00822     {
00823         if( ! get_bit( i ) )
00824             return true;
00825 
00826         if( m_params.enc() == SC_TC_ && i == m_params.iwl() - 1 )
00827             m_val += scfx_pow2( i );
00828         else
00829             m_val -= scfx_pow2( i );
00830     }
00831 
00832     return true;
00833 }

bool sc_dt::sc_fxnum_fast::get_slice ( int  i,
int  j,
sc_bv_base bv 
) const [protected]

sc_fxnum.cpp837 行で定義されています。

00838 {
00839     scfx_ieee_double id( m_val );
00840     if( id.is_nan() || id.is_inf() )
00841         return false;
00842 
00843     // convert to two's complement
00844 
00845     unsigned int m0 = id.mantissa0();
00846     unsigned int m1 = id.mantissa1();
00847 
00848     if( id.is_normal() )
00849         m0 += 1U << 20;
00850 
00851     if( id.negative() != 0 )
00852     {
00853         m0 = ~ m0;
00854         m1 = ~ m1;
00855         unsigned int tmp = m1;
00856         m1 += 1U;
00857         if( m1 <= tmp )
00858             m0 += 1U;
00859     }
00860 
00861     // get the bits
00862 
00863     int l = j;
00864     for( int k = 0; k < bv.length(); ++ k )
00865     {
00866         bool b = false;
00867 
00868         int n = l - id.exponent();
00869         if( ( n += 20 ) >= 32 )
00870             b = ( ( m0 & 1U << 31 ) != 0 );
00871         else if( n >= 0 )
00872             b = ( ( m0 & 1U << n ) != 0 );
00873         else if( ( n += 32 ) >= 0 )
00874             b = ( ( m1 & 1U << n ) != 0 );
00875 
00876         bv[k] = b;
00877 
00878         if( i >= j )
00879             ++ l;
00880         else
00881             -- l;
00882     }
00883 
00884     return true;
00885 }

bool sc_dt::sc_fxnum_fast::set_slice ( int  i,
int  j,
const sc_bv_base bv 
) [protected]

sc_fxnum.cpp888 行で定義されています。

00889 {
00890     scfx_ieee_double id( m_val );
00891     if( id.is_nan() || id.is_inf() )
00892         return false;
00893 
00894     // set the bits
00895 
00896     int l = j;
00897     for( int k = 0; k < bv.length(); ++ k )
00898     {
00899         if( bv[k].to_bool() )
00900         {
00901             if( ! get_bit( l ) )
00902             {
00903                 if( m_params.enc() == SC_TC_ && l == m_params.iwl() - 1 )
00904                     m_val -= scfx_pow2( l );
00905                 else
00906                     m_val += scfx_pow2( l );
00907             }
00908         }
00909         else
00910         {
00911             if( get_bit( l ) )
00912             {
00913                 if( m_params.enc() == SC_TC_ && l == m_params.iwl() - 1 )
00914                     m_val += scfx_pow2( l );
00915                 else
00916                     m_val -= scfx_pow2( l );
00917             }
00918         }
00919 
00920 
00921         if( i >= j )
00922             ++ l;
00923         else
00924             -- l;
00925     }
00926 
00927     return true;
00928 }

sc_fxnum_fast_observer * sc_dt::sc_fxnum_fast::lock_observer (  )  const [protected]

sc_fxnum.cpp932 行で定義されています。

00933 {
00934     SC_ASSERT_( m_observer != 0, "lock observer failed" );
00935     sc_fxnum_fast_observer* tmp = m_observer;
00936     m_observer = 0;
00937     return tmp;
00938 }

void sc_dt::sc_fxnum_fast::unlock_observer ( sc_fxnum_fast_observer observer_  )  const [protected]

sc_fxnum.cpp941 行で定義されています。

00942 {
00943     SC_ASSERT_( observer_ != 0, "unlock observer failed" );
00944     m_observer = observer_;
00945 }


フレンドと関連する関数

friend class sc_fxval_fast [friend]

sc_fxnum.h972 行で定義されています。

friend class sc_fxnum_bitref [friend]

sc_fxnum.h974 行で定義されています。

friend class sc_fxnum_subref [friend]

sc_fxnum.h975 行で定義されています。

friend class sc_fxnum_fast_bitref [friend]

sc_fxnum.h976 行で定義されています。

friend class sc_fxnum_fast_subref [friend]

sc_fxnum.h977 行で定義されています。

friend class sc_core::vcd_sc_fxnum_fast_trace [friend]

sc_fxnum.h979 行で定義されています。

friend class sc_core::wif_sc_fxnum_fast_trace [friend]

sc_fxnum.h980 行で定義されています。

void neg ( sc_fxval_fast c,
const sc_fxnum_fast a 
) [friend]

sc_fxnum.h3785 行で定義されています。

03786 {
03787     SC_FXNUM_FAST_OBSERVER_READ_( a )
03788     c.set_val( - a.m_val );
03789 }

void neg ( sc_fxnum_fast c,
const sc_fxnum_fast a 
) [friend]

sc_fxnum.h3793 行で定義されています。

03794 {
03795     SC_FXNUM_FAST_OBSERVER_READ_( a )
03796     c.m_val = - a.m_val;
03797     c.cast();
03798     SC_FXNUM_FAST_OBSERVER_WRITE_( c )
03799 }

const sc_fxval_fast operator/ ( const sc_fxnum_fast a,
const sc_fxnum_fast b 
) [friend]

sc_fxnum.h3875 行で定義されています。

03876 {
03877     SC_FXNUM_FAST_OBSERVER_READ_( a )
03878     SC_FXNUM_FAST_OBSERVER_READ_( b )
03879     return sc_fxval_fast( a.m_val / b.m_val );
03880 }

const sc_fxval_fast operator>> ( const sc_fxnum_fast a,
int  b 
) [friend]

sc_fxnum.h3929 行で定義されています。

03930 {
03931     SC_FXNUM_FAST_OBSERVER_READ_( a )
03932     return sc_fxval_fast( a.m_val * scfx_pow2( -b ) );
03933 }

void lshift ( sc_fxval_fast c,
const sc_fxnum_fast a,
int  b 
) [friend]

sc_fxnum.h4070 行で定義されています。

04071 {
04072     SC_FXNUM_FAST_OBSERVER_READ_( a )
04073     c.set_val( a.m_val * scfx_pow2( b ) );
04074 }

void rshift ( sc_fxval_fast c,
const sc_fxnum_fast a,
int  b 
) [friend]

sc_fxnum.h4078 行で定義されています。

04079 {
04080     SC_FXNUM_FAST_OBSERVER_READ_( a )
04081     c.set_val( a.m_val * scfx_pow2( -b ) );
04082 }

void lshift ( sc_fxnum_fast c,
const sc_fxnum_fast a,
int  b 
) [friend]

sc_fxnum.h4086 行で定義されています。

04087 {
04088     SC_FXNUM_FAST_OBSERVER_READ_( a )
04089     c.m_val = a.m_val * scfx_pow2( b );
04090     c.cast();
04091     SC_FXNUM_FAST_OBSERVER_WRITE_( c )
04092 }

void rshift ( sc_fxnum_fast c,
const sc_fxnum_fast a,
int  b 
) [friend]

sc_fxnum.h4096 行で定義されています。

04097 {
04098     SC_FXNUM_FAST_OBSERVER_READ_( a )
04099     c.m_val = a.m_val * scfx_pow2( -b );
04100     c.cast();
04101     SC_FXNUM_FAST_OBSERVER_WRITE_( c )
04102 }


変数

sc_fxnum.h1102 行で定義されています。

double sc_dt::sc_fxnum_fast::m_val [private]

sc_fxnum.h1366 行で定義されています。

sc_fxnum.h1368 行で定義されています。

sc_fxnum.h1369 行で定義されています。

sc_fxnum.h1370 行で定義されています。

sc_fxnum.h1372 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:45 2008に生成されました。  doxygen 1.5.6