(print_node{,_brief}): Use REAL_VALUE_TO_DECIMAL to print REAL_CST

ifdef REAL_ARITHMETIC.

From-SVN: r7916
This commit is contained in:
Richard Kenner 1994-08-14 09:51:43 -04:00
parent 066aca280f
commit 86b38416af

View File

@ -144,8 +144,22 @@ print_node_brief (file, prefix, node, indent)
} }
if (TREE_CODE (node) == REAL_CST) if (TREE_CODE (node) == REAL_CST)
{ {
#ifndef REAL_IS_NOT_DOUBLE REAL_VALUE_TYPE d = TREE_REAL_CST (node);
fprintf (file, " %e", TREE_REAL_CST (node)); if (TREE_OVERFLOW (node))
fprintf (file, " overflow");
#if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
if (REAL_VALUE_ISINF (d))
fprintf (file, " Inf");
else if (REAL_VALUE_ISNAN (d))
fprintf (file, " Nan");
else
{
char string[100];
REAL_VALUE_TO_DECIMAL (d, "%e", string);
fprintf (file, " %s", string);
}
#else #else
{ {
int i; int i;
@ -155,7 +169,7 @@ print_node_brief (file, prefix, node, indent)
fprintf (file, "%02x", *p++); fprintf (file, "%02x", *p++);
fprintf (file, ""); fprintf (file, "");
} }
#endif /* REAL_IS_NOT_DOUBLE */ #endif
} }
fprintf (file, ">"); fprintf (file, ">");
@ -605,17 +619,34 @@ print_node (file, prefix, node, indent)
break; break;
case REAL_CST: case REAL_CST:
#ifndef REAL_IS_NOT_DOUBLE
fprintf (file, " %e", TREE_REAL_CST (node));
#else
{ {
char *p = (char *) &TREE_REAL_CST (node); REAL_VALUE_TYPE d = TREE_REAL_CST (node);
fprintf (file, " 0x"); if (TREE_OVERFLOW (node))
for (i = 0; i < sizeof TREE_REAL_CST (node); i++) fprintf (file, " overflow");
fprintf (file, "%02x", *p++);
fprintf (file, ""); #if !defined(REAL_IS_NOT_DOUBLE) || defined(REAL_ARITHMETIC)
if (REAL_VALUE_ISINF (d))
fprintf (file, " Inf");
else if (REAL_VALUE_ISNAN (d))
fprintf (file, " Nan");
else
{
char string[100];
REAL_VALUE_TO_DECIMAL (d, "%e", string);
fprintf (file, " %s", string);
}
#else
{
int i;
unsigned char *p = (unsigned char *) &TREE_REAL_CST (node);
fprintf (file, " 0x");
for (i = 0; i < sizeof TREE_REAL_CST (node); i++)
fprintf (file, "%02x", *p++);
fprintf (file, "");
}
#endif
} }
#endif /* REAL_IS_NOT_DOUBLE */
break; break;
case COMPLEX_CST: case COMPLEX_CST: