From c820d77690d5f244ebadd51541c8f94618cd2332 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 10 Jul 1989 16:52:02 +0000 Subject: [PATCH] new floating point constant mechanism --- mach/arm/ncg/Makefile | 4 +- mach/i386/ncg/Makefile | 4 +- mach/i80/ncg/Makefile | 4 +- mach/i86/ncg/Makefile | 4 +- mach/m68020/ncg/Makefile | 4 +- mach/m68020/ncg/mach.c | 149 +-------------------------------------- mach/m68k2/ncg/Makefile | 4 +- mach/m68k2/ncg/mach.c | 149 +-------------------------------------- mach/m68k4/ncg/Makefile | 4 +- mach/m68k4/ncg/mach.c | 149 +-------------------------------------- mach/moon3/ncg/Makefile | 4 +- mach/moon3/ncg/mach.c | 149 +-------------------------------------- mach/ns/ncg/Makefile | 4 +- mach/pdp/ncg/Makefile | 4 +- mach/proto/ncg/Makefile | 4 +- 15 files changed, 30 insertions(+), 610 deletions(-) diff --git a/mach/arm/ncg/Makefile b/mach/arm/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/arm/ncg/Makefile +++ b/mach/arm/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/i386/ncg/Makefile b/mach/i386/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/i386/ncg/Makefile +++ b/mach/i386/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/i80/ncg/Makefile b/mach/i80/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/i80/ncg/Makefile +++ b/mach/i80/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/i86/ncg/Makefile b/mach/i86/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/i86/ncg/Makefile +++ b/mach/i86/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/m68020/ncg/Makefile b/mach/m68020/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/m68020/ncg/Makefile +++ b/mach/m68020/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/m68020/ncg/mach.c b/mach/m68020/ncg/mach.c index 74b19ac78..d289e27b5 100644 --- a/mach/m68020/ncg/mach.c +++ b/mach/m68020/ncg/mach.c @@ -40,153 +40,8 @@ con_mult(sz) word sz; { fprintf(codefile,".data4 %s\n",str); } -#ifdef NOFLOAT -con_float() { - -static int been_here; - if (argval != 4 && argval != 8) - fatal("bad fcon size"); - fputs(".data4\t", codefile); - if (argval == 8) - fputs("0,", codefile); - fputs("0 !dummy float\n", codefile); - if ( !been_here++) - { - fputs("Warning : dummy float-constant(s)\n", stderr); - } -} -#else -#if TBL68881 -#define OWNFLOAT -#else -#define IEEEFLOAT -#endif - -con_float() { - double f; - double atof(); - int i; - int j; - double frexp(); -#ifndef OWNFLOAT - int sign = 0; - int fraction[4] ; -#else OWNFLOAT - float fl; - char *p; -#endif OWNFLOAT - - if (argval!= 4 && argval!= 8) { - fprintf(stderr,"float constant size = %ld\n",argval); - fatal("bad fcon size"); - } - fprintf(codefile,"!float %s sz %ld\n", str, argval); - f = atof(str); - if (f == 0) { - if (argval == 8) fprintf(codefile, ".data2 0, 0\n"); - fprintf(codefile, ".data2 0, 0\n"); - return; - } -#ifdef OWNFLOAT - if (argval == 4) { - /* careful: avoid overflow */ - double ldexp(); - f = frexp(f, &i); - fl = f; - fl = frexp(fl,&j); - if (i+j > 127) { - /* overflow situation */ - fprintf(codefile, ".data1 0%o, 0377, 0377, 0377 ! overflow\n", - f < 0 ? 0377 : 0177); - return; - } - if (i+j < -127) { - /* underflow situation */ - fprintf(codefile, ".data1 0%o, 0200, 0, 0 ! underflow\n", - f < 0 ? 0200 : 0); - return; - } - fl = ldexp(fl, i+j); - p = (char *) &fl; - } - else { - p = (char *) &f; - } - fprintf(codefile, ".data1 0%o", *p++ & 0377); - for (i = argval-1; i; i--) { - fprintf(codefile,",0%o", *p++ & 0377); - } -#else OWNFLOAT - f = frexp(f, &i); - if (f < 0) { - f = -f; - sign = 1; - } - while (f < 0.5) { - f += f; - i --; - } - f = 2*f - 1.0; /* hidden bit */ -#ifdef IEEEFLOAT - if (argval == 4) { -#endif IEEEFLOAT - i = (i + 128) & 0377; - fraction[0] = (sign << 15) | (i << 7); - for (j = 6; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - f -= 1.0; - fraction[0] |= (1 << j); - } - } -#ifdef IEEEFLOAT - } - else { - i = (i + 1024) & 03777; - fraction[0] = (sign << 15) | (i << 4); - for (j = 3; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[0] |= (1 << j); - f -= 1.0; - } - } - } -#endif IEEEFLOAT - for (i = 1; i < argval / 2; i++) { - fraction[i] = 0; - for (j = 15; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[i] |= (1 << j); - f -= 1.0; - } - } - } - if (f >= 0.5) { - for (i = argval/2 - 1; i >= 0; i--) { - for (j = 0; j < 16; j++) { - if (fraction[i] & (1 << j)) { - fraction[i] &= ~(1 << j); - } - else { - fraction[i] |= (1 << j); - break; - } - } - if (j != 16) break; - } - } - for (i = 0; i < argval/2; i++) { - fprintf(codefile, - i != 0 ? ", 0%o, 0%o" : ".data1 0%o, 0%o", - (fraction[i]>>8)&0377, - fraction[i]&0377); - } -#endif OWNFLOAT - putc('\n', codefile); -} -#endif +#define ACKFLOAT 1 +#include regscore(off,size,typ,score,totyp) long off; diff --git a/mach/m68k2/ncg/Makefile b/mach/m68k2/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/m68k2/ncg/Makefile +++ b/mach/m68k2/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/m68k2/ncg/mach.c b/mach/m68k2/ncg/mach.c index 74b19ac78..d289e27b5 100644 --- a/mach/m68k2/ncg/mach.c +++ b/mach/m68k2/ncg/mach.c @@ -40,153 +40,8 @@ con_mult(sz) word sz; { fprintf(codefile,".data4 %s\n",str); } -#ifdef NOFLOAT -con_float() { - -static int been_here; - if (argval != 4 && argval != 8) - fatal("bad fcon size"); - fputs(".data4\t", codefile); - if (argval == 8) - fputs("0,", codefile); - fputs("0 !dummy float\n", codefile); - if ( !been_here++) - { - fputs("Warning : dummy float-constant(s)\n", stderr); - } -} -#else -#if TBL68881 -#define OWNFLOAT -#else -#define IEEEFLOAT -#endif - -con_float() { - double f; - double atof(); - int i; - int j; - double frexp(); -#ifndef OWNFLOAT - int sign = 0; - int fraction[4] ; -#else OWNFLOAT - float fl; - char *p; -#endif OWNFLOAT - - if (argval!= 4 && argval!= 8) { - fprintf(stderr,"float constant size = %ld\n",argval); - fatal("bad fcon size"); - } - fprintf(codefile,"!float %s sz %ld\n", str, argval); - f = atof(str); - if (f == 0) { - if (argval == 8) fprintf(codefile, ".data2 0, 0\n"); - fprintf(codefile, ".data2 0, 0\n"); - return; - } -#ifdef OWNFLOAT - if (argval == 4) { - /* careful: avoid overflow */ - double ldexp(); - f = frexp(f, &i); - fl = f; - fl = frexp(fl,&j); - if (i+j > 127) { - /* overflow situation */ - fprintf(codefile, ".data1 0%o, 0377, 0377, 0377 ! overflow\n", - f < 0 ? 0377 : 0177); - return; - } - if (i+j < -127) { - /* underflow situation */ - fprintf(codefile, ".data1 0%o, 0200, 0, 0 ! underflow\n", - f < 0 ? 0200 : 0); - return; - } - fl = ldexp(fl, i+j); - p = (char *) &fl; - } - else { - p = (char *) &f; - } - fprintf(codefile, ".data1 0%o", *p++ & 0377); - for (i = argval-1; i; i--) { - fprintf(codefile,",0%o", *p++ & 0377); - } -#else OWNFLOAT - f = frexp(f, &i); - if (f < 0) { - f = -f; - sign = 1; - } - while (f < 0.5) { - f += f; - i --; - } - f = 2*f - 1.0; /* hidden bit */ -#ifdef IEEEFLOAT - if (argval == 4) { -#endif IEEEFLOAT - i = (i + 128) & 0377; - fraction[0] = (sign << 15) | (i << 7); - for (j = 6; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - f -= 1.0; - fraction[0] |= (1 << j); - } - } -#ifdef IEEEFLOAT - } - else { - i = (i + 1024) & 03777; - fraction[0] = (sign << 15) | (i << 4); - for (j = 3; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[0] |= (1 << j); - f -= 1.0; - } - } - } -#endif IEEEFLOAT - for (i = 1; i < argval / 2; i++) { - fraction[i] = 0; - for (j = 15; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[i] |= (1 << j); - f -= 1.0; - } - } - } - if (f >= 0.5) { - for (i = argval/2 - 1; i >= 0; i--) { - for (j = 0; j < 16; j++) { - if (fraction[i] & (1 << j)) { - fraction[i] &= ~(1 << j); - } - else { - fraction[i] |= (1 << j); - break; - } - } - if (j != 16) break; - } - } - for (i = 0; i < argval/2; i++) { - fprintf(codefile, - i != 0 ? ", 0%o, 0%o" : ".data1 0%o, 0%o", - (fraction[i]>>8)&0377, - fraction[i]&0377); - } -#endif OWNFLOAT - putc('\n', codefile); -} -#endif +#define ACKFLOAT 1 +#include regscore(off,size,typ,score,totyp) long off; diff --git a/mach/m68k4/ncg/Makefile b/mach/m68k4/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/m68k4/ncg/Makefile +++ b/mach/m68k4/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/m68k4/ncg/mach.c b/mach/m68k4/ncg/mach.c index 74b19ac78..d289e27b5 100644 --- a/mach/m68k4/ncg/mach.c +++ b/mach/m68k4/ncg/mach.c @@ -40,153 +40,8 @@ con_mult(sz) word sz; { fprintf(codefile,".data4 %s\n",str); } -#ifdef NOFLOAT -con_float() { - -static int been_here; - if (argval != 4 && argval != 8) - fatal("bad fcon size"); - fputs(".data4\t", codefile); - if (argval == 8) - fputs("0,", codefile); - fputs("0 !dummy float\n", codefile); - if ( !been_here++) - { - fputs("Warning : dummy float-constant(s)\n", stderr); - } -} -#else -#if TBL68881 -#define OWNFLOAT -#else -#define IEEEFLOAT -#endif - -con_float() { - double f; - double atof(); - int i; - int j; - double frexp(); -#ifndef OWNFLOAT - int sign = 0; - int fraction[4] ; -#else OWNFLOAT - float fl; - char *p; -#endif OWNFLOAT - - if (argval!= 4 && argval!= 8) { - fprintf(stderr,"float constant size = %ld\n",argval); - fatal("bad fcon size"); - } - fprintf(codefile,"!float %s sz %ld\n", str, argval); - f = atof(str); - if (f == 0) { - if (argval == 8) fprintf(codefile, ".data2 0, 0\n"); - fprintf(codefile, ".data2 0, 0\n"); - return; - } -#ifdef OWNFLOAT - if (argval == 4) { - /* careful: avoid overflow */ - double ldexp(); - f = frexp(f, &i); - fl = f; - fl = frexp(fl,&j); - if (i+j > 127) { - /* overflow situation */ - fprintf(codefile, ".data1 0%o, 0377, 0377, 0377 ! overflow\n", - f < 0 ? 0377 : 0177); - return; - } - if (i+j < -127) { - /* underflow situation */ - fprintf(codefile, ".data1 0%o, 0200, 0, 0 ! underflow\n", - f < 0 ? 0200 : 0); - return; - } - fl = ldexp(fl, i+j); - p = (char *) &fl; - } - else { - p = (char *) &f; - } - fprintf(codefile, ".data1 0%o", *p++ & 0377); - for (i = argval-1; i; i--) { - fprintf(codefile,",0%o", *p++ & 0377); - } -#else OWNFLOAT - f = frexp(f, &i); - if (f < 0) { - f = -f; - sign = 1; - } - while (f < 0.5) { - f += f; - i --; - } - f = 2*f - 1.0; /* hidden bit */ -#ifdef IEEEFLOAT - if (argval == 4) { -#endif IEEEFLOAT - i = (i + 128) & 0377; - fraction[0] = (sign << 15) | (i << 7); - for (j = 6; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - f -= 1.0; - fraction[0] |= (1 << j); - } - } -#ifdef IEEEFLOAT - } - else { - i = (i + 1024) & 03777; - fraction[0] = (sign << 15) | (i << 4); - for (j = 3; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[0] |= (1 << j); - f -= 1.0; - } - } - } -#endif IEEEFLOAT - for (i = 1; i < argval / 2; i++) { - fraction[i] = 0; - for (j = 15; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[i] |= (1 << j); - f -= 1.0; - } - } - } - if (f >= 0.5) { - for (i = argval/2 - 1; i >= 0; i--) { - for (j = 0; j < 16; j++) { - if (fraction[i] & (1 << j)) { - fraction[i] &= ~(1 << j); - } - else { - fraction[i] |= (1 << j); - break; - } - } - if (j != 16) break; - } - } - for (i = 0; i < argval/2; i++) { - fprintf(codefile, - i != 0 ? ", 0%o, 0%o" : ".data1 0%o, 0%o", - (fraction[i]>>8)&0377, - fraction[i]&0377); - } -#endif OWNFLOAT - putc('\n', codefile); -} -#endif +#define ACKFLOAT 1 +#include regscore(off,size,typ,score,totyp) long off; diff --git a/mach/moon3/ncg/Makefile b/mach/moon3/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/moon3/ncg/Makefile +++ b/mach/moon3/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/moon3/ncg/mach.c b/mach/moon3/ncg/mach.c index 74b19ac78..d289e27b5 100644 --- a/mach/moon3/ncg/mach.c +++ b/mach/moon3/ncg/mach.c @@ -40,153 +40,8 @@ con_mult(sz) word sz; { fprintf(codefile,".data4 %s\n",str); } -#ifdef NOFLOAT -con_float() { - -static int been_here; - if (argval != 4 && argval != 8) - fatal("bad fcon size"); - fputs(".data4\t", codefile); - if (argval == 8) - fputs("0,", codefile); - fputs("0 !dummy float\n", codefile); - if ( !been_here++) - { - fputs("Warning : dummy float-constant(s)\n", stderr); - } -} -#else -#if TBL68881 -#define OWNFLOAT -#else -#define IEEEFLOAT -#endif - -con_float() { - double f; - double atof(); - int i; - int j; - double frexp(); -#ifndef OWNFLOAT - int sign = 0; - int fraction[4] ; -#else OWNFLOAT - float fl; - char *p; -#endif OWNFLOAT - - if (argval!= 4 && argval!= 8) { - fprintf(stderr,"float constant size = %ld\n",argval); - fatal("bad fcon size"); - } - fprintf(codefile,"!float %s sz %ld\n", str, argval); - f = atof(str); - if (f == 0) { - if (argval == 8) fprintf(codefile, ".data2 0, 0\n"); - fprintf(codefile, ".data2 0, 0\n"); - return; - } -#ifdef OWNFLOAT - if (argval == 4) { - /* careful: avoid overflow */ - double ldexp(); - f = frexp(f, &i); - fl = f; - fl = frexp(fl,&j); - if (i+j > 127) { - /* overflow situation */ - fprintf(codefile, ".data1 0%o, 0377, 0377, 0377 ! overflow\n", - f < 0 ? 0377 : 0177); - return; - } - if (i+j < -127) { - /* underflow situation */ - fprintf(codefile, ".data1 0%o, 0200, 0, 0 ! underflow\n", - f < 0 ? 0200 : 0); - return; - } - fl = ldexp(fl, i+j); - p = (char *) &fl; - } - else { - p = (char *) &f; - } - fprintf(codefile, ".data1 0%o", *p++ & 0377); - for (i = argval-1; i; i--) { - fprintf(codefile,",0%o", *p++ & 0377); - } -#else OWNFLOAT - f = frexp(f, &i); - if (f < 0) { - f = -f; - sign = 1; - } - while (f < 0.5) { - f += f; - i --; - } - f = 2*f - 1.0; /* hidden bit */ -#ifdef IEEEFLOAT - if (argval == 4) { -#endif IEEEFLOAT - i = (i + 128) & 0377; - fraction[0] = (sign << 15) | (i << 7); - for (j = 6; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - f -= 1.0; - fraction[0] |= (1 << j); - } - } -#ifdef IEEEFLOAT - } - else { - i = (i + 1024) & 03777; - fraction[0] = (sign << 15) | (i << 4); - for (j = 3; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[0] |= (1 << j); - f -= 1.0; - } - } - } -#endif IEEEFLOAT - for (i = 1; i < argval / 2; i++) { - fraction[i] = 0; - for (j = 15; j>= 0; j--) { - f *= 2; - if (f >= 1.0) { - fraction[i] |= (1 << j); - f -= 1.0; - } - } - } - if (f >= 0.5) { - for (i = argval/2 - 1; i >= 0; i--) { - for (j = 0; j < 16; j++) { - if (fraction[i] & (1 << j)) { - fraction[i] &= ~(1 << j); - } - else { - fraction[i] |= (1 << j); - break; - } - } - if (j != 16) break; - } - } - for (i = 0; i < argval/2; i++) { - fprintf(codefile, - i != 0 ? ", 0%o, 0%o" : ".data1 0%o, 0%o", - (fraction[i]>>8)&0377, - fraction[i]&0377); - } -#endif OWNFLOAT - putc('\n', codefile); -} -#endif +#define ACKFLOAT 1 +#include regscore(off,size,typ,score,totyp) long off; diff --git a/mach/ns/ncg/Makefile b/mach/ns/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/ns/ncg/Makefile +++ b/mach/ns/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/pdp/ncg/Makefile b/mach/pdp/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/pdp/ncg/Makefile +++ b/mach/pdp/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \ diff --git a/mach/proto/ncg/Makefile b/mach/proto/ncg/Makefile index 05e2f3742..6e4717280 100644 --- a/mach/proto/ncg/Makefile +++ b/mach/proto/ncg/Makefile @@ -6,12 +6,12 @@ TABLEFLAGS= #cgg options CGGFLAGS= -PREFLAGS=-I$(EMHOME)/h -I. -DNDEBUG +PREFLAGS=-I$(EMHOME)/h -I. -I$(EMHOME)/mach -I$(EMHOME)/modules/h -DNDEBUG PFLAGS= CFLAGS=$(PREFLAGS) $(PFLAGS) -O LDFLAGS=-i $(PFLAGS) LINTOPTS=-bx -LIBS=$(EMHOME)/lib/em_data.a +LIBS=$(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libflt.a CDIR=$(EMHOME)/mach/proto/ncg CGG=$(EMHOME)/lib/ncgg CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \