Added support for constant floating point expressions

This commit is contained in:
ceriel
1989-12-19 09:40:25 +00:00
parent 4b42dcf97f
commit c3b3faf7a4
13 changed files with 243 additions and 29 deletions

View File

@@ -127,7 +127,13 @@ CodeExpr(nd, ds, true_label, false_label)
switch(nd->nd_symb) {
case REAL:
C_df_dlb(++data_label);
C_rom_fcon(nd->nd_REL, tp->tp_size);
if (! nd->nd_REAL) {
static char buf[FLT_STRLEN];
flt_flt2str(&nd->nd_RVAL, buf, FLT_STRLEN);
C_rom_fcon(buf, tp->tp_size);
}
else C_rom_fcon(nd->nd_REAL, tp->tp_size);
c_lae_dlb(data_label);
C_loi(tp->tp_size);
break;