112#define DECL_CTORS_T(tp) \
115 sc_fxnum_observer* = 0 ); \
117 sc_q_mode, sc_o_mode, \
118 sc_fxnum_observer* = 0 ); \
120 sc_q_mode, sc_o_mode, int, \
121 sc_fxnum_observer* = 0 ); \
123 int, int, sc_q_mode, sc_o_mode, \
124 sc_fxnum_observer* = 0 ); \
126 int, int, sc_q_mode, sc_o_mode, int, \
127 sc_fxnum_observer* = 0 ); \
129 const sc_fxcast_switch&, \
130 sc_fxnum_observer* = 0 ); \
133 const sc_fxcast_switch&, \
134 sc_fxnum_observer* = 0 ); \
136 sc_q_mode, sc_o_mode, \
137 const sc_fxcast_switch&, \
138 sc_fxnum_observer* = 0 ); \
140 sc_q_mode, sc_o_mode, int, \
141 const sc_fxcast_switch&, \
142 sc_fxnum_observer* = 0 ); \
144 int, int, sc_q_mode, sc_o_mode, \
145 const sc_fxcast_switch&, \
146 sc_fxnum_observer* = 0 ); \
148 int, int, sc_q_mode, sc_o_mode, int, \
149 const sc_fxcast_switch&, \
150 sc_fxnum_observer* = 0 ); \
152 const sc_fxtype_params&, \
153 sc_fxnum_observer* = 0 ); \
155 const sc_fxtype_params&, \
156 const sc_fxcast_switch&, \
157 sc_fxnum_observer* = 0 );
159#define DECL_CTORS_T_A(tp) \
161 sc_fxnum_observer* = 0 ); \
164#define DECL_CTORS_T_B(tp) \
165 explicit sc_fix( tp, \
166 sc_fxnum_observer* = 0 ); \
236#define DECL_ASN_OP_T(op,tp) \
237 sc_fix& operator op ( tp );
239#define DECL_ASN_OP_OTHER(op) \
240 DECL_ASN_OP_T(op,int64) \
241 DECL_ASN_OP_T(op,uint64) \
242 DECL_ASN_OP_T(op,const sc_int_base&) \
243 DECL_ASN_OP_T(op,const sc_uint_base&) \
244 DECL_ASN_OP_T(op,const sc_signed&) \
245 DECL_ASN_OP_T(op,const sc_unsigned&)
247#define DECL_ASN_OP(op) \
248 DECL_ASN_OP_T(op,int) \
249 DECL_ASN_OP_T(op,unsigned int) \
250 DECL_ASN_OP_T(op,long) \
251 DECL_ASN_OP_T(op,unsigned long) \
252 DECL_ASN_OP_T(op,float) \
253 DECL_ASN_OP_T(op,double) \
254 DECL_ASN_OP_T(op,const char*) \
255 DECL_ASN_OP_T(op,const sc_fxval&) \
256 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
257 DECL_ASN_OP_T(op,const sc_fxnum&) \
258 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
259 DECL_ASN_OP_OTHER(op)
279#undef DECL_ASN_OP_OTHER
341#define DECL_CTORS_T(tp) \
344 sc_fxnum_fast_observer* = 0 ); \
346 sc_q_mode, sc_o_mode, \
347 sc_fxnum_fast_observer* = 0 ); \
349 sc_q_mode, sc_o_mode, int, \
350 sc_fxnum_fast_observer* = 0 ); \
352 int, int, sc_q_mode, sc_o_mode, \
353 sc_fxnum_fast_observer* = 0 ); \
355 int, int, sc_q_mode, sc_o_mode, int, \
356 sc_fxnum_fast_observer* = 0 ); \
358 const sc_fxcast_switch&, \
359 sc_fxnum_fast_observer* = 0 ); \
362 const sc_fxcast_switch&, \
363 sc_fxnum_fast_observer* = 0 ); \
365 sc_q_mode, sc_o_mode, \
366 const sc_fxcast_switch&, \
367 sc_fxnum_fast_observer* = 0 ); \
369 sc_q_mode, sc_o_mode, int, \
370 const sc_fxcast_switch&, \
371 sc_fxnum_fast_observer* = 0 ); \
373 int, int, sc_q_mode, sc_o_mode, \
374 const sc_fxcast_switch&, \
375 sc_fxnum_fast_observer* = 0 ); \
377 int, int, sc_q_mode, sc_o_mode, int, \
378 const sc_fxcast_switch&, \
379 sc_fxnum_fast_observer* = 0 ); \
381 const sc_fxtype_params&, \
382 sc_fxnum_fast_observer* = 0 ); \
384 const sc_fxtype_params&, \
385 const sc_fxcast_switch&, \
386 sc_fxnum_fast_observer* = 0 );
388#define DECL_CTORS_T_A(tp) \
390 sc_fxnum_fast_observer* = 0 ); \
393#define DECL_CTORS_T_B(tp) \
394 explicit sc_fix_fast( tp, \
395 sc_fxnum_fast_observer* = 0 ); \
422 sc_fix_fast(
const sc_fix_fast& );
432 friend void b_not( sc_fix_fast&,
const sc_fix_fast& );
456#define DECL_ASN_OP_T(op,tp) \
457 sc_fix_fast& operator op ( tp );
459#define DECL_ASN_OP_OTHER(op) \
460 DECL_ASN_OP_T(op,int64) \
461 DECL_ASN_OP_T(op,uint64) \
462 DECL_ASN_OP_T(op,const sc_int_base&) \
463 DECL_ASN_OP_T(op,const sc_uint_base&) \
464 DECL_ASN_OP_T(op,const sc_signed&) \
465 DECL_ASN_OP_T(op,const sc_unsigned&)
467#define DECL_ASN_OP(op) \
468 DECL_ASN_OP_T(op,int) \
469 DECL_ASN_OP_T(op,unsigned int) \
470 DECL_ASN_OP_T(op,long) \
471 DECL_ASN_OP_T(op,unsigned long) \
472 DECL_ASN_OP_T(op,float) \
473 DECL_ASN_OP_T(op,double) \
474 DECL_ASN_OP_T(op,const char*) \
475 DECL_ASN_OP_T(op,const sc_fxval&) \
476 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
477 DECL_ASN_OP_T(op,const sc_fxnum&) \
478 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
479 DECL_ASN_OP_OTHER(op)
499#undef DECL_ASN_OP_OTHER
505 sc_fxval_fast operator ++ (
int );
506 sc_fxval_fast operator -- (
int );
508 sc_fix_fast& operator ++ ();
509 sc_fix_fast& operator -- ();
655#define DEFN_CTORS_T_A(tp) \
657sc_fix::sc_fix( tp a, \
658 sc_fxnum_observer* observer_ ) \
660 sc_fxtype_params(), \
662 sc_fxcast_switch(), \
667sc_fix::sc_fix( tp a, \
669 sc_fxnum_observer* observer_ ) \
671 sc_fxtype_params( wl_, iwl_ ), \
673 sc_fxcast_switch(), \
678sc_fix::sc_fix( tp a, \
679 sc_q_mode qm, sc_o_mode om, \
680 sc_fxnum_observer* observer_ ) \
682 sc_fxtype_params( qm, om ), \
684 sc_fxcast_switch(), \
689sc_fix::sc_fix( tp a, \
690 sc_q_mode qm, sc_o_mode om, int nb, \
691 sc_fxnum_observer* observer_ ) \
693 sc_fxtype_params( qm, om, nb ), \
695 sc_fxcast_switch(), \
700sc_fix::sc_fix( tp a, \
701 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
702 sc_fxnum_observer* observer_ ) \
704 sc_fxtype_params( wl_, iwl_, qm, om ), \
706 sc_fxcast_switch(), \
711sc_fix::sc_fix( tp a, \
712 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
713 sc_fxnum_observer* observer_ ) \
715 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
717 sc_fxcast_switch(), \
722sc_fix::sc_fix( tp a, \
723 const sc_fxcast_switch& cast_sw, \
724 sc_fxnum_observer* observer_ ) \
726 sc_fxtype_params(), \
733sc_fix::sc_fix( tp a, \
735 const sc_fxcast_switch& cast_sw, \
736 sc_fxnum_observer* observer_ ) \
738 sc_fxtype_params( wl_, iwl_ ), \
745sc_fix::sc_fix( tp a, \
746 sc_q_mode qm, sc_o_mode om, \
747 const sc_fxcast_switch& cast_sw, \
748 sc_fxnum_observer* observer_ ) \
750 sc_fxtype_params( qm, om ), \
757sc_fix::sc_fix( tp a, \
758 sc_q_mode qm, sc_o_mode om, int nb, \
759 const sc_fxcast_switch& cast_sw, \
760 sc_fxnum_observer* observer_ ) \
762 sc_fxtype_params( qm, om, nb ), \
769sc_fix::sc_fix( tp a, \
770 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
771 const sc_fxcast_switch& cast_sw, \
772 sc_fxnum_observer* observer_ ) \
774 sc_fxtype_params( wl_, iwl_, qm, om ), \
781sc_fix::sc_fix( tp a, \
782 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
783 const sc_fxcast_switch& cast_sw, \
784 sc_fxnum_observer* observer_ ) \
786 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
793sc_fix::sc_fix( tp a, \
794 const sc_fxtype_params& type_params_, \
795 sc_fxnum_observer* observer_ ) \
799 sc_fxcast_switch(), \
804sc_fix::sc_fix( tp a, \
805 const sc_fxtype_params& type_params_, \
806 const sc_fxcast_switch& cast_sw, \
807 sc_fxnum_observer* observer_ ) \
815#define DEFN_CTORS_T_B(tp) \
817sc_fix::sc_fix( tp a, \
818 sc_fxnum_observer* observer_ ) \
822 sc_fxcast_switch(), \
827sc_fix::sc_fix( tp a, \
829 sc_fxnum_observer* observer_ ) \
831 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
833 sc_fxcast_switch(), \
838sc_fix::sc_fix( tp a, \
839 sc_q_mode qm, sc_o_mode om, \
840 sc_fxnum_observer* observer_ ) \
842 sc_fxtype_params( a.type_params(), qm, om ), \
844 sc_fxcast_switch(), \
849sc_fix::sc_fix( tp a, \
850 sc_q_mode qm, sc_o_mode om, int nb, \
851 sc_fxnum_observer* observer_ ) \
853 sc_fxtype_params( a.type_params(), qm, om, nb ), \
855 sc_fxcast_switch(), \
860sc_fix::sc_fix( tp a, \
861 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
862 sc_fxnum_observer* observer_ ) \
864 sc_fxtype_params( wl_, iwl_, qm, om ), \
866 sc_fxcast_switch(), \
871sc_fix::sc_fix( tp a, \
872 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
873 sc_fxnum_observer* observer_ ) \
875 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
877 sc_fxcast_switch(), \
882sc_fix::sc_fix( tp a, \
883 const sc_fxcast_switch& cast_sw, \
884 sc_fxnum_observer* observer_ ) \
893sc_fix::sc_fix( tp a, \
895 const sc_fxcast_switch& cast_sw, \
896 sc_fxnum_observer* observer_ ) \
898 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
905sc_fix::sc_fix( tp a, \
906 sc_q_mode qm, sc_o_mode om, \
907 const sc_fxcast_switch& cast_sw, \
908 sc_fxnum_observer* observer_ ) \
910 sc_fxtype_params( a.type_params(), qm, om ), \
917sc_fix::sc_fix( tp a, \
918 sc_q_mode qm, sc_o_mode om, int nb, \
919 const sc_fxcast_switch& cast_sw, \
920 sc_fxnum_observer* observer_ ) \
922 sc_fxtype_params( a.type_params(), qm, om, nb ), \
929sc_fix::sc_fix( tp a, \
930 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
931 const sc_fxcast_switch& cast_sw, \
932 sc_fxnum_observer* observer_ ) \
934 sc_fxtype_params( wl_, iwl_, qm, om ), \
941sc_fix::sc_fix( tp a, \
942 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
943 const sc_fxcast_switch& cast_sw, \
944 sc_fxnum_observer* observer_ ) \
946 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
953sc_fix::sc_fix( tp a, \
954 const sc_fxtype_params& type_params_, \
955 sc_fxnum_observer* observer_ ) \
959 sc_fxcast_switch(), \
964sc_fix::sc_fix( tp a, \
965 const sc_fxtype_params& type_params_, \
966 const sc_fxcast_switch& cast_sw, \
967 sc_fxnum_observer* observer_ ) \
1018 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1020 return sc_fix( c, wl_c, iwl_c );
1031 int iwl_c = c.
iwl();
1032 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1041#define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1044operator op ( const tp1& a, const tp2& b ) \
1046 a.observer_read(); \
1047 b.observer_read(); \
1048 int iwl_a = a.iwl(); \
1049 int iwl_b = b.iwl(); \
1050 int iwl_c = sc_max( iwl_a, iwl_b ); \
1051 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1052 sc_fix c( iwl_c + fwl_c, iwl_c ); \
1053 for( int i = -fwl_c; i < iwl_c; ++ i ) \
1054 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1055 return sc_fix( c, iwl_c + fwl_c, iwl_c ); \
1075#define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1078fnc ( sc_fix& c, const tp1& a, const tp2& b ) \
1080 a.observer_read(); \
1081 b.observer_read(); \
1082 int iwl_c = c.iwl(); \
1083 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1084 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1086 SC_FXNUM_OBSERVER_WRITE_( c ) \
1101#undef DEFN_BIN_FNC_T
1110 sc_fxnum::operator = ( a );
1114#define DEFN_ASN_OP_T(op,tp) \
1117sc_fix::operator op ( tp a ) \
1119 sc_fxnum::operator op( a ); \
1123#define DEFN_ASN_OP_OTHER(op) \
1124DEFN_ASN_OP_T(op,int64) \
1125DEFN_ASN_OP_T(op,uint64) \
1126DEFN_ASN_OP_T(op,const sc_int_base&) \
1127DEFN_ASN_OP_T(op,const sc_uint_base&) \
1128DEFN_ASN_OP_T(op,const sc_signed&) \
1129DEFN_ASN_OP_T(op,const sc_unsigned&)
1131#define DEFN_ASN_OP(op) \
1132DEFN_ASN_OP_T(op,int) \
1133DEFN_ASN_OP_T(op,unsigned int) \
1134DEFN_ASN_OP_T(op,long) \
1135DEFN_ASN_OP_T(op,unsigned long) \
1136DEFN_ASN_OP_T(op,float) \
1137DEFN_ASN_OP_T(op,double) \
1138DEFN_ASN_OP_T(op,const char*) \
1139DEFN_ASN_OP_T(op,const sc_fxval&) \
1140DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1141DEFN_ASN_OP_T(op,const sc_fxnum&) \
1142DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1143DEFN_ASN_OP_OTHER(op)
1156#undef DEFN_ASN_OP_OTHER
1160#define DEFN_ASN_OP_T(op,op2,tp) \
1163sc_fix::operator op ( const tp& b ) \
1165 SC_FXNUM_OBSERVER_READ_( *this ) \
1166 b.observer_read(); \
1167 int iwl_c = iwl(); \
1168 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1169 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1171 SC_FXNUM_OBSERVER_WRITE_( *this ) \
1191 return sc_fxval( sc_fxnum::operator ++ ( 0 ) );
1198 return sc_fxval( sc_fxnum::operator -- ( 0 ) );
1359#define DEFN_CTORS_T_A(tp) \
1361sc_fix_fast::sc_fix_fast( tp a, \
1362 sc_fxnum_fast_observer* observer_ ) \
1363: sc_fxnum_fast( a, \
1364 sc_fxtype_params(), \
1366 sc_fxcast_switch(), \
1371sc_fix_fast::sc_fix_fast( tp a, \
1372 int wl_, int iwl_, \
1373 sc_fxnum_fast_observer* observer_ ) \
1374: sc_fxnum_fast( a, \
1375 sc_fxtype_params( wl_, iwl_ ), \
1377 sc_fxcast_switch(), \
1382sc_fix_fast::sc_fix_fast( tp a, \
1383 sc_q_mode qm, sc_o_mode om, \
1384 sc_fxnum_fast_observer* observer_ ) \
1385: sc_fxnum_fast( a, \
1386 sc_fxtype_params( qm, om ), \
1388 sc_fxcast_switch(), \
1393sc_fix_fast::sc_fix_fast( tp a, \
1394 sc_q_mode qm, sc_o_mode om, int nb, \
1395 sc_fxnum_fast_observer* observer_ ) \
1396: sc_fxnum_fast( a, \
1397 sc_fxtype_params( qm, om, nb ), \
1399 sc_fxcast_switch(), \
1404sc_fix_fast::sc_fix_fast( tp a, \
1405 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1406 sc_fxnum_fast_observer* observer_ ) \
1407: sc_fxnum_fast( a, \
1408 sc_fxtype_params( wl_, iwl_, qm, om ), \
1410 sc_fxcast_switch(), \
1415sc_fix_fast::sc_fix_fast( tp a, \
1416 int wl_, int iwl_, \
1417 sc_q_mode qm, sc_o_mode om, int nb, \
1418 sc_fxnum_fast_observer* observer_ ) \
1419: sc_fxnum_fast( a, \
1420 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1422 sc_fxcast_switch(), \
1427sc_fix_fast::sc_fix_fast( tp a, \
1428 const sc_fxcast_switch& cast_sw, \
1429 sc_fxnum_fast_observer* observer_ ) \
1430: sc_fxnum_fast( a, \
1431 sc_fxtype_params(), \
1438sc_fix_fast::sc_fix_fast( tp a, \
1439 int wl_, int iwl_, \
1440 const sc_fxcast_switch& cast_sw, \
1441 sc_fxnum_fast_observer* observer_ ) \
1442: sc_fxnum_fast( a, \
1443 sc_fxtype_params( wl_, iwl_ ), \
1450sc_fix_fast::sc_fix_fast( tp a, \
1451 sc_q_mode qm, sc_o_mode om, \
1452 const sc_fxcast_switch& cast_sw, \
1453 sc_fxnum_fast_observer* observer_ ) \
1454: sc_fxnum_fast( a, \
1455 sc_fxtype_params( qm, om ), \
1462sc_fix_fast::sc_fix_fast( tp a, \
1463 sc_q_mode qm, sc_o_mode om, int nb, \
1464 const sc_fxcast_switch& cast_sw, \
1465 sc_fxnum_fast_observer* observer_ ) \
1466: sc_fxnum_fast( a, \
1467 sc_fxtype_params( qm, om, nb ), \
1474sc_fix_fast::sc_fix_fast( tp a, \
1475 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1476 const sc_fxcast_switch& cast_sw, \
1477 sc_fxnum_fast_observer* observer_ ) \
1478: sc_fxnum_fast( a, \
1479 sc_fxtype_params( wl_, iwl_, qm, om ), \
1486sc_fix_fast::sc_fix_fast( tp a, \
1487 int wl_, int iwl_, \
1488 sc_q_mode qm, sc_o_mode om, int nb, \
1489 const sc_fxcast_switch& cast_sw, \
1490 sc_fxnum_fast_observer* observer_ ) \
1491: sc_fxnum_fast( a, \
1492 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1499sc_fix_fast::sc_fix_fast( tp a, \
1500 const sc_fxtype_params& type_params_, \
1501 sc_fxnum_fast_observer* observer_ ) \
1502: sc_fxnum_fast( a, \
1505 sc_fxcast_switch(), \
1510sc_fix_fast::sc_fix_fast( tp a, \
1511 const sc_fxtype_params& type_params_, \
1512 const sc_fxcast_switch& cast_sw, \
1513 sc_fxnum_fast_observer* observer_ ) \
1514: sc_fxnum_fast( a, \
1521#define DEFN_CTORS_T_B(tp) \
1523sc_fix_fast::sc_fix_fast( tp a, \
1524 sc_fxnum_fast_observer* observer_ ) \
1525: sc_fxnum_fast( a, \
1528 sc_fxcast_switch(), \
1533sc_fix_fast::sc_fix_fast( tp a, \
1534 int wl_, int iwl_, \
1535 sc_fxnum_fast_observer* observer_ ) \
1536: sc_fxnum_fast( a, \
1537 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1539 sc_fxcast_switch(), \
1544sc_fix_fast::sc_fix_fast( tp a, \
1545 sc_q_mode qm, sc_o_mode om, \
1546 sc_fxnum_fast_observer* observer_ ) \
1547: sc_fxnum_fast( a, \
1548 sc_fxtype_params( a.type_params(), qm, om ), \
1550 sc_fxcast_switch(), \
1555sc_fix_fast::sc_fix_fast( tp a, \
1556 sc_q_mode qm, sc_o_mode om, int nb, \
1557 sc_fxnum_fast_observer* observer_ ) \
1558: sc_fxnum_fast( a, \
1559 sc_fxtype_params( a.type_params(), qm, om, nb ), \
1561 sc_fxcast_switch(), \
1566sc_fix_fast::sc_fix_fast( tp a, \
1567 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1568 sc_fxnum_fast_observer* observer_ ) \
1569: sc_fxnum_fast( a, \
1570 sc_fxtype_params( wl_, iwl_, qm, om ), \
1572 sc_fxcast_switch(), \
1577sc_fix_fast::sc_fix_fast( tp a, \
1578 int wl_, int iwl_, \
1579 sc_q_mode qm, sc_o_mode om, int nb, \
1580 sc_fxnum_fast_observer* observer_ ) \
1581: sc_fxnum_fast( a, \
1582 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1584 sc_fxcast_switch(), \
1589sc_fix_fast::sc_fix_fast( tp a, \
1590 const sc_fxcast_switch& cast_sw, \
1591 sc_fxnum_fast_observer* observer_ ) \
1592: sc_fxnum_fast( a, \
1600sc_fix_fast::sc_fix_fast( tp a, \
1601 int wl_, int iwl_, \
1602 const sc_fxcast_switch& cast_sw, \
1603 sc_fxnum_fast_observer* observer_ ) \
1604: sc_fxnum_fast( a, \
1605 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1612sc_fix_fast::sc_fix_fast( tp a, \
1613 sc_q_mode qm, sc_o_mode om, \
1614 const sc_fxcast_switch& cast_sw, \
1615 sc_fxnum_fast_observer* observer_ ) \
1616: sc_fxnum_fast( a, \
1617 sc_fxtype_params( a.type_params(), qm, om ), \
1624sc_fix_fast::sc_fix_fast( tp a, \
1625 sc_q_mode qm, sc_o_mode om, int nb, \
1626 const sc_fxcast_switch& cast_sw, \
1627 sc_fxnum_fast_observer* observer_ ) \
1628: sc_fxnum_fast( a, \
1629 sc_fxtype_params( a.type_params(), qm, om, nb ), \
1636sc_fix_fast::sc_fix_fast( tp a, \
1637 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1638 const sc_fxcast_switch& cast_sw, \
1639 sc_fxnum_fast_observer* observer_ ) \
1640: sc_fxnum_fast( a, \
1641 sc_fxtype_params( wl_, iwl_, qm, om ), \
1648sc_fix_fast::sc_fix_fast( tp a, \
1649 int wl_, int iwl_, \
1650 sc_q_mode qm, sc_o_mode om, int nb, \
1651 const sc_fxcast_switch& cast_sw, \
1652 sc_fxnum_fast_observer* observer_ ) \
1653: sc_fxnum_fast( a, \
1654 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1661sc_fix_fast::sc_fix_fast( tp a, \
1662 const sc_fxtype_params& type_params_, \
1663 sc_fxnum_fast_observer* observer_ ) \
1664: sc_fxnum_fast( a, \
1667 sc_fxcast_switch(), \
1672sc_fix_fast::sc_fix_fast( tp a, \
1673 const sc_fxtype_params& type_params_, \
1674 const sc_fxcast_switch& cast_sw, \
1675 sc_fxnum_fast_observer* observer_ ) \
1676: sc_fxnum_fast( a, \
1701#undef DEFN_CTORS_T_A
1702#undef DEFN_CTORS_T_B
1726 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1739 int iwl_c = c.
iwl();
1740 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1749#define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1752operator op ( const tp1& a, const tp2& b ) \
1754 a.observer_read(); \
1755 b.observer_read(); \
1756 int iwl_a = a.iwl(); \
1757 int iwl_b = b.iwl(); \
1758 int iwl_c = sc_max( iwl_a, iwl_b ); \
1759 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1760 sc_fix_fast c( iwl_c + fwl_c, iwl_c ); \
1761 for( int i = -fwl_c; i < iwl_c; ++ i ) \
1762 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1763 return sc_fix_fast( c, iwl_c + fwl_c, iwl_c ); \
1775#define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1778fnc ( sc_fix_fast& c, const tp1& a, const tp2& b ) \
1780 a.observer_read(); \
1781 b.observer_read(); \
1782 int iwl_c = c.iwl(); \
1783 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1784 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1786 SC_FXNUM_FAST_OBSERVER_WRITE_( c ) \
1793#undef DEFN_BIN_FNC_T
1802 sc_fxnum_fast::operator = ( a );
1806#define DEFN_ASN_OP_T(op,tp) \
1809sc_fix_fast::operator op ( tp a ) \
1811 sc_fxnum_fast::operator op( a ); \
1815#define DEFN_ASN_OP_OTHER(op) \
1816DEFN_ASN_OP_T(op,int64) \
1817DEFN_ASN_OP_T(op,uint64) \
1818DEFN_ASN_OP_T(op,const sc_int_base&) \
1819DEFN_ASN_OP_T(op,const sc_uint_base&) \
1820DEFN_ASN_OP_T(op,const sc_signed&) \
1821DEFN_ASN_OP_T(op,const sc_unsigned&)
1823#define DEFN_ASN_OP(op) \
1824DEFN_ASN_OP_T(op,int) \
1825DEFN_ASN_OP_T(op,unsigned int) \
1826DEFN_ASN_OP_T(op,long) \
1827DEFN_ASN_OP_T(op,unsigned long) \
1828DEFN_ASN_OP_T(op,float) \
1829DEFN_ASN_OP_T(op,double) \
1830DEFN_ASN_OP_T(op,const char*) \
1831DEFN_ASN_OP_T(op,const sc_fxval&) \
1832DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1833DEFN_ASN_OP_T(op,const sc_fxnum&) \
1834DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1835DEFN_ASN_OP_OTHER(op)
1848#undef DEFN_ASN_OP_OTHER
1852#define DEFN_ASN_OP_T(op,op2,tp) \
1855sc_fix_fast::operator op ( const tp& b ) \
1857 SC_FXNUM_FAST_OBSERVER_READ_( *this ) \
1858 b.observer_read(); \
1859 int iwl_c = iwl(); \
1860 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1861 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1863 SC_FXNUM_FAST_OBSERVER_WRITE_( *this ) \
#define SC_FXNUM_OBSERVER_WRITE_(object)
#define SC_FXNUM_OBSERVER_READ_(object)
#define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
#define SC_FXNUM_FAST_OBSERVER_READ_(object)
#define DECL_CTORS_T_A(tp)
#define DEFN_CTORS_T_B(tp)
#define DECL_CTORS_T_B(tp)
#define DEFN_CTORS_T_A(tp)
#define DEFN_BIN_FNC_T(fnc, op2, tp1, tp2)
#define DEFN_ASN_OP_T(op, tp)
#define DECL_ASN_OP_T(op, tp)
sc_bit b_and(const sc_bit &a, const sc_bit &b)
sc_bit operator&(const sc_bit &a, const sc_bit &b)
sc_bit operator^(const sc_bit &a, const sc_bit &b)
sc_bit b_or(const sc_bit &a, const sc_bit &b)
unsigned long long uint64
sc_bit b_not(const sc_bit &a)
DEFN_BIN_OP_T(/, div, int64) DEFN_BIN_OP_T(/
sc_bit b_xor(const sc_bit &a, const sc_bit &b)
sc_bit operator~(const sc_bit &a)
sc_bit operator|(const sc_bit &a, const sc_bit &b)
friend void b_or(sc_fix &, const sc_fix &, const sc_fix &)
friend void b_xor(sc_fix &, const sc_fix &, const sc_fix &)
friend void b_or(sc_fix &, const sc_fix &, const sc_fix_fast &)
friend void b_and(sc_fix &, const sc_fix &, const sc_fix_fast &)
friend void b_and(sc_fix &, const sc_fix_fast &, const sc_fix &)
friend void b_and(sc_fix &, const sc_fix &, const sc_fix &)
sc_fix & operator=(const sc_fix &)
friend void b_xor(sc_fix &, const sc_fix &, const sc_fix_fast &)
friend void b_xor(sc_fix &, const sc_fix_fast &, const sc_fix &)
friend void b_or(sc_fix &, const sc_fix_fast &, const sc_fix &)
sc_fix(sc_fxnum_observer *=0)
friend void b_or(sc_fix_fast &, const sc_fix_fast &, const sc_fix_fast &)
sc_fix_fast & operator--()
friend void b_and(sc_fix_fast &, const sc_fix_fast &, const sc_fix_fast &)
friend void b_xor(sc_fix_fast &, const sc_fix_fast &, const sc_fix_fast &)
sc_fix_fast operator~() const
sc_fix_fast(sc_fxnum_fast_observer *=0)
sc_fix_fast & operator++()
sc_fix_fast & operator=(const sc_fix_fast &)
sc_fxnum_fast & operator--()
sc_fxnum_fast & operator++()
friend class sc_fxval_fast