50 #ifndef __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ 51 #define __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ 59 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
61 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
70 template <
int W,
int I,
80 #define DECL_CTORS_T_A(tp) \ 81 sc_fixed(tp, sc_fxnum_observer * =0); \ 82 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0); 84 #define DECL_CTORS_T_B(tp) \ 85 explicit sc_fixed(tp, sc_fxnum_observer * =0); \ 86 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0); 107 #undef DECL_CTORS_T_A 108 #undef DECL_CTORS_T_B 116 #define DECL_ASN_OP_T(op, tp) sc_fixed &operator op (tp); 118 #define DECL_ASN_OP_OTHER(op) \ 119 DECL_ASN_OP_T(op, int64) \ 120 DECL_ASN_OP_T(op, uint64) \ 121 DECL_ASN_OP_T(op, const sc_int_base&) \ 122 DECL_ASN_OP_T(op, const sc_uint_base&) \ 123 DECL_ASN_OP_T(op, const sc_signed&) \ 124 DECL_ASN_OP_T(op, const sc_unsigned&) 126 #define DECL_ASN_OP(op) \ 127 DECL_ASN_OP_T(op, int) \ 128 DECL_ASN_OP_T(op, unsigned int) \ 129 DECL_ASN_OP_T(op, long) \ 130 DECL_ASN_OP_T(op, unsigned long) \ 131 DECL_ASN_OP_T(op, float) \ 132 DECL_ASN_OP_T(op, double) \ 133 DECL_ASN_OP_T(op, const char *) \ 134 DECL_ASN_OP_T(op, const sc_fxval &) \ 135 DECL_ASN_OP_T(op, const sc_fxval_fast &) \ 136 DECL_ASN_OP_T(op, const sc_fxnum &) \ 137 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \ 138 DECL_ASN_OP_OTHER(op) 148 DECL_ASN_OP_T(>>=,
int)
150 DECL_ASN_OP_T(&=, const
sc_fix &)
152 DECL_ASN_OP_T(|=, const
sc_fix &)
154 DECL_ASN_OP_T(^=, const
sc_fix &)
158 #undef DECL_ASN_OP_OTHER 176 template <
int W,
int I,
187 #define DECL_CTORS_T_A(tp) \ 188 sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \ 189 sc_fixed_fast(tp, const sc_fxcast_switch &, \ 190 sc_fxnum_fast_observer * =0); 192 #define DECL_CTORS_T_B(tp) \ 193 explicit sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \ 194 sc_fixed_fast(tp, const sc_fxcast_switch &, \ 195 sc_fxnum_fast_observer * =0); 216 #undef DECL_CTORS_T_A 217 #undef DECL_CTORS_T_B 220 sc_fixed_fast(
const sc_fixed_fast<W, I, Q, O, N> &);
223 sc_fixed_fast &
operator = (
const sc_fixed_fast<W, I, Q, O, N> &);
225 #define DECL_ASN_OP_T(op, tp) sc_fixed_fast &operator op (tp); 227 #define DECL_ASN_OP_OTHER(op) \ 228 DECL_ASN_OP_T(op, int64) \ 229 DECL_ASN_OP_T(op, uint64) \ 230 DECL_ASN_OP_T(op, const sc_int_base &) \ 231 DECL_ASN_OP_T(op, const sc_uint_base &) \ 232 DECL_ASN_OP_T(op, const sc_signed &) \ 233 DECL_ASN_OP_T(op, const sc_unsigned &) 235 #define DECL_ASN_OP(op) \ 236 DECL_ASN_OP_T(op, int) \ 237 DECL_ASN_OP_T(op, unsigned int) \ 238 DECL_ASN_OP_T(op, long) \ 239 DECL_ASN_OP_T(op, unsigned long) \ 240 DECL_ASN_OP_T(op, float) \ 241 DECL_ASN_OP_T(op, double) \ 242 DECL_ASN_OP_T(op, const char *) \ 243 DECL_ASN_OP_T(op, const sc_fxval &) \ 244 DECL_ASN_OP_T(op, const sc_fxval_fast &) \ 245 DECL_ASN_OP_T(op, const sc_fxnum &) \ 246 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \ 247 DECL_ASN_OP_OTHER(op) 257 DECL_ASN_OP_T(>>=,
int)
259 DECL_ASN_OP_T(&=, const
sc_fix &)
260 DECL_ASN_OP_T(&=, const sc_fix_fast &)
261 DECL_ASN_OP_T(|=, const
sc_fix &)
262 DECL_ASN_OP_T(|=, const sc_fix_fast &)
263 DECL_ASN_OP_T(^=, const
sc_fix &)
264 DECL_ASN_OP_T(^=, const sc_fix_fast &)
267 #undef DECL_ASN_OP_OTHER 287 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
289 sc_fix(W, I, Q, O, N, observer_)
292 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
295 sc_fix(W, I, Q, O, N, cast_sw, observer_)
298 #define DEFN_CTORS_T(tp) \ 299 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 300 inline sc_fixed<W, I, Q, O, N>::sc_fixed( \ 301 tp a, sc_fxnum_observer* observer_) : \ 302 sc_fix(a, W, I, Q, O, N, observer_) \ 305 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 306 inline sc_fixed<W, I, Q, O, N>::sc_fixed( \ 307 tp a, const sc_fxcast_switch &cast_sw, \ 308 sc_fxnum_observer *observer_) : \ 309 sc_fix(a, W, I, Q, O, N, cast_sw, observer_) \ 334 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
340 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
348 #define DEFN_ASN_OP_T(op, tp) \ 349 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 350 inline sc_fixed<W, I, Q, O, N> & \ 351 sc_fixed<W, I, Q, O, N>::operator op (tp a) \ 353 sc_fix::operator op (a); \ 357 #define DEFN_ASN_OP_OTHER(op) \ 358 DEFN_ASN_OP_T(op, int64) \ 359 DEFN_ASN_OP_T(op, uint64) \ 360 DEFN_ASN_OP_T(op, const sc_int_base &) \ 361 DEFN_ASN_OP_T(op, const sc_uint_base &) \ 362 DEFN_ASN_OP_T(op, const sc_signed &) \ 363 DEFN_ASN_OP_T(op, const sc_unsigned &) 365 #define DEFN_ASN_OP(op) \ 366 DEFN_ASN_OP_T(op, int) \ 367 DEFN_ASN_OP_T(op, unsigned int) \ 368 DEFN_ASN_OP_T(op, long) \ 369 DEFN_ASN_OP_T(op, unsigned long) \ 370 DEFN_ASN_OP_T(op, float) \ 371 DEFN_ASN_OP_T(op, double) \ 372 DEFN_ASN_OP_T(op, const char *) \ 373 DEFN_ASN_OP_T(op, const sc_fxval &) \ 374 DEFN_ASN_OP_T(op, const sc_fxval_fast &) \ 375 DEFN_ASN_OP_T(op, const sc_fxnum &) \ 376 DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \ 377 DEFN_ASN_OP_OTHER(op) 397 #undef DEFN_ASN_OP_OTHER 401 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
405 return sc_fxval(sc_fix::operator ++ (0));
408 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
412 return sc_fxval(sc_fix::operator -- (0));
415 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
423 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
438 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
444 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
450 #define DEFN_CTORS_T(tp) \ 451 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 452 inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \ 453 tp a, sc_fxnum_fast_observer *observer_) : \ 454 sc_fix_fast(a, W, I, Q, O, N, observer_) \ 457 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 458 inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \ 459 tp a, const sc_fxcast_switch &cast_sw, \ 460 sc_fxnum_fast_observer *observer_) : \ 461 sc_fix_fast(a, W, I, Q, O, N, cast_sw, observer_) \ 486 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
492 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
501 #define DEFN_ASN_OP_T(op, tp) \ 502 template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 503 inline sc_fixed_fast<W, I, Q, O, N> & \ 504 sc_fixed_fast<W, I, Q, O, N>::operator op (tp a) \ 506 sc_fix_fast::operator op (a); \ 510 #define DEFN_ASN_OP_OTHER(op) \ 511 DEFN_ASN_OP_T(op, int64) \ 512 DEFN_ASN_OP_T(op, uint64) \ 513 DEFN_ASN_OP_T(op, const sc_int_base &) \ 514 DEFN_ASN_OP_T(op, const sc_uint_base &) \ 515 DEFN_ASN_OP_T(op, const sc_signed &) \ 516 DEFN_ASN_OP_T(op, const sc_unsigned &) 518 #define DEFN_ASN_OP(op) \ 519 DEFN_ASN_OP_T(op, int) \ 520 DEFN_ASN_OP_T(op, unsigned int) \ 521 DEFN_ASN_OP_T(op, long) \ 522 DEFN_ASN_OP_T(op, unsigned long) \ 523 DEFN_ASN_OP_T(op, float) \ 524 DEFN_ASN_OP_T(op, double) \ 525 DEFN_ASN_OP_T(op, const char *) \ 526 DEFN_ASN_OP_T(op, const sc_fxval &) \ 527 DEFN_ASN_OP_T(op, const sc_fxval_fast &) \ 528 DEFN_ASN_OP_T(op, const sc_fxnum &) \ 529 DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \ 530 DEFN_ASN_OP_OTHER(op) 540 DEFN_ASN_OP_T(>>=,
int)
542 DEFN_ASN_OP_T(&=, const
sc_fix &)
544 DEFN_ASN_OP_T(|=, const
sc_fix &)
546 DEFN_ASN_OP_T(^=, const
sc_fix &)
550 #undef DEFN_ASN_OP_OTHER 554 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
561 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
568 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
576 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
586 #endif // __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ friend class sc_fxval_fast
sc_fix_fast & operator++()
sc_fixed_fast & operator=(const sc_fixed_fast< W, I, Q, O, N > &)
sc_fix_fast & operator=(const sc_fix_fast &)
sc_fixed_fast(sc_fxnum_fast_observer *=0)
sc_fixed(sc_fxnum_observer *=0)
const int SC_DEFAULT_N_BITS_
#define DECL_ASN_OP_T(op, tp)
#define DECL_CTORS_T_A(tp)
sc_fix_fast(sc_fxnum_fast_observer *=0)
sc_fixed & operator=(const sc_fixed< W, I, Q, O, N > &)
#define DEFN_ASN_OP_T(op, tp)
#define DECL_CTORS_T_B(tp)
const sc_q_mode SC_DEFAULT_Q_MODE_
sc_fixed_fast & operator--()
sc_fix_fast & operator--()
const sc_o_mode SC_DEFAULT_O_MODE_
sc_fix(sc_fxnum_observer *=0)
sc_fix & operator=(const sc_fix &)
sc_fixed_fast & operator++()