1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-13 15:18:14 +00:00

Remove UNSAFE flag. (#134)

This flag was for SunOS 3 and 4 on sun3 hardware (68k).

It enabled some unsafe optimizations via assembler. This hasn't
actually been built since the DOS port (since the header for this
was renamed, but the code in `xc.c` wasn't updated).

The optimizations here made assumptions that were specific to the
68k hardware and register allocation. They aren't likely to be
of much use moving forward, and we've got plenty of safe performance
improvements from the last 30 years of hardware advances.
This commit is contained in:
Bruce Mitchener 2020-12-27 03:53:47 +07:00 committed by GitHub
parent e295a34484
commit 0880b2f3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 9 additions and 227 deletions

View File

@ -27,7 +27,6 @@ sparc True if we're compiling on a SPARC machine.
mc68020 True if we're compiling on a Motorola 680x0 machine.
sun3 We're compiling for a Sun-3.
UNSAFE If true, enables the "fast" version of 68020 opcodes.
NOASM If true, suppress any attempt to include assembler
versions of things in the emulator. In 'lispemul.c',
if this is true, disables:
@ -36,7 +35,6 @@ NOASM If true, suppress any attempt to include assembler
SUN4_OS4_IL
OPDISP
NATIVETRAN
UNSAFE
PROFILE
and enables NOASMFNCALL
C_ONLY

View File

@ -6,7 +6,7 @@ OEXT = .o
OPTFLAGS = -O2
DISPOPTFLAGS = -O
FPFLAGS = -f68881
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DUNSAFE -DSUN3_OS3_IL -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DSUN3_OS3_IL -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il
BITBLTFILE = $(OBJECTDIR)bitblt68K.o

View File

@ -11,7 +11,7 @@ DISPOPTFLAGS = -O
FPFLAGS = -f68881
# DISPLAYBUFFER for Color Sparcstation code testing
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DKBINT -DOPDISP -DUNSAFE -DSUN3_OS3_IL -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DOPDISP -DSUN3_OS3_IL -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -33,7 +33,7 @@ OEXT = .o
OPTFLAGS = -O2
DISPOPTFLAGS = -O
FPFLAGS = -f68881
DFLAGS = -DNEW_STORAGE -DOPDISP -DUNSAFE -DSUN3_OS3_IL -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
DFLAGS = -DNEW_STORAGE -DOPDISP -DSUN3_OS3_IL -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
LDFLAGS = -lX11 -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il
BITBLTFILE = $(OBJECTDIR)bitblt68K.o

View File

@ -10,7 +10,7 @@ FPFLAGS = -f68881
# [I remove DISPLAYBUFFER option .
# You may run 'makeright multi'. -osamu '90/02/07]
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -11,7 +11,7 @@ DISPOPTFLAGS = -O
FPFLAGS = -f68881
# DISPLAYBUFFER for Color Sparcstation code testing
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DDISPLAYBUFFER -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DDISPLAYBUFFER -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -37,7 +37,7 @@ FPFLAGS = -f68881
# [I remove DISPLAYBUFFER option .
# You may run 'makeright x'. -osamu '90/02/27]
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
DFLAGS = -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
LDFLAGS = -lX11 -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -10,7 +10,7 @@ FPFLAGS = -f68881
# [I remove DISPLAYBUFFER option .
# You may run 'makeright multi'. -osamu '90/02/07]
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -11,7 +11,7 @@ DISPOPTFLAGS = -O
FPFLAGS = -f68881
# DISPLAYBUFFER for Color Sparcstation code testing
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DDISPLAYBUFFER -DFORKCOMM -DBIGATOMS
DFLAGS = -DKBINT -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DDISPLAYBUFFER -DNEWBITBLT -DLOGINT -DSUNDISPLAY -DDISPLAYBUFFER -DFORKCOMM -DBIGATOMS
LDFLAGS = -lsuntool -lsunwindow -lpixrect -lc -lm
INLINE = $(SRCDIR)disp68K.il

View File

@ -37,7 +37,7 @@ FPFLAGS = -f68881
# [I remove DISPLAYBUFFER option .
# You may run 'makeright x'. -osamu '90/02/27]
# NEWBITBLT for assembler version of bitblt.
DFLAGS = -DNEW_STORAGE -DOPDISP -DUNSAFE -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
DFLAGS = -DNEW_STORAGE -DOPDISP -DOS4 -DSUN3_OS4_IL -DOS4_TYPE4BUG -DNEWBITBLT -DLOGINT $(XFLAGS) -DFORKCOMM -DBIGATOMS
LDFLAGS = -lX11 -lpixrect -lc -lm
LDELDFLAGS = -Bstatic -lX11 -lpixrect -Bdynamic -lc -lm

View File

@ -1,200 +0,0 @@
/* $Id: inln68k+.h,v 1.2 1999/01/03 02:06:03 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
/************************************************************************/
/* */
/* Copyright 1989, 1990 Venue, Fuji Xerox Co., Ltd, Xerox Corp. */
/* */
/* This file is work-product resulting from the Xerox/Venue */
/* Agreement dated 18-August-1989 for support of Medley. */
/* */
/************************************************************************/
/* These are the Macros Used to generate inline 68K assembly code.
The call inline code which really CHEATS!
BEWARE the inline code makes many register assumptions!
Such as:
D7 = TOPOFSTACK
D5 = 15
A3 = CSTKPTR
*/
#undef DIFFERENCE
#define DIFFERENCE { \
fast_op_difference(POP_TOS_1); \
nextop1; \
diff_err: \
asm("diff_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_difference, GET_POPPED); \
}
#undef IDIFFERENCE
#define IDIFFERENCE { \
fast_op_idifference(POP_TOS_1); \
nextop1; \
idiff_err: \
asm("idiff_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_idifference, GET_POPPED); \
}
#undef IDIFFERENCE_N
#define IDIFFERENCE_N(n) { \
fast_op_idifferencen(n); \
nextop2; \
idiffn_err: \
asm("idiffn_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_CALL_1d(N_OP_idifferencen, n); \
}
#undef PLUS2
#define PLUS2 { \
fast_op_plus(POP_TOS_1); \
nextop1; \
plus_err: \
asm("plus_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_plus2, GET_POPPED); \
}
#undef IPLUS2
#define IPLUS2 { \
fast_op_iplus(POP_TOS_1); \
nextop1; \
iplus_err: \
asm("iplus_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_iplus2, GET_POPPED); \
}
#undef IPLUS_N
#define IPLUS_N(n) { \
fast_op_iplusn(n); \
nextop2; \
iplusn_err: \
asm("iplusn_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_CALL_1d(N_OP_iplusn, n); \
}
#undef GREATERP
#define GREATERP { \
fast_op_greaterp(POP_TOS_1); \
nextop1; \
greaterp_err: \
asm("greaterp_err:"); \
N_OP_POPPED_CALL_2(N_OP_greaterp, GET_POPPED); \
}
#undef IGREATERP
#define IGREATERP { \
fast_op_igreaterp(POP_TOS_1); \
nextop1; \
igreaterp_err: \
asm("igreaterp_err:"); \
N_OP_POPPED_CALL_2(N_OP_igreaterp, GET_POPPED); \
}
#undef LRSH8
#define LRSH8 { \
fast_op_lrsh8(); \
nextop1; \
lrsh8_err: \
asm("lrsh8_err:"); \
N_OP_CALL_1(N_OP_lrsh8); \
}
#undef LRSH1
#define LRSH1 { \
fast_op_lrsh1(); \
nextop1; \
lrsh1_err: \
asm("lrsh1_err:"); \
N_OP_CALL_1(N_OP_lrsh1); \
}
#undef LLSH8
#define LLSH8 { \
fast_op_llsh8(); \
nextop1; \
llsh8_err: \
asm("llsh8_err:"); \
N_OP_CALL_1(N_OP_llsh8); \
}
#undef LLSH1
#define LLSH1 { \
fast_op_llsh1(); \
nextop1; \
llsh1_err: \
asm("llsh1_err:"); \
N_OP_CALL_1(N_OP_llsh1); \
}
#undef LOGOR
#define LOGOR { \
fast_op_logor(POP_TOS_1); \
nextop1; \
logor_err: \
asm("logor_err:"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_logor, GET_POPPED); \
}
#undef LOGAND
#define LOGAND { \
fast_op_logand(POP_TOS_1); \
nextop1; \
logand_err: \
asm("logand_err:"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_logand, GET_POPPED); \
}
#undef LOGXOR
#define LOGXOR { \
fast_op_logxor(POP_TOS_1); \
nextop1; \
logxor_err: \
asm("logxor_err:"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_logxor, GET_POPPED); \
}
#undef N_OP_ADDBASE
#define N_OP_ADDBASE { \
fast_op_addbase(POP_TOS_1); \
nextop1; \
addbase_err: \
asm("addbase_err:"); \
asm("addqb #7,d7"); \
asm("rorl d5,d7"); \
N_OP_POPPED_CALL_2(N_OP_addbase, GET_POPPED); \
}
#undef N_OP_LOLOC
#define N_OP_LOLOC { fast_op_loloc(); nextop1; }
#undef N_OP_HILOC
#define N_OP_HILOC { fast_op_hiloc(); nextop1; }
#undef N_OP_VAG2
#define N_OP_VAG2 { fast_op_vag2(POP_TOS_1); nextop1; }

