adapted for changed floating point package
authorceriel <none@none>
Mon, 31 Jul 1989 14:54:53 +0000 (14:54 +0000)
committerceriel <none@none>
Mon, 31 Jul 1989 14:54:53 +0000 (14:54 +0000)
mach/mantra/int/Makefile
mach/mantra/int/con_float.c
mach/mantra/int/mloop0
mach/mantra/int/mloop7
mach/mantra/int/mloopa

index 1468106..71ef3cc 100644 (file)
@@ -1,15 +1,17 @@
+EMHOME=../../..
 INTS=em2_t--- em2_---- em2_t-cp em2_t-c- em2_t--p \
 em4_t--- em4_---- em4_t-cp em4_t-c- em4_t--p
 P = mloop
 FILES=deffile $P0 $P1 $P2 $P3 $P4 $P5 $P6 $P7 $P8 $P9 $Pa $Pb $Pc
-CPP=../../../lib/cpp
-b=../../../lib/em
+CPP=$(EMHOME)/lib/cpp
+b=$(EMHOME)/lib/em
+CFLAGS=-I$(EMHOME)/h -O
 FLTRAP=
 
 all:   $(INTS) em
 
 em:    em.c
-       $(CC) -o em -I../../../h em.c
+       $(CC) $(CFLAGS) -o em em.c
 
 tmp.s: $(FILES)
        cat $(FILES) > tmp.s
@@ -46,8 +48,8 @@ em4_t--p:     tmp.s compile con_float.o
 
 con_float.o:   con_float.c
        case `ack_sys` in m68k2|pmds) \
-               acc -mm68k4 -c -L -O con_float.c;; \
-               *) acc -c -L -O con_float.c;; \
+               acc -I$(EMHOME)/mach -mm68k4 -c -L -O con_float.c;; \
+               *) acc -c -I$(EMHOME)/mach -L -O con_float.c;; \
        esac
 
 compile:       Makefile
index f829ad0..155fa4c 100644 (file)
@@ -1,26 +1,13 @@
 /* unfortunately, we cannot just do an atof and convert result to float
-   is neccessary, because that might result in over/underflow at an
+   if neccessary, because that might result in over/underflow at an
    unexpected moment. For the time being, overflow in floating point
    constants goes undetected
 */
-con_float(argval, str, res)
+
+#include <con_float>
+
+con_float(str, argval, res)
        char *str, *res;
 {
-       double f;
-       double atof();
-       int i;
-       double frexp(), ldexp();
-       int j;
-       float fl;
-       char *p;
-
-       f = atof(str);
-       if (f == 0 || argval == 8) {
-               p = (char *) &f;
-               while (argval--) *res++ = *p++;
-               return;
-       }
-       fl = f;
-       p = (char *) &fl;
-       while (argval--) *res++ = *p++;
+       float_cst(str, argval, res);
 }
index 89e9e6a..16641fa 100644 (file)
@@ -188,9 +188,9 @@ dofloat:
                movem.l a0/a1/d0-d2,-(sp)
                move.l  a3,-(sp)
                add.l   d0,a3
+               move.l  d0,-(sp)
                move.l  a4,-(sp)
                move.l  a4,flt_label
-               move.l  d0,-(sp)
                bsr     _con_float
                lea     12(sp),sp
                clr.l   flt_label
index 408dd5e..ad98fb1 100644 (file)
@@ -212,10 +212,14 @@ fif_l:            adroff          ;       move.w  (a5),d0
 #else
                checkfsize
 4:
+               move.l  sp,-(sp)
                jsr     .fif4
+               add.l   #4,sp
                jmp     (a4)
 8:
+               move.l  sp,-(sp)
                jsr     .fif8
+               add.l   #4,sp
                jmp     (a4)
 #endif
 fif_z:
@@ -228,20 +232,16 @@ fef_l:            adroff          ;       move.w  (a5),d0
 #else
                checkfsize
 4:
-               move.l  (sp)+,d0
-               clr.l   -(sp)
-               move.l  d0,-(sp)
+               move.l  sp,-(sp)
+               sub.l   #4,(sp)
                jsr     .fef4
 #ifndef lword
                add.l   #2,sp
 #endif         
                jmp     (a4)
 8:
-               move.l  (sp)+,d0
-               move.l  (sp)+,d1
-               clr.l   -(sp)
-               move.l  d1,-(sp)
-               move.l  d0,-(sp)
+               move.l  sp,-(sp)
+               sub.l   #4,(sp)
                jsr     .fef8
 #ifndef lword
                add.l   #2,sp
index 36bef5c..3ccf918 100644 (file)
@@ -344,7 +344,6 @@ lhalt:
                clr.l   (a1)+           !skip file name
                bra     4b              !only new line
 9:
-               clr.l   -(sp)
        .sect .data
 emlast:        .asciz  "em_last"
 mess1: .asciz  "no line processed yet\n"