diff --git a/mach/i80/libem/flp.s b/mach/i80/libem/flp.s index 404c8d128..9b9c8df31 100644 --- a/mach/i80/libem/flp.s +++ b/mach/i80/libem/flp.s @@ -1,7 +1,6 @@ .define .adf4,.adf8,.sbf4,.sbf8,.mlf4,.mlf8,.dvf4,.dvf8 .define .ngf4,.ngf8,.fif4,.fif8,.fef4,.fef8 -.define .zrf4,.zrf8 -.define .cfi,.cif,.cuf,.cff,.cfu +.define .cfi,.cif4,.cif8,.cuf4,.cuf8,.cff4,.cff8,.cfu .define .cmf4,.cmf8 .sect .text .sect .rom @@ -25,12 +24,13 @@ .fif8: .fef4: .fef8: -.zrf4: -.zrf8: .cfi: -.cif: -.cuf: -.cff: +.cif4: +.cif8: +.cuf4: +.cuf8: +.cff4: +.cff8: .cfu: .cmf4: .cmf8: diff --git a/mach/i80/ncg/mach.c b/mach/i80/ncg/mach.c index 89d7b0149..e687ec25d 100644 --- a/mach/i80/ncg/mach.c +++ b/mach/i80/ncg/mach.c @@ -41,21 +41,12 @@ con_mult(sz) word sz; { fprintf(codefile,".data4\t%ld\n",atol(str)); } -void -con_float() { - static int warning_given; - int i = argval; - - if (!warning_given) { - fprintf(stderr, "warning: dummy floating point constant\n"); - warning_given = 1; - } - while (i > 0) { - fputs(".data4 0 !dummy float\n", codefile); - i -= 4; - } -} - +#define CODE_GENERATOR +#define IEEEFLOAT +#define FL_MSL_AT_LOW_ADDRESS 0 +#define FL_MSW_AT_LOW_ADDRESS 0 +#define FL_MSB_AT_LOW_ADDRESS 0 +#include void prolog(nlocals) full nlocals; { diff --git a/mach/i80/ncg/table b/mach/i80/ncg/table index e6d7e02f6..465f6ab1b 100644 --- a/mach/i80/ncg/table +++ b/mach/i80/ncg/table @@ -817,61 +817,28 @@ gen mvi a,{const1,0} /* Group 5: Floating point arithmetic */ /********************************************/ -pat adf $1==4 -kills ALL -gen Call {label,".adf4"} - -pat adf $1==8 -kills ALL -gen Call {label,".adf8"} - -pat sbf $1==4 -kills ALL -gen Call {label,".sbf4"} - -pat sbf $1==8 -kills ALL -gen Call {label,".sbf8"} - -pat mlf $1==4 -kills ALL -gen Call {label,".mlf4"} - -pat mlf $1==8 -kills ALL -gen Call {label,".mlf8"} - -pat dvf $1==4 -kills ALL -gen Call {label,".dvf4"} - -pat dvf $1==8 -kills ALL -gen Call {label,".dvf8"} - -pat ngf $1==4 -kills ALL -gen Call {label,".ngf4"} - -pat ngf $1==8 -kills ALL -gen Call {label,".ngf8"} +pat adf $1==4 leaving cal ".adf4" asp 4 +pat adf $1==8 leaving cal ".adf8" asp 8 +pat sbf $1==4 leaving cal ".sbf4" asp 4 +pat sbf $1==8 leaving cal ".sbf8" asp 8 +pat mlf $1==4 leaving cal ".mlf4" asp 4 +pat mlf $1==8 leaving cal ".mlf8" asp 8 +pat dvf $1==4 leaving cal ".dvf4" asp 4 +pat dvf $1==8 leaving cal ".dvf8" asp 8 +pat ngf $1==4 leaving cal ".ngf4" +pat ngf $1==8 leaving cal ".ngf8" pat fif $1==4 -kills ALL -gen Call {label,".fif4"} +leaving lor 1 cal ".fif4" asp 2 pat fif $1==8 -kills ALL -gen Call {label,".fif8"} +leaving lor 1 cal ".fif8" asp 2 pat fef $1==4 -kills ALL -gen Call {label,".fef4"} +leaving lor 1 adp 0-2 cal ".fef4" pat fef $1==8 -kills ALL -gen Call {label,".fef8"} +leaving lor 1 adp 0-2 cal ".fef8" /********************************************/ /* Group 6: Pointer arithmetic */ @@ -964,13 +931,9 @@ pat zre uses hlreg={const2,0} gen shld {label,$1} -pat zrf $1==4 -kills ALL -gen Call {label,".zrf4"} +pat zrf $1==4 leaving zer 4 -pat zrf $1==8 -kills ALL -gen Call {label,".zrf8"} +pat zrf $1==8 leaving zer 8 pat zer $1==2 yields {const2,0} @@ -1086,25 +1049,51 @@ kills ALL gen mvi a,{const1,0} Call {label,".cii"} -pat cfi -kills ALL -gen Call {label,".cfi"} +pat loc loc cfi $2==2 +leaving loc $1 loc $2 cal ".cfi" asp 4+$1 loe ".fra" -pat cif -kills ALL -gen Call {label,".cif"} +pat loc loc cfi $2==4 +leaving loc $1 loc $2 cal ".cfi" asp 4+$1 lfr 4 -pat cuf -kills ALL -gen Call {label,".cuf"} +pat loc loc cif $2==4 +leaving loc $1 cal ".cif4" asp $1-2 -pat cff -kills ALL -gen Call {label,".cff"} +pat loc loc cif $1==2 && $2==8 +with hl_or_de +gen push %1 + push %1 + push %1 leaving loc $1 cal ".cif8" -pat cfu -kills ALL -gen Call {label,".cfu"} +pat loc loc cif $1==4 && $2==8 +with hl_or_de hl_or_de +gen push %2 + push %2 + push %1 leaving loc $1 cal ".cif8" + +pat loc loc cuf $2==4 +leaving loc $1 cal ".cuf4" asp $1-2 + +pat loc loc cuf $1==2 && $2==8 +with hl_or_de +gen push %1 + push %1 + push %1 leaving loc $1 cal ".cuf8" + +pat loc loc cuf $1==4 && $2==8 +with hl_or_de hl_or_de +gen push %1 + push %2 + push %1 leaving loc $1 cal ".cuf8" + +pat loc loc cff $1==8 && $2==4 leaving cal ".cff4" asp 4 + +pat loc loc cff $1==4 && $2==8 leaving dup 4 cal ".cff8" + +pat loc loc cfu $2==2 +leaving loc $1 loc $2 cal ".cfu" asp 4+$1 loe ".fra" + +pat loc loc cfu $2==4 +leaving loc $1 loc $2 cal ".cfu" asp 4+$1 lfr 4 /*****************************************/ /* Group 9: Logical instructions */ @@ -1408,12 +1397,10 @@ gen mvi a,{const1,1} Call {label,".cmi4"} yields de pat cmf $1==4 -kills ALL -gen Call {label,".cmf4"} +leaving cal ".cmf4" asp 8 lfr 2 pat cmf $1==8 -kills ALL -gen Call {label,".cmf8"} +leaving cal ".cmf8" asp 16 lfr 2 pat cmu $1==2 with hl_or_de hl_or_de diff --git a/plat/cpm/descr b/plat/cpm/descr index d084f89ea..eb38c5593 100644 --- a/plat/cpm/descr +++ b/plat/cpm/descr @@ -58,7 +58,7 @@ name led program {EM}/lib/ack/em_led mapflag -l* LNAME={PLATFORMDIR}/lib* mapflag -i SEPID=-b1:0 - mapflag -fp FLOATS={EM}/{ILIB}fp + mapflag -fp FLOATS={PLATFORMDIR}/libfp.a args {ALIGN} {SEPID?} \ ({RTS}:.b=-u _i_main) \ (.e:{HEAD}={PLATFORMDIR}/boot.o) \