50#ifndef __SYSTEMC_EXT_DT_FX_SCFX_UTILS_HH__
51#define __SYSTEMC_EXT_DT_FX_SCFX_UTILS_HH__
64#define MSB_STATEMENT(n) if (x >> n) { x >>= n; i += n; }
83#define LSB_STATEMENT(n) if (x << n) { x <<= n; i -= n; }
118 }
else if (*s ==
'-' ) {
137 if ((s[2] ==
'u' || s[2] ==
'U') &&
138 (s[3] ==
's' || s[3] ==
'S')) {
142 if ((s[2] ==
's' || s[2] ==
'S') &&
143 (s[3] ==
'm' || s[3] ==
'M')) {
153 if ((s[2] ==
'u' || s[2] ==
'U') &&
154 (s[3] ==
's' || s[3] ==
'S')) {
158 if ((s[2] ==
's' || s[2] ==
'S') &&
159 (s[3] ==
'm' || s[3] ==
'M')) {
169 if ((s[2] ==
'u' || s[2] ==
'U') &&
170 (s[3] ==
's' || s[3] ==
'S')) {
174 if ((s[2] ==
's' || s[2] ==
'S') &&
175 (s[3] ==
'm' || s[3] ==
'M')) {
191 if ((s[2] ==
's' || s[2] ==
'S') &&
192 (s[3] ==
'd' || s[3] ==
'D')) {
209 const char *s1 = s + 1;
216 case 'B': base = 2; s += 2;
break;
218 case 'O': base = 8; s += 2;
break;
220 case 'D': base = 10; s += 2;
break;
222 case 'X': base = 16; s += 2;
break;
232 while (*
a != 0 && *
b != 0 && *
a == *
b) {
236 return (*
a == 0 && *
b == 0);
254 if (*s ==
'e' || *s ==
'E') {
256 if (*s ==
'+' || *s ==
'-')
271 case '0':
case '1':
case '2':
case '3':
case '4':
272 case '5':
case '6':
case '7':
case '8':
case '9':
302 case '0':
case '1':
case '2':
case '3':
303 case '4':
case '5':
case '6':
case '7':
318 case '0':
case '1':
case '2':
case '3':
case '4':
319 case '5':
case '6':
case '7':
case '8':
case '9':
320 case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
321 case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
334 case '0':
case '1':
case '-':
373 case '0':
case '1':
case '2':
case '3':
case '4':
374 case '5':
case '6':
case '7':
case '8':
case '9':
377 case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
378 to_digit =
c -
'a' + 10;
380 case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
381 to_digit =
c -
'A' + 10;
474 int scale = 1000000000;
476 int digit = exp / scale;
478 if (digit != 0 || !first) {
479 s +=
static_cast<char>(digit +
'0');
bool scfx_is_inf(const char *s)
bool scfx_is_digit(char c, sc_numrep numrep)
void scfx_print_inf(scfx_string &s, bool negative)
int scfx_parse_sign(const char *&s, bool &sign_char)
bool scfx_is_nan(const char *s)
void scfx_print_prefix(scfx_string &s, sc_numrep numrep)
sc_numrep scfx_parse_prefix(const char *&s)
bool scfx_is_equal(const char *a, const char *b)
void scfx_csd2tc(scfx_string &csd)
void scfx_print_exp(scfx_string &s, int exp)
int scfx_find_lsb(unsigned long x)
int scfx_to_digit(char c, sc_numrep numrep)
int scfx_parse_base(const char *&s)
void scfx_print_nan(scfx_string &s)
int scfx_find_msb(unsigned long x)
void scfx_tc2csd(scfx_string &s, int w_prefix)
bool scfx_exp_start(const char *s)
#define LSB_STATEMENT(x, n)
#define MSB_STATEMENT(x, n)