View File

@ -177,7 +177,6 @@ error Must specify RELEASE to build Medley.
#undef SUN4_OS4_IL
#undef OPDISP
#undef NATIVETRAN
#undef UNSAFE
#undef PROFILE
#define NOASMFNCALL 1
#endif

View File

@ -109,9 +109,6 @@ extern MouseInterface currentmouse;
#ifdef SUN3_OS3_OR_OS4_IL
#include "inln68k.h"
#ifdef UNSAFE
#include "fastinln68k.h"
#endif
#endif
typedef struct conspage ConsPage;
@ -230,10 +227,6 @@ void dispatch(void) {
#endif
#endif
#ifdef UNSAFE
register int Save_D5_shift_amount;
#endif
/* OP_FN_COMMON arguments */
DefCell *fn_defcell;
@ -258,10 +251,6 @@ void dispatch(void) {
table = (InstPtr *)compute_dispatch_table();
#endif
#ifdef UNSAFE
Save_D5_shift_amount = 15;
#endif
#ifdef I386
goto setup_table;
#else
@ -1481,10 +1470,6 @@ setup_table:
#ifndef ISC
SaveD6 = 0;
#ifdef UNSAFE
Save_D5_shift_amount = 15;
#endif
{
int i;
for (i = 0; i < 256; i++) { table[i] = (InstPtr)op_ufn; };