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_ufix( tp, \
166 sc_fxnum_observer* = 0 ); \
236#define DECL_ASN_OP_T(op,tp) \
237 sc_ufix& 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_ufix_fast( tp, \
395 sc_fxnum_fast_observer* = 0 ); \
422 sc_ufix_fast(
const sc_ufix_fast& );
432 friend void b_not( sc_ufix_fast&,
const sc_ufix_fast& );
459#define DECL_ASN_OP_T(op,tp) \
460 sc_ufix_fast& operator op ( tp );
462#define DECL_ASN_OP_OTHER(op) \
463 DECL_ASN_OP_T(op,int64) \
464 DECL_ASN_OP_T(op,uint64) \
465 DECL_ASN_OP_T(op,const sc_int_base&) \
466 DECL_ASN_OP_T(op,const sc_uint_base&) \
467 DECL_ASN_OP_T(op,const sc_signed&) \
468 DECL_ASN_OP_T(op,const sc_unsigned&)
470#define DECL_ASN_OP(op) \
471 DECL_ASN_OP_T(op,int) \
472 DECL_ASN_OP_T(op,unsigned int) \
473 DECL_ASN_OP_T(op,long) \
474 DECL_ASN_OP_T(op,unsigned long) \
475 DECL_ASN_OP_T(op,float) \
476 DECL_ASN_OP_T(op,double) \
477 DECL_ASN_OP_T(op,const char*) \
478 DECL_ASN_OP_T(op,const sc_fxval&) \
479 DECL_ASN_OP_T(op,const sc_fxval_fast&) \
480 DECL_ASN_OP_T(op,const sc_fxnum&) \
481 DECL_ASN_OP_T(op,const sc_fxnum_fast&) \
482 DECL_ASN_OP_OTHER(op)
502#undef DECL_ASN_OP_OTHER
508 sc_fxval_fast operator ++ (
int );
509 sc_fxval_fast operator -- (
int );
511 sc_ufix_fast& operator ++ ();
512 sc_ufix_fast& operator -- ();
658#define DEFN_CTORS_T_A(tp) \
660sc_ufix::sc_ufix( tp a, \
661 sc_fxnum_observer* observer_ ) \
663 sc_fxtype_params(), \
665 sc_fxcast_switch(), \
670sc_ufix::sc_ufix( tp a, \
672 sc_fxnum_observer* observer_ ) \
674 sc_fxtype_params( wl_, iwl_ ), \
676 sc_fxcast_switch(), \
681sc_ufix::sc_ufix( tp a, \
682 sc_q_mode qm, sc_o_mode om, \
683 sc_fxnum_observer* observer_ ) \
685 sc_fxtype_params( qm, om ), \
687 sc_fxcast_switch(), \
692sc_ufix::sc_ufix( tp a, \
693 sc_q_mode qm, sc_o_mode om, int nb, \
694 sc_fxnum_observer* observer_ ) \
696 sc_fxtype_params( qm, om, nb ), \
698 sc_fxcast_switch(), \
703sc_ufix::sc_ufix( tp a, \
704 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
705 sc_fxnum_observer* observer_ ) \
707 sc_fxtype_params( wl_, iwl_, qm, om ), \
709 sc_fxcast_switch(), \
714sc_ufix::sc_ufix( tp a, \
715 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
716 sc_fxnum_observer* observer_ ) \
718 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
720 sc_fxcast_switch(), \
725sc_ufix::sc_ufix( tp a, \
726 const sc_fxcast_switch& cast_sw, \
727 sc_fxnum_observer* observer_ ) \
729 sc_fxtype_params(), \
736sc_ufix::sc_ufix( tp a, \
738 const sc_fxcast_switch& cast_sw, \
739 sc_fxnum_observer* observer_ ) \
741 sc_fxtype_params( wl_, iwl_ ), \
748sc_ufix::sc_ufix( tp a, \
749 sc_q_mode qm, sc_o_mode om, \
750 const sc_fxcast_switch& cast_sw, \
751 sc_fxnum_observer* observer_ ) \
753 sc_fxtype_params( qm, om ), \
760sc_ufix::sc_ufix( tp a, \
761 sc_q_mode qm, sc_o_mode om, int nb, \
762 const sc_fxcast_switch& cast_sw, \
763 sc_fxnum_observer* observer_ ) \
765 sc_fxtype_params( qm, om, nb ), \
772sc_ufix::sc_ufix( tp a, \
773 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
774 const sc_fxcast_switch& cast_sw, \
775 sc_fxnum_observer* observer_ ) \
777 sc_fxtype_params( wl_, iwl_, qm, om ), \
784sc_ufix::sc_ufix( tp a, \
785 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
786 const sc_fxcast_switch& cast_sw, \
787 sc_fxnum_observer* observer_ ) \
789 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
796sc_ufix::sc_ufix( tp a, \
797 const sc_fxtype_params& type_params_, \
798 sc_fxnum_observer* observer_ ) \
802 sc_fxcast_switch(), \
807sc_ufix::sc_ufix( tp a, \
808 const sc_fxtype_params& type_params_, \
809 const sc_fxcast_switch& cast_sw, \
810 sc_fxnum_observer* observer_ ) \
818#define DEFN_CTORS_T_B(tp) \
820sc_ufix::sc_ufix( tp a, \
821 sc_fxnum_observer* observer_ ) \
825 sc_fxcast_switch(), \
830sc_ufix::sc_ufix( tp a, \
832 sc_fxnum_observer* observer_ ) \
834 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
836 sc_fxcast_switch(), \
841sc_ufix::sc_ufix( tp a, \
842 sc_q_mode qm, sc_o_mode om, \
843 sc_fxnum_observer* observer_ ) \
845 sc_fxtype_params( a.type_params(), qm, om ), \
847 sc_fxcast_switch(), \
852sc_ufix::sc_ufix( tp a, \
853 sc_q_mode qm, sc_o_mode om, int nb, \
854 sc_fxnum_observer* observer_ ) \
856 sc_fxtype_params( a.type_params(), qm, om, nb ), \
858 sc_fxcast_switch(), \
863sc_ufix::sc_ufix( tp a, \
864 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
865 sc_fxnum_observer* observer_ ) \
867 sc_fxtype_params( wl_, iwl_, qm, om ), \
869 sc_fxcast_switch(), \
874sc_ufix::sc_ufix( tp a, \
875 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
876 sc_fxnum_observer* observer_ ) \
878 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
880 sc_fxcast_switch(), \
885sc_ufix::sc_ufix( tp a, \
886 const sc_fxcast_switch& cast_sw, \
887 sc_fxnum_observer* observer_ ) \
896sc_ufix::sc_ufix( tp a, \
898 const sc_fxcast_switch& cast_sw, \
899 sc_fxnum_observer* observer_ ) \
901 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
908sc_ufix::sc_ufix( tp a, \
909 sc_q_mode qm, sc_o_mode om, \
910 const sc_fxcast_switch& cast_sw, \
911 sc_fxnum_observer* observer_ ) \
913 sc_fxtype_params( a.type_params(), qm, om ), \
920sc_ufix::sc_ufix( tp a, \
921 sc_q_mode qm, sc_o_mode om, int nb, \
922 const sc_fxcast_switch& cast_sw, \
923 sc_fxnum_observer* observer_ ) \
925 sc_fxtype_params( a.type_params(), qm, om, nb ), \
932sc_ufix::sc_ufix( tp a, \
933 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
934 const sc_fxcast_switch& cast_sw, \
935 sc_fxnum_observer* observer_ ) \
937 sc_fxtype_params( wl_, iwl_, qm, om ), \
944sc_ufix::sc_ufix( tp a, \
945 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, int nb, \
946 const sc_fxcast_switch& cast_sw, \
947 sc_fxnum_observer* observer_ ) \
949 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
956sc_ufix::sc_ufix( tp a, \
957 const sc_fxtype_params& type_params_, \
958 sc_fxnum_observer* observer_ ) \
962 sc_fxcast_switch(), \
967sc_ufix::sc_ufix( tp a, \
968 const sc_fxtype_params& type_params_, \
969 const sc_fxcast_switch& cast_sw, \
970 sc_fxnum_observer* observer_ ) \
1021 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1023 return sc_ufix( c, wl_c, iwl_c );
1034 int iwl_c = c.
iwl();
1035 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1044#define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1047operator op ( const tp1& a, const tp2& b ) \
1049 a.observer_read(); \
1050 b.observer_read(); \
1051 int iwl_a = a.iwl(); \
1052 int iwl_b = b.iwl(); \
1053 int iwl_c = sc_max( iwl_a, iwl_b ); \
1054 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1055 sc_ufix c( iwl_c + fwl_c, iwl_c ); \
1056 for( int i = -fwl_c; i < iwl_c; ++ i ) \
1057 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1058 return sc_ufix( c, iwl_c + fwl_c, iwl_c ); \
1078#define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1081fnc ( sc_ufix& c, const tp1& a, const tp2& b ) \
1083 a.observer_read(); \
1084 b.observer_read(); \
1085 int iwl_c = c.iwl(); \
1086 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1087 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1089 SC_FXNUM_OBSERVER_WRITE_( c ) \
1104#undef DEFN_BIN_FNC_T
1113 sc_fxnum::operator = ( a );
1117#define DEFN_ASN_OP_T(op,tp) \
1120sc_ufix::operator op ( tp a ) \
1122 sc_fxnum::operator op( a ); \
1126#define DEFN_ASN_OP_OTHER(op) \
1127DEFN_ASN_OP_T(op,int64) \
1128DEFN_ASN_OP_T(op,uint64) \
1129DEFN_ASN_OP_T(op,const sc_int_base&) \
1130DEFN_ASN_OP_T(op,const sc_uint_base&) \
1131DEFN_ASN_OP_T(op,const sc_signed&) \
1132DEFN_ASN_OP_T(op,const sc_unsigned&)
1134#define DEFN_ASN_OP(op) \
1135DEFN_ASN_OP_T(op,int) \
1136DEFN_ASN_OP_T(op,unsigned int) \
1137DEFN_ASN_OP_T(op,long) \
1138DEFN_ASN_OP_T(op,unsigned long) \
1139DEFN_ASN_OP_T(op,float) \
1140DEFN_ASN_OP_T(op,double) \
1141DEFN_ASN_OP_T(op,const char*) \
1142DEFN_ASN_OP_T(op,const sc_fxval&) \
1143DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1144DEFN_ASN_OP_T(op,const sc_fxnum&) \
1145DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1146DEFN_ASN_OP_OTHER(op)
1159#undef DEFN_ASN_OP_OTHER
1163#define DEFN_ASN_OP_T(op,op2,tp) \
1166sc_ufix::operator op ( const tp& b ) \
1168 SC_FXNUM_OBSERVER_READ_( *this ) \
1169 b.observer_read(); \
1170 int iwl_c = iwl(); \
1171 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1172 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1174 SC_FXNUM_OBSERVER_WRITE_( *this ) \
1194 return sc_fxval( sc_fxnum::operator ++ ( 0 ) );
1201 return sc_fxval( sc_fxnum::operator -- ( 0 ) );
1362#define DEFN_CTORS_T_A(tp) \
1364sc_ufix_fast::sc_ufix_fast( tp a, \
1365 sc_fxnum_fast_observer* observer_ ) \
1366: sc_fxnum_fast( a, \
1367 sc_fxtype_params(), \
1369 sc_fxcast_switch(), \
1374sc_ufix_fast::sc_ufix_fast( tp a, \
1375 int wl_, int iwl_, \
1376 sc_fxnum_fast_observer* observer_ ) \
1377: sc_fxnum_fast( a, \
1378 sc_fxtype_params( wl_, iwl_ ), \
1380 sc_fxcast_switch(), \
1385sc_ufix_fast::sc_ufix_fast( tp a, \
1386 sc_q_mode qm, sc_o_mode om, \
1387 sc_fxnum_fast_observer* observer_ ) \
1388: sc_fxnum_fast( a, \
1389 sc_fxtype_params( qm, om ), \
1391 sc_fxcast_switch(), \
1396sc_ufix_fast::sc_ufix_fast( tp a, \
1397 sc_q_mode qm, sc_o_mode om, int nb, \
1398 sc_fxnum_fast_observer* observer_ ) \
1399: sc_fxnum_fast( a, \
1400 sc_fxtype_params( qm, om, nb ), \
1402 sc_fxcast_switch(), \
1407sc_ufix_fast::sc_ufix_fast( tp a, \
1408 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1409 sc_fxnum_fast_observer* observer_ ) \
1410: sc_fxnum_fast( a, \
1411 sc_fxtype_params( wl_, iwl_, qm, om ), \
1413 sc_fxcast_switch(), \
1418sc_ufix_fast::sc_ufix_fast( tp a, \
1419 int wl_, int iwl_, \
1420 sc_q_mode qm, sc_o_mode om, int nb, \
1421 sc_fxnum_fast_observer* observer_ ) \
1422: sc_fxnum_fast( a, \
1423 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1425 sc_fxcast_switch(), \
1430sc_ufix_fast::sc_ufix_fast( tp a, \
1431 const sc_fxcast_switch& cast_sw, \
1432 sc_fxnum_fast_observer* observer_ ) \
1433: sc_fxnum_fast( a, \
1434 sc_fxtype_params(), \
1441sc_ufix_fast::sc_ufix_fast( tp a, \
1442 int wl_, int iwl_, \
1443 const sc_fxcast_switch& cast_sw, \
1444 sc_fxnum_fast_observer* observer_ ) \
1445: sc_fxnum_fast( a, \
1446 sc_fxtype_params( wl_, iwl_ ), \
1453sc_ufix_fast::sc_ufix_fast( tp a, \
1454 sc_q_mode qm, sc_o_mode om, \
1455 const sc_fxcast_switch& cast_sw, \
1456 sc_fxnum_fast_observer* observer_ ) \
1457: sc_fxnum_fast( a, \
1458 sc_fxtype_params( qm, om ), \
1465sc_ufix_fast::sc_ufix_fast( tp a, \
1466 sc_q_mode qm, sc_o_mode om, int nb, \
1467 const sc_fxcast_switch& cast_sw, \
1468 sc_fxnum_fast_observer* observer_ ) \
1469: sc_fxnum_fast( a, \
1470 sc_fxtype_params( qm, om, nb ), \
1477sc_ufix_fast::sc_ufix_fast( tp a, \
1478 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1479 const sc_fxcast_switch& cast_sw, \
1480 sc_fxnum_fast_observer* observer_ ) \
1481: sc_fxnum_fast( a, \
1482 sc_fxtype_params( wl_, iwl_, qm, om ), \
1489sc_ufix_fast::sc_ufix_fast( tp a, \
1490 int wl_, int iwl_, \
1491 sc_q_mode qm, sc_o_mode om, int nb, \
1492 const sc_fxcast_switch& cast_sw, \
1493 sc_fxnum_fast_observer* observer_ ) \
1494: sc_fxnum_fast( a, \
1495 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1502sc_ufix_fast::sc_ufix_fast( tp a, \
1503 const sc_fxtype_params& type_params_, \
1504 sc_fxnum_fast_observer* observer_ ) \
1505: sc_fxnum_fast( a, \
1508 sc_fxcast_switch(), \
1513sc_ufix_fast::sc_ufix_fast( tp a, \
1514 const sc_fxtype_params& type_params_, \
1515 const sc_fxcast_switch& cast_sw, \
1516 sc_fxnum_fast_observer* observer_ ) \
1517: sc_fxnum_fast( a, \
1524#define DEFN_CTORS_T_B(tp) \
1526sc_ufix_fast::sc_ufix_fast( tp a, \
1527 sc_fxnum_fast_observer* observer_ ) \
1528: sc_fxnum_fast( a, \
1531 sc_fxcast_switch(), \
1536sc_ufix_fast::sc_ufix_fast( tp a, \
1537 int wl_, int iwl_, \
1538 sc_fxnum_fast_observer* observer_ ) \
1539: sc_fxnum_fast( a, \
1540 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1542 sc_fxcast_switch(), \
1547sc_ufix_fast::sc_ufix_fast( tp a, \
1548 sc_q_mode qm, sc_o_mode om, \
1549 sc_fxnum_fast_observer* observer_ ) \
1550: sc_fxnum_fast( a, \
1551 sc_fxtype_params( a.type_params(), qm, om ), \
1553 sc_fxcast_switch(), \
1558sc_ufix_fast::sc_ufix_fast( tp a, \
1559 sc_q_mode qm, sc_o_mode om, int nb, \
1560 sc_fxnum_fast_observer* observer_ ) \
1561: sc_fxnum_fast( a, \
1562 sc_fxtype_params( a.type_params(), qm, om, nb ), \
1564 sc_fxcast_switch(), \
1569sc_ufix_fast::sc_ufix_fast( tp a, \
1570 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1571 sc_fxnum_fast_observer* observer_ ) \
1572: sc_fxnum_fast( a, \
1573 sc_fxtype_params( wl_, iwl_, qm, om ), \
1575 sc_fxcast_switch(), \
1580sc_ufix_fast::sc_ufix_fast( tp a, \
1581 int wl_, int iwl_, \
1582 sc_q_mode qm, sc_o_mode om, int nb, \
1583 sc_fxnum_fast_observer* observer_ ) \
1584: sc_fxnum_fast( a, \
1585 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1587 sc_fxcast_switch(), \
1592sc_ufix_fast::sc_ufix_fast( tp a, \
1593 const sc_fxcast_switch& cast_sw, \
1594 sc_fxnum_fast_observer* observer_ ) \
1595: sc_fxnum_fast( a, \
1603sc_ufix_fast::sc_ufix_fast( tp a, \
1604 int wl_, int iwl_, \
1605 const sc_fxcast_switch& cast_sw, \
1606 sc_fxnum_fast_observer* observer_ ) \
1607: sc_fxnum_fast( a, \
1608 sc_fxtype_params( a.type_params(), wl_, iwl_ ), \
1615sc_ufix_fast::sc_ufix_fast( tp a, \
1616 sc_q_mode qm, sc_o_mode om, \
1617 const sc_fxcast_switch& cast_sw, \
1618 sc_fxnum_fast_observer* observer_ ) \
1619: sc_fxnum_fast( a, \
1620 sc_fxtype_params( a.type_params(), qm, om ), \
1627sc_ufix_fast::sc_ufix_fast( tp a, \
1628 sc_q_mode qm, sc_o_mode om, int nb, \
1629 const sc_fxcast_switch& cast_sw, \
1630 sc_fxnum_fast_observer* observer_ ) \
1631: sc_fxnum_fast( a, \
1632 sc_fxtype_params( a.type_params(), qm, om, nb ), \
1639sc_ufix_fast::sc_ufix_fast( tp a, \
1640 int wl_, int iwl_, sc_q_mode qm, sc_o_mode om, \
1641 const sc_fxcast_switch& cast_sw, \
1642 sc_fxnum_fast_observer* observer_ ) \
1643: sc_fxnum_fast( a, \
1644 sc_fxtype_params( wl_, iwl_, qm, om ), \
1651sc_ufix_fast::sc_ufix_fast( tp a, \
1652 int wl_, int iwl_, \
1653 sc_q_mode qm, sc_o_mode om, int nb, \
1654 const sc_fxcast_switch& cast_sw, \
1655 sc_fxnum_fast_observer* observer_ ) \
1656: sc_fxnum_fast( a, \
1657 sc_fxtype_params( wl_, iwl_, qm, om, nb ), \
1664sc_ufix_fast::sc_ufix_fast( tp a, \
1665 const sc_fxtype_params& type_params_, \
1666 sc_fxnum_fast_observer* observer_ ) \
1667: sc_fxnum_fast( a, \
1670 sc_fxcast_switch(), \
1675sc_ufix_fast::sc_ufix_fast( tp a, \
1676 const sc_fxtype_params& type_params_, \
1677 const sc_fxcast_switch& cast_sw, \
1678 sc_fxnum_fast_observer* observer_ ) \
1679: sc_fxnum_fast( a, \
1704#undef DEFN_CTORS_T_A
1705#undef DEFN_CTORS_T_B
1729 for(
int i = iwl_c - wl_c; i < iwl_c; ++ i )
1742 int iwl_c = c.
iwl();
1743 for(
int i = iwl_c - c.
wl(); i < iwl_c; ++ i )
1752#define DEFN_BIN_OP_T(op,op2,tp1,tp2) \
1755operator op ( const tp1& a, const tp2& b ) \
1757 a.observer_read(); \
1758 b.observer_read(); \
1759 int iwl_a = a.iwl(); \
1760 int iwl_b = b.iwl(); \
1761 int iwl_c = sc_max( iwl_a, iwl_b ); \
1762 int fwl_c = sc_max( a.wl() - iwl_a, b.wl() - iwl_b ); \
1763 sc_ufix_fast c( iwl_c + fwl_c, iwl_c ); \
1764 for( int i = -fwl_c; i < iwl_c; ++ i ) \
1765 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1766 return sc_ufix_fast( c, iwl_c + fwl_c, iwl_c ); \
1778#define DEFN_BIN_FNC_T(fnc,op2,tp1,tp2) \
1781fnc ( sc_ufix_fast& c, const tp1& a, const tp2& b ) \
1783 a.observer_read(); \
1784 b.observer_read(); \
1785 int iwl_c = c.iwl(); \
1786 for( int i = iwl_c - c.wl(); i < iwl_c; ++ i ) \
1787 c.set_bit( i, a.get_bit( i ) op2 b.get_bit( i ) ); \
1789 SC_FXNUM_FAST_OBSERVER_WRITE_( c ) \
1796#undef DEFN_BIN_FNC_T
1805 sc_fxnum_fast::operator = ( a );
1809#define DEFN_ASN_OP_T(op,tp) \
1812sc_ufix_fast::operator op ( tp a ) \
1814 sc_fxnum_fast::operator op( a ); \
1818#define DEFN_ASN_OP_OTHER(op) \
1819DEFN_ASN_OP_T(op,int64) \
1820DEFN_ASN_OP_T(op,uint64) \
1821DEFN_ASN_OP_T(op,const sc_int_base&) \
1822DEFN_ASN_OP_T(op,const sc_uint_base&) \
1823DEFN_ASN_OP_T(op,const sc_signed&) \
1824DEFN_ASN_OP_T(op,const sc_unsigned&)
1826#define DEFN_ASN_OP(op) \
1827DEFN_ASN_OP_T(op,int) \
1828DEFN_ASN_OP_T(op,unsigned int) \
1829DEFN_ASN_OP_T(op,long) \
1830DEFN_ASN_OP_T(op,unsigned long) \
1831DEFN_ASN_OP_T(op,float) \
1832DEFN_ASN_OP_T(op,double) \
1833DEFN_ASN_OP_T(op,const char*) \
1834DEFN_ASN_OP_T(op,const sc_fxval&) \
1835DEFN_ASN_OP_T(op,const sc_fxval_fast&) \
1836DEFN_ASN_OP_T(op,const sc_fxnum&) \
1837DEFN_ASN_OP_T(op,const sc_fxnum_fast&) \
1838DEFN_ASN_OP_OTHER(op)
1851#undef DEFN_ASN_OP_OTHER
1855#define DEFN_ASN_OP_T(op,op2,tp) \
1858sc_ufix_fast::operator op ( const tp& b ) \
1860 SC_FXNUM_FAST_OBSERVER_READ_( *this ) \
1861 b.observer_read(); \
1862 int iwl_c = iwl(); \
1863 for( int i = iwl_c - wl(); i < iwl_c; ++ i ) \
1864 set_bit( i, get_bit( i ) op2 b.get_bit( i ) ); \
1866 SC_FXNUM_FAST_OBSERVER_WRITE_( *this ) \
#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)
#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)
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)
sc_fxnum_fast & operator--()
sc_fxnum_fast & operator++()
friend class sc_fxval_fast
friend void b_xor(sc_ufix &, const sc_ufix_fast &, const sc_ufix &)
friend void b_xor(sc_ufix &, const sc_ufix &, const sc_ufix &)
friend void b_and(sc_ufix &, const sc_ufix &, const sc_ufix &)
friend void b_and(sc_ufix &, const sc_ufix &, const sc_ufix_fast &)
friend void b_and(sc_ufix &, const sc_ufix_fast &, const sc_ufix &)
sc_ufix operator~() const
friend void b_or(sc_ufix &, const sc_ufix_fast &, const sc_ufix &)
sc_ufix & operator=(const sc_ufix &)
friend void b_or(sc_ufix &, const sc_ufix &, const sc_ufix &)
friend void b_xor(sc_ufix &, const sc_ufix &, const sc_ufix_fast &)
friend void b_or(sc_ufix &, const sc_ufix &, const sc_ufix_fast &)
sc_ufix(sc_fxnum_observer *=0)
friend void b_and(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
sc_ufix_fast & operator--()
friend void b_xor(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
sc_ufix_fast(sc_fxnum_fast_observer *=0)
friend void b_or(sc_ufix_fast &, const sc_ufix_fast &, const sc_ufix_fast &)
sc_ufix_fast & operator=(const sc_ufix_fast &)
sc_ufix_fast operator~() const
sc_ufix_fast & operator++()