From f42671022f0b103249711a5ce39ac2bd2b82f599 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Sat, 29 May 2021 17:32:32 -0700 Subject: [PATCH] Remove outdated hand-optimized assembler support for gcc on 386 (#379) --- src/dsk.c | 3 - src/fvar.c | 3 - src/gc2.c | 3 - src/gcmain3.c | 201 ------------------------------------------------- src/inet.c | 3 - src/ldsout.c | 3 - src/mvs.c | 3 - src/vmemsave.c | 3 - src/xc.c | 7 +- 9 files changed, 1 insertion(+), 228 deletions(-) diff --git a/src/dsk.c b/src/dsk.c index d483429..4d3f82d 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -53,9 +53,6 @@ #include "commondefs.h" #include "ufsdefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif /* GCC386 */ extern int *Lisp_errno; extern int Dummy_errno; diff --git a/src/fvar.c b/src/fvar.c index 6d8f064..1f30ea7 100644 --- a/src/fvar.c +++ b/src/fvar.c @@ -24,9 +24,6 @@ #include "commondefs.h" #include "gchtfinddefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif #define MaskShift(x) (((x) << 16) & SEGMASK) diff --git a/src/gc2.c b/src/gc2.c index f0601fa..cb42167 100644 --- a/src/gc2.c +++ b/src/gc2.c @@ -34,9 +34,6 @@ #include "gc2defs.h" #include "gcscandefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif /* GCC386 */ /**********************************************************************/ /* diff --git a/src/gcmain3.c b/src/gcmain3.c index dc6a9cc..6968def 100644 --- a/src/gcmain3.c +++ b/src/gcmain3.c @@ -52,9 +52,6 @@ #include "gcrcelldefs.h" #include "gcscandefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif #define WORDSPERCELL 2 #define MAXHTCNT 63 @@ -99,203 +96,6 @@ #define STKREFBIT 0x200 #endif /* BIGVM */ -#ifdef GCC386 -/* byte-swapped, 386 assembler version */ -LispPTR gcmapscan() { - volatile DLword probe; - volatile DLword *entry; - volatile DLword offset; - volatile LispPTR ptr; - - asm volatile( - " \n\ - movl $32768,%%edi / probe = HTSIZE. \n\ - .align 4 \n\ -nextentry: / nextentry: \n\ - decl %%edi \n\ - js returNIL \n\ - leal 0(,%%edi,2),%%esi \n\ - addl HTmain,%%esi /htlptr = (struct htlinkptr *)(HTmain+probe); \n\ - .align 4 \n\ -scanloop: \n\ - movl %%esi,%%edx \n\ - xorb $2,%%dl \n\ - movzwl (%%edx),%%eax / contents = ((struct htlinkptr *)WORDPTR(htlptr))->contents \n\ - testl %%eax,%%eax / if (contents && \n\ - je scanbot \n\ - testb $1,%%al \n\ - jne scanok \n\ - testb $254,%%ah \n\ - jne scanbot \n\ -scanok: \n\ - jmp scandone \n\ - .align 4 \n\ -scanbot: \n\ - addl $-2,%%esi / end of while loop. \n\ - decl %%edi \n\ - jns scanloop \n\ - jmp returNIL \n\ - \n\ - \n\ -scandone: \n\ - movl %%edx,%0 / entry = (DLword *) HTmain + probe. \n\ -retry: / retry: \n\ - movl %0,%%ecx \n\ - movzwl (%%ecx),%%eax \n\ - testb $1,%%al / if HENTRY->collision, \n\ - je nocollision \n\ - xorl %%esi,%%esi / prev = 0 \n\ - andl $65534,%%eax \n\ -linkloop: // linkloop: \n\ - leal 0(,%%eax,2),%%ecx \n\ - addl HTcoll,%%ecx \n\ - movw 2(%%ecx),%%ax / offset = ((struct htcoll *)link)->free_ptr; \n\ - testb $254,%%ah / if StkCountIsZero(offset) \n\ - jne stknz \n\ - sall $15,%%eax / , (probe << 1)); \n\ - andl $16711680,%%eax \n\ - leal 0(,%%edi,2),%%edx \n\ - orl %%eax,%%edx \n\ - movl %%edx,%2 / to ptr. \n\ - testl %%esi,%%esi / DelLink. if (prev != 0) \n\ - je prevZ \n\ - leal 2(%%esi),%%edx / GETWORD((DLword *)prev + 1) = GETWORD((DLword *)link + 1) \n\ - xorb $2,%%dl \n\ - leal 2(%%ecx),%%eax \n\ - xorb $2,%%al \n\ - movw (%%eax),%%ax \n\ - jmp freelink \n\ - .align 4 \n\ -prevZ: \n\ - movl %0,%%edx / else GETWORD((DLword *)entry) = GETWORD((DLword *)link + 1) \n\ - leal 2(%%ecx),%%eax \n\ - xorb $2,%%al \n\ - movw (%%eax),%%ax \n\ - orb $1,%%al \n\ -freelink: / FreeLink \n\ - movw %%ax,(%%edx) \n\ - movl %%ecx,%%eax \n\ - xorb $2,%%al \n\ - movw $0,(%%eax) \n\ - leal 2(%%ecx),%%eax \n\ - xorb $2,%%al \n\ - movl HTcoll,%%edx / GETWORD(link+1) = GETWORD(HTcoll); \n\ - xorb $2,%%dl \n\ - movw (%%edx),%%dx \n\ - movw %%dx,(%%eax) \n\ - movl HTcoll,%%edx / GETWORD(HTcoll) = (link - HTcoll); \n\ - xorb $2,%%dl \n\ - movl %%ecx,%%eax \n\ - subl HTcoll,%%eax \n\ - sarl $1,%%eax \n\ - movw %%ax,(%%edx) \n\ - movl %0,%%esi / link = (DLword *)HTcoll + GetLinkptr(GETWORD((DLword *)entry \n\ - movw (%%esi),%%ax \n\ - andl $65534,%%eax \n\ - addl %%eax,%%eax \n\ - movl %%eax,%%ecx \n\ - addl HTcoll,%%ecx \n\ - leal 2(%%ecx),%%edx / if (GETWORD((DLword *)link + 1) == 0) { \n\ - xorb $2,%%dl \n\ - cmpw $0,(%%edx) \n\ - jne sgclp1 \n\ - movl %%ecx,%%eax / GETWORD((DLword *)entry) = GETWORD((DLword *)link) \n\ - xorb $2,%%al \n\ - movw (%%eax),%%bx \n\ - movw %%bx,(%%esi) \n\ - movw $0,(%%eax) / FreeLink: GETWORD(link) = 0 \n\ - movl HTcoll,%%eax / GETWORD(link+1) = GETWORD(HTcoll) \n\ - xorb $2,%%al \n\ - movw (%%eax),%%bx \n\ - movw %%bx,(%%edx) \n\ - movl %%ecx,%%ebx \n\ - subl HTcoll,%%ebx \n\ - sarl $1,%%ebx \n\ - movw %%bx,(%%eax) \n\ - .align 4 \n\ -sgclp1: / start of gcloop 1 - do setup \n\ - movl GcDisabled_word,%%ecx \n\ - movl MDStypetbl,%%ebx \n\ -gclp1: / GcreclaimLp: \n\ - pushl %2 \n\ - call gcreccell \n\ - addl $4,%%esp \n\ - movl %%eax,%2 \n\ - testl %%eax,%%eax \n\ - je eogclp1 \n\ - shrl $9,%%eax \n\ - leal 0(%%ebx,%%eax,2),%%eax \n\ - xorb $2,%%al \n\ - cmpw $0,(%%eax) \n\ - jl gclp1 \n\ - cmpl $76,(%%ecx) \n\ - je gclp1 \n\ - pushl $0 \n\ - pushl %2 \n\ - call rec_htfind \n\ - addl $8,%%esp \n\ - jmp gclp1 \n\ - .align 4 \n\ - .align 4 \n\ -eogclp1: \n\ - movl %0,%%eax / if (HTLPTR->contents == 0) \n\ - cmpw $0,(%%eax) \n\ - je nextentry / goto nextentry; \n\ - jmp retry / else goto retry; \n\ - .align 4 \n\ - .align 4 \n\ - \n\ -stknz: \n\ - movw (%%ecx),%%ax / if ((offset = ((struct htcoll *)link)->next_free)) \n\ - testw %%ax,%%ax \n\ - je nextentry \n\ - movl %%ecx,%%esi \n\ - andl $65535,%%eax \n\ - jmp linkloop \n\ - .align 4 \n\ - .align 4 \n\ -nocollision: \n\ - testw $65024,(%%ecx) / if (StkCntIsZero(HTLPTR->contents)) { \n\ - jne nextentry \n\ - movw (%%ecx),%%dx /ptr = VAG2(HENTRY->segnum, (probe << 1)); \n\ - sall $15,%%edx \n\ - andl $16711680,%%edx \n\ - leal (,%%edi,2),%%eax \n\ - orl %%eax,%%edx \n\ - movl %%edx,%2 \n\ - movw $0,(%%ecx) / HTLPTR->contents = 0 \n\ - .align 4 \n\ - movl GcDisabled_word,%%ecx \n\ - movl MDStypetbl,%%ebx \n\ -gclp2: / GcreclaimLp \n\ - pushl %2 \n\ - call gcreccell \n\ - addl $4,%%esp \n\ - movl %%eax,%2 \n\ - testl %%eax,%%eax \n\ - je nextentry \n\ - shrl $9,%%eax \n\ - leal 0(%%ebx,%%eax,2),%%eax \n\ - xorb $2,%%al \n\ - cmpw $0,(%%eax) \n\ - jl gclp2 \n\ - cmpl $76,(%%ecx) \n\ - je gclp2 \n\ - pushl $0 \n\ - pushl %2 \n\ - call rec_htfind \n\ - addl $8,%%esp \n\ - jmp gclp2 \n\ - .align 4 \n\ -returNIL: \n\ - " - : "=g"(entry), "=g"(offset), "=g"(ptr) - : - : "ax", "dx", "cx", "bx", "si", "di"); - - return NIL; -} -#else LispPTR gcmapscan(void) { register GCENTRY probe; @@ -342,7 +142,6 @@ nextentry: } return (NIL); } -#endif /* GCC386 */ LispPTR gcmapunscan(void) { register GCENTRY probe; diff --git a/src/inet.c b/src/inet.c index e400b87..a8ac5d8 100644 --- a/src/inet.c +++ b/src/inet.c @@ -49,9 +49,6 @@ #include "commondefs.h" #include "mkcelldefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif #define TCPhostlookup 0 #define TCPservicelookup 1 diff --git a/src/ldsout.c b/src/ldsout.c index 27e3bb9..5102461 100644 --- a/src/ldsout.c +++ b/src/ldsout.c @@ -30,9 +30,6 @@ #include "byteswapdefs.h" #include "initdspdefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif /* GCC386 */ #define IFPAGE_ADDRESS 512 #define DEFAULT_MAX_SYSOUTSIZE 64 /* in Mbyte */ diff --git a/src/mvs.c b/src/mvs.c index 90592d9..f0a4a6f 100644 --- a/src/mvs.c +++ b/src/mvs.c @@ -33,9 +33,6 @@ #include "car-cdrdefs.h" #include "conspagedefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif /* GCC386 */ /* to optionally swap the fnhead field of a frame */ #ifdef BIGVM diff --git a/src/vmemsave.c b/src/vmemsave.c index f6f2da6..30bd0cf 100644 --- a/src/vmemsave.c +++ b/src/vmemsave.c @@ -61,9 +61,6 @@ #include "perrnodefs.h" #include "ufsdefs.h" -#ifdef GCC386 -#include "inlnPS2.h" -#endif /* Error return values from VMEMSAVE */ #define COMPLETESYSOUT NIL diff --git a/src/xc.c b/src/xc.c index e1a5af4..5903f43 100644 --- a/src/xc.c +++ b/src/xc.c @@ -112,12 +112,7 @@ extern MouseInterface currentmouse; typedef struct conspage ConsPage; typedef ByteCode *InstPtr; -#ifdef GCC386 -register InstPtr pccache asm("si"); -register LispPTR *cspcache asm("di"); -register LispPTR tscache asm("bx"); -#include "inlnPS2.h" -#elif (DOS && OPDISP) +#if (DOS && OPDISP) #include "inlndos.h" register InstPtr pccache asm("si"); register LispPTR *cspcache asm("di");