68#ifndef __SYSTEMC_EXT_DT_FX_SCFX_REP_HH__
69#define __SYSTEMC_EXT_DT_FX_SCFX_REP_HH__
90void multiply(scfx_rep &,
const scfx_rep &,
const scfx_rep &,
95scfx_rep *
div_scfx_rep(
const scfx_rep &,
const scfx_rep &,
97scfx_rep *
add_scfx_rep(
const scfx_rep &,
const scfx_rep &,
99scfx_rep *
sub_scfx_rep(
const scfx_rep &,
const scfx_rep &,
166 void *
operator new (std::size_t);
167 void operator delete (
void *, std::size_t);
214 void print(::std::ostream &)
const;
215 void dump(::std::ostream &)
const;
314 m_mant(
min_mant), m_wp(2), m_sign(1), m_state(normal),
315 m_msw(0), m_lsw(0), m_r_flag(false)
342 c.m_sign = -
c.m_sign;
380 for (
int i = 0; i <
size(); i++) {
399 c.quantization(params, q_flag);
407 c.overflow(params, o_flag);
417 int size_incr = new_size -
size();
450 for (
int i = wi + 1; i <
size(); ++i)
456 for (
int i = wi + 1; i <
size(); ++i)
483 zero = (
m_mant[wi] & (((
word)-1) << (bi + 1))) == 0;
484 for (
int i = wi + 1; i <
size(); ++i)
485 zero = zero &&
m_mant[i] == 0;
498 bool zero = (
m_mant[wi] & ~(((
word)-1) << bi)) == 0;
499 for (
int i = wi - 1; i >= 0; --i)
500 zero = zero &&
m_mant[i] == 0;
537 for (i = 0; i <
size(); ++i)
541 for (i = wi + 1; i <
size(); ++i)
545 for (i = wi2 - 1; i >= 0; --i)
574 for (
int i = wi3 + 1; i <
size(); ++i) {
596 for (
int i = wi2 + 1; i <
size(); ++i)
609 return (
m_mant[wi] & (((
word)1) << (bi - 1))) != 0;
625 for (
int i = wi - 1; i >= 0; --i)
639 if (
m_mant[wi] <= old_val) {
640 if (wi + 1 ==
size())
643 for (
int i = wi + 1; i <
size(); ++i) {
672 zero = (
m_mant[wi] & ~(((
word)-1) << (bi - 1))) == 0;
673 for (
int i = wi - 1; i >= 0; --i)
674 zero = zero &&
m_mant[i] == 0;
675 }
else if (wi != 0) {
677 for (
int i = wi - 2; i >= 0; --i)
678 zero = zero &&
m_mant[i] == 0;
689 for (
int i = 0; i <
size(); i++) {
699 for (
int i =
size() - 1; i >= 0; i--) {
scfx_index(int wi_, int bi_)
void resize_to(int, int=0)
bool get_slice(int, int, const scfx_params &, sc_bv_base &) const
void cast(const scfx_params &, bool &, bool &)
friend void print_other(scfx_string &, const scfx_rep &, sc_numrep, int, sc_fmt, const scfx_params *)
friend scfx_rep * lsh_scfx_rep(const scfx_rep &, int)
friend void multiply(scfx_rep &, const scfx_rep &, const scfx_rep &, int)
void q_clear(const scfx_index &)
bool set_slice(int, int, const scfx_params &, const sc_bv_base &)
const scfx_index calc_indices(int) const
friend scfx_rep * add_scfx_rep(const scfx_rep &, const scfx_rep &, int)
friend int compare_msw_ff(const scfx_rep &lhs, const scfx_rep &rhs)
friend scfx_rep * overflow_scfx_rep(const scfx_rep &, const scfx_params &, bool &)
bool o_zero_right(const scfx_index &) const
friend scfx_rep * rsh_scfx_rep(const scfx_rep &, int)
friend scfx_rep * quantization_scfx_rep(const scfx_rep &, const scfx_params &, bool &)
void operator=(const scfx_rep &)
bool o_zero_left(const scfx_index &) const
void o_set_low(const scfx_index &, sc_enc)
friend scfx_rep * mult_scfx_rep(const scfx_rep &, const scfx_rep &, int)
void o_set_high(const scfx_index &, const scfx_index &, sc_enc, int=1)
bool o_bit_at(const scfx_index &) const
void o_set(const scfx_index &, const scfx_index &, sc_enc, bool)
void from_string(const char *, int)
bool q_zero(const scfx_index &) const
bool clear(int, const scfx_params &)
bool rounding_flag() const
unsigned int divide_by_ten()
void o_extend(const scfx_index &, sc_enc)
bool q_odd(const scfx_index &) const
friend int compare_abs(const scfx_rep &, const scfx_rep &)
void o_invert(const scfx_index &)
void quantization(const scfx_params &, bool &)
friend int compare_msw(const scfx_rep &, const scfx_rep &)
void dump(::std::ostream &) const
friend scfx_rep * div_scfx_rep(const scfx_rep &, const scfx_rep &, int)
void print(::std::ostream &) const
friend scfx_rep * neg_scfx_rep(const scfx_rep &)
void overflow(const scfx_params &, bool &)
void resize_to(int, int=0)
void q_incr(const scfx_index &)
friend void align(const scfx_rep &, const scfx_rep &, int &, int &, scfx_mant_ref &, scfx_mant_ref &)
bool set(int, const scfx_params &)
friend scfx_rep * sub_scfx_rep(const scfx_rep &, const scfx_rep &, int)
const char * to_string(sc_numrep, int, sc_fmt, const scfx_params *=0) const
friend int cmp_scfx_rep(const scfx_rep &, const scfx_rep &)
scfx_mant * resize(int, int) const
void get_type(int &, int &, sc_enc &) const
friend void print_dec(scfx_string &, const scfx_rep &, int, sc_fmt)
bool q_bit(const scfx_index &) const
const int SC_DEFAULT_DIV_WL_
void complement(scfx_mant &target, const scfx_mant &source, int size)
void multiply(scfx_rep &result, const scfx_rep &lhs, const scfx_rep &rhs, int max_wl)
scfx_rep * add_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int max_wl)
scfx_rep * rsh_scfx_rep(const scfx_rep &, int)
scfx_rep * mult_scfx_rep(const scfx_rep &, const scfx_rep &, int max_wl=SC_DEFAULT_MAX_WL_)
scfx_rep * lsh_scfx_rep(const scfx_rep &, int)
int cmp_scfx_rep(const scfx_rep &a, const scfx_rep &b)
const int SC_DEFAULT_MAX_WL_
scfx_rep * neg_scfx_rep(const scfx_rep &)
scfx_rep * div_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int div_wl)
scfx_rep * sub_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int max_wl)
void inc(scfx_mant &mant)
const int SC_DEFAULT_CTE_WL_
scfx_rep * quantization_scfx_rep(const scfx_rep &a, const scfx_params ¶ms, bool &q_flag)
scfx_rep * overflow_scfx_rep(const scfx_rep &a, const scfx_params ¶ms, bool &o_flag)
#define SC_ASSERT_(cnd, msg)