From a11f11d0bb551ba33726e19a6a5dde42ebd26c55 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 22 Sep 1989 08:45:36 +0000 Subject: [PATCH] Add new switch `HAS_MODF', and conditionalize "missing.c" to use it. Change makefile to include "missing.o". --- v7/src/microcode/config.h | 15 ++++++++++++++- v7/src/microcode/missing.c | 16 ++++++++++++++-- v7/src/microcode/psbmap.h | 6 +----- v7/src/microcode/unxutl/ymkfile | 6 +++--- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/v7/src/microcode/config.h b/v7/src/microcode/config.h index efafe196d..51272582c 100644 --- a/v7/src/microcode/config.h +++ b/v7/src/microcode/config.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/config.h,v 9.47 1989/09/20 23:07:08 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/config.h,v 9.48 1989/09/22 08:44:46 cph Exp $ Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology @@ -181,6 +181,11 @@ typedef unsigned long SCHEME_OBJECT; HAS_FREXP should be defined if the system has the double precision procedures ldexp and frexp. On Unix, look for frexp(3C). + HAS_MODF should be defined if the system has the double precision + procedure modf. On Unix, look for frexp(3C). **** This flag is + new as of 22-SEP-89; please comment out any incorrect #define's as + we haven't been able to test this on all machines. + */ /* Possible values for FASL_INTERNAL_FORMAT. For the most part this @@ -263,6 +268,7 @@ typedef unsigned long SCHEME_OBJECT; #define MAX_FLONUM_EXPONENT 127 #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF /* Not on these, however */ @@ -330,6 +336,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define MAX_FLONUM_EXPONENT 1023 #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF /* C compiler bug in GC_Type */ #define term_type int #endif @@ -351,6 +358,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define MAX_FLONUM_EXPONENT 1023 #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF /* C Compiler bug when constant folding and anchor pointing */ #define And2(x, y) ((x) ? (y) : false) @@ -389,6 +397,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF #define HAVE_DOUBLE_TO_LONG_BUG #endif /* sun */ @@ -406,6 +415,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define MAX_FLONUM_EXPONENT 127 #include #define HAS_FREXP +#define HAS_MODF #define STACK_SIZE 4 /* 4K objects */ #endif @@ -455,6 +465,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define FLOATING_ALIGNMENT 0x7 /* Low 3 MBZ for float storage */ #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF #ifndef AVOID_SPECTRUM_TC_KLUDGE @@ -494,6 +505,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define MAX_FLONUM_EXPONENT 1023 #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF #endif #ifdef pyr @@ -524,6 +536,7 @@ longjmp(Exit_Point, NORMAL_EXIT) #define MAX_FLONUM_EXPONENT 1023 #define HAS_FLOOR #define HAS_FREXP +#define HAS_MODF #endif #ifdef mips diff --git a/v7/src/microcode/missing.c b/v7/src/microcode/missing.c index e68777111..9ef6b786a 100644 --- a/v7/src/microcode/missing.c +++ b/v7/src/microcode/missing.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.23 1989/09/20 23:10:19 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.24 1989/09/22 08:45:25 cph Exp $ Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology @@ -34,6 +34,8 @@ MIT in each case. */ /* This file contains utilities potentially missing from the math library. */ +#ifndef HAS_FREXP + double frexp (value, eptr) double value; @@ -146,7 +148,11 @@ ldexp (value, exponent) else return (x); } + +#endif /* not HAS_FREXP */ +#ifndef HAS_MODF + double modf (value, iptr) double value; @@ -202,6 +208,10 @@ modf (value, iptr) } } +#endif /* not HAS_MODF */ + +#ifndef HAS_FLOOR + double floor (x) double x; @@ -219,7 +229,9 @@ ceil (x) double fraction = (modf (x, (&iptr))); return ((fraction > 0) ? (iptr + 1) : iptr); } - + +#endif /* not HAS_FLOOR */ + #ifdef DEBUG_MISSING #include diff --git a/v7/src/microcode/psbmap.h b/v7/src/microcode/psbmap.h index 12148a6db..2efc229ff 100644 --- a/v7/src/microcode/psbmap.h +++ b/v7/src/microcode/psbmap.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.29 1989/09/20 23:10:51 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.30 1989/09/22 08:45:36 cph Exp $ Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology @@ -52,11 +52,7 @@ MIT in each case. */ #include "const.h" #include "gccode.h" -#ifdef HAS_FREXP extern double frexp(), ldexp(); -#else -#include "missing.c" -#endif #define PORTABLE_VERSION 5 diff --git a/v7/src/microcode/unxutl/ymkfile b/v7/src/microcode/unxutl/ymkfile index 6a0248ea4..15a440134 100644 --- a/v7/src/microcode/unxutl/ymkfile +++ b/v7/src/microcode/unxutl/ymkfile @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.9 1989/09/20 23:13:36 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.10 1989/09/22 08:45:03 cph Exp $ Copyright (c) 1989 Massachusetts Institute of Technology @@ -243,8 +243,8 @@ CFLAGS = -DMIT_SCHEME C_OPTIMIZE_SWITCH C_DEBUG_SWITCH C_SWITCH_MACHINE C_SWITCH /* Source and object files */ -SCHEME_SOURCES = $(X_SOURCES) $(CTERM_SOURCES) $(GRAPHICS_SOURCES) SOURCES_SYSTEM SOURCES_MACHINE $(USER_PRIM_SOURCES) -SCHEME_OBJECTS = $(X_OBJECTS) $(CTERM_OBJECTS) $(GRAPHICS_OBJECTS) OBJECTS_SYSTEM OBJECTS_MACHINE $(USER_PRIM_OBJECTS) usrdef.o +SCHEME_SOURCES = $(X_SOURCES) $(CTERM_SOURCES) $(GRAPHICS_SOURCES) SOURCES_SYSTEM SOURCES_MACHINE $(USER_PRIM_SOURCES) missing.c +SCHEME_OBJECTS = $(X_OBJECTS) $(CTERM_OBJECTS) $(GRAPHICS_OBJECTS) OBJECTS_SYSTEM OBJECTS_MACHINE $(USER_PRIM_OBJECTS) missing.o usrdef.o SCHEME_LIB = $(USER_LIBS) $(GRAPHICS_LIBS) $(X_LIB) $(CTERM_LIB) LIB_MATH LIBS_SYSTEM LIBS_MACHINE LIB_DEBUG LIB_STANDARD SOURCES = \ -- 2.25.1