gem5
v20.1.0.0
|
#include <scfx_rep.hh>
Public Member Functions | |
scfx_rep () | |
scfx_rep (int) | |
scfx_rep (unsigned int) | |
scfx_rep (long) | |
scfx_rep (unsigned long) | |
scfx_rep (double) | |
scfx_rep (const char *) | |
scfx_rep (int64) | |
scfx_rep (uint64) | |
scfx_rep (const sc_signed &) | |
scfx_rep (const sc_unsigned &) | |
scfx_rep (const scfx_rep &) | |
~scfx_rep () | |
void * | operator new (std::size_t) |
void | operator delete (void *, std::size_t) |
void | from_string (const char *, int) |
double | to_double () const |
uint64 | to_uint64 () const |
const char * | to_string (sc_numrep, int, sc_fmt, const scfx_params *=0) const |
void | operator= (const scfx_rep &) |
void | lshift (int) |
void | rshift (int) |
void | cast (const scfx_params &, bool &, bool &) |
bool | is_neg () const |
bool | is_zero () const |
bool | is_nan () const |
bool | is_inf () const |
bool | is_normal () const |
void | set_zero (int=1) |
void | set_nan () |
void | set_inf (int) |
bool | get_bit (int) const |
bool | set (int, const scfx_params &) |
bool | clear (int, const scfx_params &) |
bool | get_slice (int, int, const scfx_params &, sc_bv_base &) const |
bool | set_slice (int, int, const scfx_params &, const sc_bv_base &) |
void | print (::std::ostream &) const |
void | dump (::std::ostream &) const |
void | get_type (int &, int &, sc_enc &) const |
bool | rounding_flag () const |
Private Types | |
enum | state { normal, infinity, not_a_number } |
Private Member Functions | |
unsigned int | divide_by_ten () |
int | find_lsw () const |
int | find_msw () const |
void | find_sw () |
void | multiply_by_ten () |
void | normalize (int) |
scfx_mant * | resize (int, int) const |
void | set_bin (int) |
void | set_oct (int, int) |
void | set_hex (int, int) |
void | shift_left (int) |
void | shift_right (int) |
const scfx_index | calc_indices (int) const |
void | o_extend (const scfx_index &, sc_enc) |
bool | o_bit_at (const scfx_index &) const |
bool | o_zero_left (const scfx_index &) const |
bool | o_zero_right (const scfx_index &) const |
void | o_set_low (const scfx_index &, sc_enc) |
void | o_set_high (const scfx_index &, const scfx_index &, sc_enc, int=1) |
void | o_set (const scfx_index &, const scfx_index &, sc_enc, bool) |
void | o_invert (const scfx_index &) |
bool | q_bit (const scfx_index &) const |
void | q_clear (const scfx_index &) |
void | q_incr (const scfx_index &) |
bool | q_odd (const scfx_index &) const |
bool | q_zero (const scfx_index &) const |
void | resize_to (int, int=0) |
int | size () const |
void | toggle_tc () |
void | quantization (const scfx_params &, bool &) |
void | overflow (const scfx_params &, bool &) |
void | round (int) |
Private Attributes | |
scfx_mant | m_mant |
int | m_wp |
int | m_sign |
state | m_state |
int | m_msw |
int | m_lsw |
bool | m_r_flag |
Definition at line 169 of file scfx_rep.hh.
|
private |
Enumerator | |
---|---|
normal | |
infinity | |
not_a_number |
Definition at line 171 of file scfx_rep.hh.
sc_dt::scfx_rep::scfx_rep | ( | ) |
Definition at line 131 of file scfx_rep.cc.
|
explicit |
Definition at line 138 of file scfx_rep.cc.
References ArmISA::a, sc_dt::bits_in_word, sc_dt::scfx_mant::clear(), find_sw(), m_mant, m_sign, m_state, m_wp, and normal.
|
explicit |
Definition at line 157 of file scfx_rep.cc.
|
explicit |
Definition at line 171 of file scfx_rep.cc.
References ArmISA::a, and sc_dt::bits_in_word.
|
explicit |
Definition at line 200 of file scfx_rep.cc.
References m_state, and not_a_number.
|
explicit |
Definition at line 225 of file scfx_rep.cc.
References ArmISA::a, sc_dt::bits_in_word, m_mant, and m_sign.
|
inlineexplicit |
Definition at line 345 of file scfx_rep.hh.
References ArmISA::a, ArmISA::b, ArmISA::c, and sc_dt::multiply().
|
explicit |
Definition at line 250 of file scfx_rep.cc.
|
explicit |
Definition at line 273 of file scfx_rep.cc.
References calc_indices(), ArmISA::i, m_mant, and RiscvISA::x.
|
explicit |
Definition at line 290 of file scfx_rep.cc.
|
explicit |
Definition at line 325 of file scfx_rep.cc.
References sc_dt::scfx_rep_node::data, and sc_dt::scfx_rep_node::next.
sc_dt::scfx_rep::scfx_rep | ( | const scfx_rep & | a | ) |
Definition at line 350 of file scfx_rep.cc.
|
inline |
Definition at line 353 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 458 of file scfx_rep.hh.
Referenced by clear(), get_bit(), scfx_rep(), and set().
void sc_dt::scfx_rep::cast | ( | const scfx_params & | params, |
bool & | q_flag, | ||
bool & | o_flag | ||
) |
Definition at line 2056 of file scfx_rep.cc.
References sc_dt::min_mant, sc_dt::sc_max(), and sc_dt::sc_min().
Referenced by sc_dt::sc_fxnum::cast().
bool scfx_rep::clear | ( | int | i, |
const scfx_params & | params | ||
) |
Definition at line 2429 of file scfx_rep.cc.
References calc_indices(), sc_dt::scfx_params::enc(), find_sw(), ArmISA::i, is_neg(), is_normal(), sc_dt::scfx_params::iwl(), m_mant, o_extend(), resize_to(), size(), toggle_tc(), and RiscvISA::x.
Referenced by sc_dt::sc_fxnum::set_bit(), and set_slice().
|
private |
Definition at line 2176 of file scfx_rep.cc.
void scfx_rep::dump | ( | ::std::ostream & | os | ) | const |
Definition at line 2526 of file scfx_rep.cc.
References ArmISA::i, infinity, m_lsw, m_mant, m_msw, m_sign, m_state, m_wp, normal, not_a_number, X86ISA::os, and size().
Referenced by sc_dt::sc_fxval::to_bin().
|
inlineprivate |
Definition at line 719 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 729 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 739 of file scfx_rep.hh.
Referenced by clear(), lshift(), normalize(), round(), scfx_rep(), and set().
void sc_dt::scfx_rep::from_string | ( | const char * | s, |
int | cte_wl | ||
) |
Definition at line 421 of file scfx_rep.cc.
References X86ISA::base, and SCFX_FAIL_IF_.
bool scfx_rep::get_bit | ( | int | i | ) | const |
Definition at line 2360 of file scfx_rep.cc.
References calc_indices(), ArmISA::i, is_neg(), is_normal(), m_mant, size(), toggle_tc(), and RiscvISA::x.
Referenced by sc_dt::sc_fxval::get_bit(), sc_dt::sc_fxnum::get_bit(), get_slice(), and get_type().
bool scfx_rep::get_slice | ( | int | i, |
int | j, | ||
const scfx_params & | , | ||
sc_bv_base & | bv | ||
) | const |
Definition at line 2465 of file scfx_rep.cc.
References get_bit(), ArmISA::i, is_inf(), is_nan(), ArmISA::j, MipsISA::k, MipsISA::l, and sc_dt::sc_bv_base::length().
Referenced by sc_dt::sc_fxnum::get_slice().
void scfx_rep::get_type | ( | int & | wl, |
int & | iwl, | ||
sc_enc & | enc | ||
) | const |
Definition at line 2570 of file scfx_rep.cc.
References sc_dt::bits_in_word, get_bit(), is_inf(), is_nan(), is_neg(), is_zero(), m_lsw, m_mant, m_msw, m_wp, sc_dt::SC_TC_, sc_dt::SC_US_, sc_dt::scfx_find_lsb(), and sc_dt::scfx_find_msb().
Referenced by sc_dt::sc_fxval::get_type().
|
inline |
Definition at line 422 of file scfx_rep.hh.
Referenced by get_slice(), get_type(), sc_dt::sc_fxval::is_inf(), round(), set_slice(), and sc_dt::sub_with_index().
|
inline |
Definition at line 420 of file scfx_rep.hh.
Referenced by get_slice(), get_type(), sc_dt::sc_fxval::is_nan(), round(), set_slice(), and sc_dt::sub_with_index().
|
inline |
Definition at line 404 of file scfx_rep.hh.
References ArmISA::a, and ArmISA::c.
Referenced by clear(), get_bit(), get_type(), sc_dt::sc_fxval::is_neg(), sc_dt::sc_fxnum::is_neg(), and set().
|
inline |
Definition at line 424 of file scfx_rep.hh.
Referenced by sc_dt::sc_fxnum::cast(), clear(), get_bit(), sc_dt::sc_fxval::is_normal(), sc_dt::sc_fxnum::is_normal(), lshift(), and set().
|
inline |
Definition at line 407 of file scfx_rep.hh.
Referenced by get_type(), sc_dt::sc_fxval::is_zero(), sc_dt::sc_fxnum::is_zero(), and round().
void sc_dt::scfx_rep::lshift | ( | int | n | ) |
Definition at line 1625 of file scfx_rep.cc.
References sc_dt::bits_in_word, find_sw(), is_normal(), m_lsw, m_mant, m_wp, ArmISA::n, resize_to(), sc_dt::scfx_find_lsb(), shift_right(), and size().
|
private |
Definition at line 2178 of file scfx_rep.cc.
References sc_dt::add_mants(), sc_dt::bits_in_word, m_mant, sc_dt::scfx_mant::size(), and size().
|
private |
Definition at line 2209 of file scfx_rep.cc.
References sc_dt::bits_in_word, find_sw(), m_wp, ArmISA::shift, and shift_left().
|
inlineprivate |
Definition at line 495 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 472 of file scfx_rep.hh.
References PowerISA::bi, sc_dt::bits_in_word, ArmISA::i, m_mant, SC_ASSERT_, size(), and RiscvISA::x.
|
inlineprivate |
Definition at line 622 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 589 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 556 of file scfx_rep.hh.
References PowerISA::bi, sc_dt::bits_in_word, ArmISA::i, m_mant, SC_ASSERT_, sc_dt::SC_TC_, size(), and RiscvISA::x.
|
inlineprivate |
Definition at line 538 of file scfx_rep.hh.
|
inlineprivate |
Definition at line 506 of file scfx_rep.hh.
References PowerISA::bi, sc_dt::scfx_mant::clear(), m_mant, m_sign, SC_ASSERT_, sc_dt::SC_TC_, size(), and RiscvISA::x.
|
inlineprivate |
Definition at line 523 of file scfx_rep.hh.
References PowerISA::bi, ArmISA::i, SC_ASSERT_, size(), and RiscvISA::x.
void sc_dt::scfx_rep::operator delete | ( | void * | ptr, |
std::size_t | size | ||
) |
Definition at line 392 of file scfx_rep.cc.
void * sc_dt::scfx_rep::operator new | ( | std::size_t | size | ) |
Definition at line 371 of file scfx_rep.cc.
References ArmISA::s, and SCFX_FAIL_IF_.
|
inline |
Definition at line 357 of file scfx_rep.hh.
|
private |
Definition at line 1895 of file scfx_rep.cc.
void scfx_rep::print | ( | ::std::ostream & | os | ) | const |
Definition at line 2515 of file scfx_rep.cc.
References X86ISA::os, sc_dt::SC_DEC, sc_dt::SC_E, and to_string().
Referenced by sc_dt::sc_fxval::to_string().
|
inlineprivate |
Definition at line 633 of file scfx_rep.hh.
Referenced by round().
|
inlineprivate |
Definition at line 649 of file scfx_rep.hh.
References PowerISA::bi, m_mant, SC_ASSERT_, size(), and RiscvISA::x.
Referenced by round().
|
inlineprivate |
Definition at line 662 of file scfx_rep.hh.
References PowerISA::bi, sc_dt::bits_in_word, ArmISA::i, m_mant, SC_ASSERT_, size(), and RiscvISA::x.
Referenced by round().
|
inlineprivate |
Definition at line 683 of file scfx_rep.hh.
Referenced by round().
|
inlineprivate |
Definition at line 694 of file scfx_rep.hh.
Referenced by round().
|
private |
Definition at line 1811 of file scfx_rep.cc.
|
private |
Definition at line 2231 of file scfx_rep.cc.
References sc_dt::scfx_mant::clear(), ArmISA::j, m_lsw, m_mant, m_msw, m_wp, and ArmISA::shift.
|
inlineprivate |
Definition at line 446 of file scfx_rep.hh.
References PowerISA::bi, sc_dt::bits_in_word, ArmISA::i, m_mant, m_sign, and size().
|
private |
Definition at line 2614 of file scfx_rep.cc.
References PowerISA::bi, sc_dt::bits_in_word, find_sw(), is_inf(), is_nan(), is_zero(), m_lsw, m_mant, m_msw, m_r_flag, q_bit(), q_clear(), q_incr(), q_odd(), q_zero(), sc_dt::scfx_find_lsb(), sc_dt::scfx_find_msb(), and RiscvISA::x.
|
inline |
Definition at line 443 of file scfx_rep.hh.
Referenced by sc_dt::sc_fxval::rounding_flag().
void sc_dt::scfx_rep::rshift | ( | int | n | ) |
Definition at line 1656 of file scfx_rep.cc.
bool scfx_rep::set | ( | int | i, |
const scfx_params & | params | ||
) |
Definition at line 2390 of file scfx_rep.cc.
References calc_indices(), sc_dt::scfx_params::enc(), find_sw(), ArmISA::i, is_neg(), is_normal(), sc_dt::scfx_params::iwl(), m_mant, o_extend(), resize_to(), size(), toggle_tc(), and RiscvISA::x.
Referenced by sc_dt::sc_fxnum::set_bit(), and set_slice().
|
private |
Definition at line 2252 of file scfx_rep.cc.
|
private |
Definition at line 2284 of file scfx_rep.cc.
|
inline |
Definition at line 337 of file scfx_rep.hh.
References ArmISA::a, and ArmISA::c.
Referenced by sc_dt::sub_with_index().
|
inline |
Definition at line 330 of file scfx_rep.hh.
Referenced by sc_dt::sub_with_index().
|
private |
Definition at line 2263 of file scfx_rep.cc.
bool scfx_rep::set_slice | ( | int | i, |
int | j, | ||
const scfx_params & | params, | ||
const sc_bv_base & | bv | ||
) |
Definition at line 2486 of file scfx_rep.cc.
References clear(), ArmISA::i, is_inf(), is_nan(), ArmISA::j, MipsISA::k, MipsISA::l, sc_dt::sc_bv_base::length(), set(), and to_bool().
Referenced by sc_dt::sc_fxnum::set_slice().
|
inline |
Definition at line 321 of file scfx_rep.hh.
|
private |
Definition at line 2311 of file scfx_rep.cc.
References sc_dt::bits_in_word, ArmISA::i, m_mant, ArmISA::n, SC_ASSERT_, shift_right(), and size().
Referenced by normalize(), and shift_right().
|
private |
Definition at line 2336 of file scfx_rep.cc.
References sc_dt::bits_in_word, ArmISA::i, m_mant, ArmISA::n, SC_ASSERT_, shift_left(), and size().
Referenced by lshift(), and shift_left().
|
inlineprivate |
Definition at line 402 of file scfx_rep.hh.
Referenced by clear(), dump(), get_bit(), lshift(), multiply_by_ten(), o_extend(), o_set(), o_set_high(), o_zero_left(), o_zero_right(), q_clear(), q_incr(), resize_to(), set(), shift_left(), shift_right(), and sc_dt::sub_with_index().
double sc_dt::scfx_rep::to_double | ( | ) | const |
Definition at line 754 of file scfx_rep.cc.
References ArmISA::id.
Referenced by sc_dt::sc_fxval::operator double(), sc_dt::sc_fxnum::operator double(), sc_dt::sc_fxval::to_double(), sc_dt::sc_fxnum::to_double(), sc_dt::sc_fxval::to_float(), and sc_dt::sc_fxnum::to_float().
const char * sc_dt::scfx_rep::to_string | ( | sc_numrep | numrep, |
int | w_prefix, | ||
sc_fmt | fmt, | ||
const scfx_params * | params = 0 |
||
) | const |
Definition at line 1172 of file scfx_rep.cc.
References ArmISA::a, ArmISA::b, MipsISA::index, and RiscvISA::x.
Referenced by sc_dt::sc_fxnum_fast_subref::dump(), print(), sc_dt::sc_fxnum_fast_subref::print(), sc_dt::sc_fxval::to_string(), and sc_dt::sc_fxnum::to_string().
uint64 sc_dt::scfx_rep::to_uint64 | ( | ) | const |
Definition at line 866 of file scfx_rep.cc.
References ArmISA::s, sc_dt::SC_DEC, and sc_dt::scfx_print_prefix().
Referenced by sc_dt::sc_fxval::to_int(), sc_dt::sc_fxnum::to_int(), sc_dt::sc_fxval::to_int64(), sc_dt::sc_fxnum::to_int64(), sc_dt::sc_fxval::to_long(), sc_dt::sc_fxnum::to_long(), sc_dt::sc_fxval::to_short(), sc_dt::sc_fxnum::to_short(), sc_dt::sc_fxval::to_uint(), sc_dt::sc_fxnum::to_uint(), sc_dt::sc_fxval::to_uint64(), sc_dt::sc_fxnum::to_uint64(), sc_dt::sc_fxval::to_ulong(), sc_dt::sc_fxnum::to_ulong(), sc_dt::sc_fxval::to_ushort(), and sc_dt::sc_fxnum::to_ushort().
|
inlineprivate |
Definition at line 746 of file scfx_rep.hh.
Definition at line 1249 of file scfx_rep.cc.
|
friend |
Definition at line 2083 of file scfx_rep.cc.
Definition at line 1758 of file scfx_rep.cc.
Definition at line 1689 of file scfx_rep.cc.
Definition at line 2127 of file scfx_rep.cc.
Definition at line 1527 of file scfx_rep.cc.
Definition at line 387 of file scfx_rep.hh.
|
friend |
Definition at line 379 of file scfx_rep.hh.
Definition at line 1452 of file scfx_rep.cc.
Definition at line 371 of file scfx_rep.hh.
|
friend |
Definition at line 436 of file scfx_rep.hh.
|
friend |
Definition at line 895 of file scfx_rep.cc.
|
friend |
Definition at line 1019 of file scfx_rep.cc.
|
friend |
Definition at line 427 of file scfx_rep.hh.
Definition at line 395 of file scfx_rep.hh.
Definition at line 1358 of file scfx_rep.cc.
|
private |
Definition at line 313 of file scfx_rep.hh.
Referenced by dump(), get_type(), lshift(), resize(), and round().
|
private |
Definition at line 308 of file scfx_rep.hh.
Referenced by clear(), dump(), get_bit(), get_type(), lshift(), multiply_by_ten(), o_extend(), o_set(), o_set_high(), o_zero_left(), q_clear(), q_incr(), resize(), resize_to(), round(), scfx_rep(), set(), set_bin(), set_hex(), set_oct(), shift_left(), and shift_right().
|
private |
Definition at line 312 of file scfx_rep.hh.
Referenced by dump(), get_type(), resize(), and round().
|
private |
Definition at line 314 of file scfx_rep.hh.
Referenced by round().
|
private |
Definition at line 310 of file scfx_rep.hh.
Referenced by dump(), sc_dt::neg_scfx_rep(), o_zero_left(), resize_to(), scfx_rep(), and sc_dt::sub_with_index().
|
private |
Definition at line 311 of file scfx_rep.hh.
Referenced by dump(), sc_dt::lsh_scfx_rep(), and scfx_rep().
|
private |
Definition at line 309 of file scfx_rep.hh.
Referenced by dump(), get_type(), lshift(), normalize(), sc_dt::quantization_scfx_rep(), resize(), scfx_rep(), and sc_dt::sub_with_index().