Commit b3ae1ccd by Richard Henderson Committed by Richard Henderson

real.c (etoasc): Strip most trailing zeros for clarity.

        * real.c (etoasc): Strip most trailing zeros for clarity.
        * sched-vis.c: Include real.h.
        (print_value): Use REAL_VALUE_TO_DECIMAL as needed.
        * Makefile.in (sched-vis.o): Add real.h.

From-SVN: r53137
parent 8f39865a
2002-05-03 Richard Henderson <rth@redhat.com>
* real.c (etoasc): Strip most trailing zeros for clarity.
* sched-vis.c: Include real.h.
(print_value): Use REAL_VALUE_TO_DECIMAL as needed.
* Makefile.in (sched-vis.o): Add real.h.
2002-05-03 David S. Miller <davem@redhat.com> 2002-05-03 David S. Miller <davem@redhat.com>
* haifa-sched.c (rank_for_schedule): Revert 2002-05-02 change, * haifa-sched.c (rank_for_schedule): Revert 2002-05-02 change,
......
...@@ -1599,7 +1599,7 @@ sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \ ...@@ -1599,7 +1599,7 @@ sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \ sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \ hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \
$(TARGET_H) $(TARGET_H) real.h
final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \ final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \ $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \ real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \
......
...@@ -5004,12 +5004,9 @@ etoasc (x, string, ndigs) ...@@ -5004,12 +5004,9 @@ etoasc (x, string, ndigs)
} }
} }
doexp: doexp:
/* /* Strip trailing zeros, but leave at least one. */
if (expon >= 0) while (ss[-1] == '0' && ss[-2] != '.')
sprintf (ss, "e+%d", expon); --ss;
else
sprintf (ss, "e%d", expon);
*/
sprintf (ss, "e%d", expon); sprintf (ss, "e%d", expon);
bxit: bxit:
rndprc = rndsav; rndprc = rndsav;
......
...@@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "hard-reg-set.h" #include "hard-reg-set.h"
#include "basic-block.h" #include "basic-block.h"
#include "insn-attr.h" #include "insn-attr.h"
#include "real.h"
#include "sched-int.h" #include "sched-int.h"
#include "target.h" #include "target.h"
...@@ -560,7 +561,15 @@ print_value (buf, x, verbose) ...@@ -560,7 +561,15 @@ print_value (buf, x, verbose)
cur = safe_concat (buf, cur, t); cur = safe_concat (buf, cur, t);
break; break;
case CONST_DOUBLE: case CONST_DOUBLE:
sprintf (t, "<0x%lx,0x%lx>", (long) XWINT (x, 2), (long) XWINT (x, 3)); if (FLOAT_MODE_P (GET_MODE (x)))
{
REAL_VALUE_TYPE r;
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
REAL_VALUE_TO_DECIMAL(r, "%.6e", t);
}
else
sprintf (t, "<0x%lx,0x%lx>", (long) XWINT (x, 2), (long) XWINT (x, 3));
cur = safe_concat (buf, cur, t); cur = safe_concat (buf, cur, t);
break; break;
case CONST_STRING: case CONST_STRING:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment