* 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
+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>
* haifa-sched.c (rank_for_schedule): Revert 2002-05-02 change,
$(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 \
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 \
$(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 \
}
}
doexp:
- /*
- if (expon >= 0)
- sprintf (ss, "e+%d", expon);
- else
- sprintf (ss, "e%d", expon);
- */
+ /* Strip trailing zeros, but leave at least one. */
+ while (ss[-1] == '0' && ss[-2] != '.')
+ --ss;
sprintf (ss, "e%d", expon);
bxit:
rndprc = rndsav;
#include "hard-reg-set.h"
#include "basic-block.h"
#include "insn-attr.h"
+#include "real.h"
#include "sched-int.h"
#include "target.h"
cur = safe_concat (buf, cur, t);
break;
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);
break;
case CONST_STRING: