#include <sc_fxnum.h>
sc_fxnum.h の 970 行で定義されています。
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.h の 3663 行で定義されています。
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_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] |
void sc_dt::sc_fxnum_fast::cast | ( | ) | [protected] |
sc_fxnum.cpp の 612 行で定義されています。
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.h の 3755 行で定義されています。
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.h の 3766 行で定義されています。
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.h の 3774 行で定義されています。
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.h の 4338 行で定義されています。
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.h の 4351 行で定義されています。
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.h の 4364 行で定義されています。
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.h の 4375 行で定義されています。
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.h の 4389 行で定義されています。
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.h の 4398 行で定義されています。
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.h の 4406 行で定義されています。
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.h の 4415 行で定義されています。
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.h の 4426 行で定義されています。
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.h の 4437 行で定義されています。
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.h の 4448 行で定義されています。
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.h の 4459 行で定義されています。
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.h の 4470 行で定義されています。
04471 { 04472 return this->operator () ( m_params.wl() - 1, 0 ); 04473 }
sc_fxnum_fast_subref sc_dt::sc_fxnum_fast::operator() | ( | ) | [inline] |
sc_fxnum.h の 4477 行で定義されています。
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_fast_subref sc_dt::sc_fxnum_fast::range | ( | ) | [inline] |
sc_dt::sc_fxnum_fast::operator double | ( | ) | const [inline] |
sc_fxnum.h の 4500 行で定義されています。
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.h の 4511 行で定義されています。
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.h の 4519 行で定義されています。
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.h の 4527 行で定義されています。
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.h の 4543 行で定義されています。
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.h の 4559 行で定義されています。
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.h の 4567 行で定義されています。
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.h の 4535 行で定義されています。
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.h の 4551 行で定義されています。
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.h の 4575 行で定義されています。
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.h の 4583 行で定義されています。
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.cpp の 665 行で定義されています。
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.cpp の 671 行で定義されています。
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.cpp の 677 行で定義されています。
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.cpp の 684 行で定義されています。
00685 { 00686 return std::string( sc_dt::to_string( m_val, SC_DEC, -1, fmt, &m_params ) ); 00687 }
sc_fxnum.cpp の 690 行で定義されています。
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.cpp の 696 行で定義されています。
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.cpp の 704 行で定義されています。
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.cpp の 710 行で定義されています。
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.cpp の 716 行で定義されています。
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.cpp の 722 行で定義されています。
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.h の 4594 行で定義されています。
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.h の 4603 行で定義されています。
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.h の 4613 行で定義されています。
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] |
bool sc_dt::sc_fxnum_fast::overflow_flag | ( | ) | const [inline] |
const sc_fxval_fast sc_dt::sc_fxnum_fast::value | ( | ) | const [inline] |
sc_fxnum.h の 4638 行で定義されています。
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] |
int sc_dt::sc_fxnum_fast::iwl | ( | ) | const [inline] |
sc_q_mode sc_dt::sc_fxnum_fast::q_mode | ( | ) | const [inline] |
sc_o_mode sc_dt::sc_fxnum_fast::o_mode | ( | ) | const [inline] |
int sc_dt::sc_fxnum_fast::n_bits | ( | ) | const [inline] |
const sc_fxtype_params & sc_dt::sc_fxnum_fast::type_params | ( | ) | const [inline] |
const sc_fxcast_switch & sc_dt::sc_fxnum_fast::cast_switch | ( | ) | const [inline] |
void sc_dt::sc_fxnum_fast::print | ( | ::std::ostream & | os = ::std::cout |
) | const |
sc_fxnum.cpp の 731 行で定義されています。
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 |
) |
void sc_dt::sc_fxnum_fast::dump | ( | ::std::ostream & | os = ::std::cout |
) | const |
sc_fxnum.cpp の 745 行で定義されています。
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] |
bool sc_dt::sc_fxnum_fast::get_bit | ( | int | i | ) | const |
sc_fxnum.cpp の 766 行で定義されています。
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.cpp の 805 行で定義されています。
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.cpp の 837 行で定義されています。
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.cpp の 888 行で定義されています。
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.cpp の 932 行で定義されています。
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.cpp の 941 行で定義されています。
00942 { 00943 SC_ASSERT_( observer_ != 0, "unlock observer failed" ); 00944 m_observer = observer_; 00945 }
friend class sc_fxval_fast [friend] |
sc_fxnum.h の 972 行で定義されています。
friend class sc_fxnum_bitref [friend] |
sc_fxnum.h の 974 行で定義されています。
friend class sc_fxnum_subref [friend] |
sc_fxnum.h の 975 行で定義されています。
friend class sc_fxnum_fast_bitref [friend] |
sc_fxnum.h の 976 行で定義されています。
friend class sc_fxnum_fast_subref [friend] |
sc_fxnum.h の 977 行で定義されています。
friend class sc_core::vcd_sc_fxnum_fast_trace [friend] |
sc_fxnum.h の 979 行で定義されています。
friend class sc_core::wif_sc_fxnum_fast_trace [friend] |
sc_fxnum.h の 980 行で定義されています。
void neg | ( | sc_fxval_fast & | c, | |
const sc_fxnum_fast & | a | |||
) | [friend] |
sc_fxnum.h の 3785 行で定義されています。
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.h の 3793 行で定義されています。
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.h の 3875 行で定義されています。
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.h の 3929 行で定義されています。
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.h の 4070 行で定義されています。
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.h の 4078 行で定義されています。
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.h の 4086 行で定義されています。
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.h の 4096 行で定義されています。
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.h の 1102 行で定義されています。
double sc_dt::sc_fxnum_fast::m_val [private] |
sc_fxnum.h の 1366 行で定義されています。
scfx_params sc_dt::sc_fxnum_fast::m_params [private] |
sc_fxnum.h の 1368 行で定義されています。
bool sc_dt::sc_fxnum_fast::m_q_flag [private] |
sc_fxnum.h の 1369 行で定義されています。
bool sc_dt::sc_fxnum_fast::m_o_flag [private] |
sc_fxnum.h の 1370 行で定義されています。
sc_fxnum_fast_observer* sc_dt::sc_fxnum_fast::m_observer [mutable, private] |
sc_fxnum.h の 1372 行で定義されています。