59 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
class sc_fixed;
60 template <
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
class sc_fixed_fast;
69 template <
int W,
int I,
82 #define DECL_CTORS_T_A(tp) \
83 sc_fixed( tp, sc_fxnum_observer* = 0 ); \
84 sc_fixed( tp, const sc_fxcast_switch&, sc_fxnum_observer* = 0 );
86 #define DECL_CTORS_T_B(tp) \
87 explicit sc_fixed( tp, sc_fxnum_observer* = 0 ); \
88 sc_fixed( tp, const sc_fxcast_switch&, sc_fxnum_observer* = 0 );
101 #ifndef SC_FX_EXCLUDE_OTHER
110 #undef DECL_CTORS_T_A
111 #undef DECL_CTORS_T_B
122 #define DECL_ASN_OP_T(op,tp) \
123 sc_fixed& operator op ( tp );
125 #ifndef SC_FX_EXCLUDE_OTHER
126 #define DECL_ASN_OP_OTHER(op) \
127 DECL_ASN_OP_T(op,int64) \
128 DECL_ASN_OP_T(op,uint64) \
129 DECL_ASN_OP_T(op,const sc_int_base&) \
130 DECL_ASN_OP_T(op,const sc_uint_base&) \
131 DECL_ASN_OP_T(op,const sc_signed&) \
132 DECL_ASN_OP_T(op,const sc_unsigned&)
134 #define DECL_ASN_OP_OTHER(op)
137 #define DECL_ASN_OP(op) \
138 DECL_ASN_OP_T(op,int) \
139 DECL_ASN_OP_T(op,unsigned int) \
140 DECL_ASN_OP_T(op,long) \
141 DECL_ASN_OP_T(op,unsigned long) \
142 DECL_ASN_OP_T(op,float) \
143 DECL_ASN_OP_T(op,double) \
144 DECL_ASN_OP_T(op,const char*) \
145 DECL_ASN_OP_T(op,const sc_fxval&) \
146 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
147 DECL_ASN_OP_T(op,const sc_fxnum&) \
148 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
149 DECL_ASN_OP_OTHER(op)
159 DECL_ASN_OP_T(>>=,
int)
161 DECL_ASN_OP_T(&=,const
sc_fix&)
163 DECL_ASN_OP_T(|=,const
sc_fix&)
165 DECL_ASN_OP_T(^=,const
sc_fix&)
169 #undef DECL_ASN_OP_OTHER
190 template <
int W,
int I,
204 #define DECL_CTORS_T_A(tp) \
205 sc_fixed_fast( tp, sc_fxnum_fast_observer* = 0 ); \
206 sc_fixed_fast( tp, const sc_fxcast_switch&, \
207 sc_fxnum_fast_observer* = 0 );
209 #define DECL_CTORS_T_B(tp) \
210 explicit sc_fixed_fast( tp, sc_fxnum_fast_observer* = 0 ); \
211 sc_fixed_fast( tp, const sc_fxcast_switch&, \
212 sc_fxnum_fast_observer* = 0 );
225 #ifndef SC_FX_EXCLUDE_OTHER
234 #undef DECL_CTORS_T_A
235 #undef DECL_CTORS_T_B
246 #define DECL_ASN_OP_T(op,tp) \
247 sc_fixed_fast& operator op ( tp );
249 #ifndef SC_FX_EXCLUDE_OTHER
250 #define DECL_ASN_OP_OTHER(op) \
251 DECL_ASN_OP_T(op,int64) \
252 DECL_ASN_OP_T(op,uint64) \
253 DECL_ASN_OP_T(op,const sc_int_base&) \
254 DECL_ASN_OP_T(op,const sc_uint_base&) \
255 DECL_ASN_OP_T(op,const sc_signed&) \
256 DECL_ASN_OP_T(op,const sc_unsigned&)
258 #define DECL_ASN_OP_OTHER(op)
261 #define DECL_ASN_OP(op) \
262 DECL_ASN_OP_T(op,int) \
263 DECL_ASN_OP_T(op,unsigned int) \
264 DECL_ASN_OP_T(op,long) \
265 DECL_ASN_OP_T(op,unsigned long) \
266 DECL_ASN_OP_T(op,float) \
267 DECL_ASN_OP_T(op,double) \
268 DECL_ASN_OP_T(op,const char*) \
269 DECL_ASN_OP_T(op,const sc_fxval&) \
270 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
271 DECL_ASN_OP_T(op,const sc_fxnum&) \
272 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
273 DECL_ASN_OP_OTHER(op)
283 DECL_ASN_OP_T(>>=,
int)
285 DECL_ASN_OP_T(&=,const sc_fix&)
287 DECL_ASN_OP_T(|=,const sc_fix&)
289 DECL_ASN_OP_T(^=,const sc_fix&)
293 #undef DECL_ASN_OP_OTHER
316 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
319 :
sc_fix( W, I, Q, O, N, observer_ )
322 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
326 :
sc_fix( W, I, Q, O, N, cast_sw, observer_ )
329 #define DEFN_CTORS_T(tp) \
330 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
332 sc_fixed<W,I,Q,O,N>::sc_fixed( tp a, \
333 sc_fxnum_observer* observer_ ) \
334 : sc_fix( a, W, I, Q, O, N, observer_ ) \
337 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
339 sc_fixed<W,I,Q,O,N>::sc_fixed( tp a, \
340 const sc_fxcast_switch& cast_sw, \
341 sc_fxnum_observer* observer_ ) \
342 : sc_fix( a, W, I, Q, O, N, cast_sw, observer_ ) \
356 #ifndef SC_FX_EXCLUDE_OTHER
369 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
372 :
sc_fix( a, W, I, Q, O, N )
378 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
387 #define DEFN_ASN_OP_T(op,tp) \
388 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
390 sc_fixed<W,I,Q,O,N>& \
391 sc_fixed<W,I,Q,O,N>::operator op ( tp a ) \
393 sc_fix::operator op ( a ); \
397 #ifndef SC_FX_EXCLUDE_OTHER
398 #define DEFN_ASN_OP_OTHER(op) \
399 DEFN_ASN_OP_T(op,int64) \
400 DEFN_ASN_OP_T(op,uint64) \
401 DEFN_ASN_OP_T(op,const sc_int_base&) \
402 DEFN_ASN_OP_T(op,const sc_uint_base&) \
403 DEFN_ASN_OP_T(op,const sc_signed&) \
404 DEFN_ASN_OP_T(op,const sc_unsigned&)
406 #define DEFN_ASN_OP_OTHER(op)
409 #define DEFN_ASN_OP(op) \
410 DEFN_ASN_OP_T(op,int) \
411 DEFN_ASN_OP_T(op,unsigned int) \
412 DEFN_ASN_OP_T(op,long) \
413 DEFN_ASN_OP_T(op,unsigned long) \
414 DEFN_ASN_OP_T(op,float) \
415 DEFN_ASN_OP_T(op,double) \
416 DEFN_ASN_OP_T(op,const char*) \
417 DEFN_ASN_OP_T(op,const sc_fxval&) \
418 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
419 DEFN_ASN_OP_T(op,const sc_fxnum&) \
420 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
421 DEFN_ASN_OP_OTHER(op)
431 DEFN_ASN_OP_T(>>=,
int)
433 DEFN_ASN_OP_T(&=,const
sc_fix&)
435 DEFN_ASN_OP_T(|=,const
sc_fix&)
437 DEFN_ASN_OP_T(^=,const
sc_fix&)
441 #undef DEFN_ASN_OP_OTHER
447 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
452 return sc_fxval( sc_fix::operator ++ ( 0 ) );
455 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
460 return sc_fxval( sc_fix::operator -- ( 0 ) );
463 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
472 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
488 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
494 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
501 #define DEFN_CTORS_T(tp) \
502 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
504 sc_fixed_fast<W,I,Q,O,N>::sc_fixed_fast( tp a, \
505 sc_fxnum_fast_observer* observer_ ) \
506 : sc_fix_fast( a, W, I, Q, O, N, observer_ ) \
509 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
511 sc_fixed_fast<W,I,Q,O,N>::sc_fixed_fast( tp a, \
512 const sc_fxcast_switch& cast_sw, \
513 sc_fxnum_fast_observer* observer_ ) \
514 : sc_fix_fast( a, W, I, Q, O, N, cast_sw, observer_ ) \
528 #ifndef SC_FX_EXCLUDE_OTHER
541 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
550 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
559 #define DEFN_ASN_OP_T(op,tp) \
560 template<int W, int I, sc_q_mode Q, sc_o_mode O, int N> \
562 sc_fixed_fast<W,I,Q,O,N>& \
563 sc_fixed_fast<W,I,Q,O,N>::operator op ( tp a ) \
565 sc_fix_fast::operator op ( a ); \
569 #ifndef SC_FX_EXCLUDE_OTHER
570 #define DEFN_ASN_OP_OTHER(op) \
571 DEFN_ASN_OP_T(op,int64) \
572 DEFN_ASN_OP_T(op,uint64) \
573 DEFN_ASN_OP_T(op,const sc_int_base&) \
574 DEFN_ASN_OP_T(op,const sc_uint_base&) \
575 DEFN_ASN_OP_T(op,const sc_signed&) \
576 DEFN_ASN_OP_T(op,const sc_unsigned&)
578 #define DEFN_ASN_OP_OTHER(op)
581 #define DEFN_ASN_OP(op) \
582 DEFN_ASN_OP_T(op,int) \
583 DEFN_ASN_OP_T(op,unsigned int) \
584 DEFN_ASN_OP_T(op,long) \
585 DEFN_ASN_OP_T(op,unsigned long) \
586 DEFN_ASN_OP_T(op,float) \
587 DEFN_ASN_OP_T(op,double) \
588 DEFN_ASN_OP_T(op,const char*) \
589 DEFN_ASN_OP_T(op,const sc_fxval&) \
590 DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
591 DEFN_ASN_OP_T(op,const sc_fxnum&) \
592 DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
593 DEFN_ASN_OP_OTHER(op)
602 DEFN_ASN_OP_T(<<=,
int)
603 DEFN_ASN_OP_T(>>=,
int)
605 DEFN_ASN_OP_T(&=,const sc_fix&)
606 DEFN_ASN_OP_T(&=,const sc_fix_fast&)
607 DEFN_ASN_OP_T(|=,const sc_fix&)
608 DEFN_ASN_OP_T(|=,const sc_fix_fast&)
609 DEFN_ASN_OP_T(^=,const sc_fix&)
610 DEFN_ASN_OP_T(^=,const sc_fix_fast&)
613 #undef DEFN_ASN_OP_OTHER
619 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
627 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
635 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
644 template<
int W,
int I, sc_q_mode Q, sc_o_mode O,
int N>
#define DEFN_ASN_OP_T(op, tp)
#define DECL_CTORS_T_A(tp)
sc_fix_fast & operator--()
sc_fix_fast & operator=(const sc_fix_fast &)
friend class sc_fxval_fast
sc_fixed_fast & operator=(const sc_fixed_fast< W, I, Q, O, N > &)
sc_fixed_fast & operator++()
#define DECL_CTORS_T_B(tp)
sc_fixed & operator=(const sc_fixed< W, I, Q, O, N > &)
#define DECL_ASN_OP_T(op, tp)
sc_fixed_fast & operator--()
sc_fix & operator=(const sc_fix &)
sc_fix_fast(sc_fxnum_fast_observer *=0)
sc_fixed_fast(sc_fxnum_fast_observer *=0)
const int SC_DEFAULT_N_BITS_
sc_fix_fast & operator++()
const sc_q_mode SC_DEFAULT_Q_MODE_
const sc_o_mode SC_DEFAULT_O_MODE_
sc_fixed(sc_fxnum_observer *=0)