Delete 689 undead files.
These files "magically reappeared" after the conversion from CVS to Mercurial. The old CVS repository deleted these files but did not record *when* it deleted these files. The conversion resurrected these files because they have no history of deletion. These files were probably deleted before year 1995. The CVS repository begins to record deletions around 1995. These files may still appear in older revisions of this Mercurial repository, when they should already be deleted. There is no way to fix this, because the CVS repository provides no dates of deletion. See http://sourceforge.net/mailarchive/message.php?msg_id=29823032
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
EMHOME=../../..
|
||||
HDIR = $(EMHOME)/modules/h
|
||||
INSTALL=$(EMHOME)/modules/install
|
||||
COMPARE=$(EMHOME)/modules/compare
|
||||
INCLUDES = -I. -I$(HDIR)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
CFLAGS = -O $(INCLUDES) $(COPT)
|
||||
|
||||
CSRC = Malloc.c\
|
||||
Salloc.c\
|
||||
Srealloc.c\
|
||||
Realloc.c\
|
||||
botch.c\
|
||||
clear.c\
|
||||
st_alloc.c\
|
||||
std_alloc.c \
|
||||
No_Mem.c
|
||||
SOURCES = alloc.h\
|
||||
$(CSRC)
|
||||
|
||||
OBJECTS = botch.$(SUF) clear.$(SUF) st_alloc.$(SUF) Malloc.$(SUF) \
|
||||
Salloc.$(SUF) \
|
||||
Srealloc.$(SUF) Realloc.$(SUF) std_alloc.$(SUF) No_Mem.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: liballoc.$(LIBSUF)
|
||||
|
||||
liballoc.$(LIBSUF): $(OBJECTS)
|
||||
$(AR) cr liballoc.$(LIBSUF) $(OBJECTS)
|
||||
-sh -c 'ranlib liballoc.$(LIBSUF)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/liballoc.$(LIBSUF)
|
||||
$(INSTALL) man/alloc.3
|
||||
$(INSTALL) h/alloc.h
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/liballoc.$(LIBSUF)
|
||||
-$(COMPARE) man/alloc.3
|
||||
-$(COMPARE) h/alloc.h
|
||||
|
||||
pr:
|
||||
@pr Makefile $(SOURCES)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF)
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Calloc $(CSRC)
|
||||
mv llib-lalloc.ln $(EMHOME)/modules/lib
|
||||
|
||||
st_alloc.$(SUF): alloc.h
|
||||
std_alloc.$(SUF): alloc.h
|
||||
Malloc.$(SUF): alloc.h
|
||||
@@ -1,12 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#define PRIVATE
|
||||
#else
|
||||
#define PRIVATE static
|
||||
#endif
|
||||
|
||||
#define EXPORT
|
||||
@@ -1,43 +0,0 @@
|
||||
EMHOME=../../..
|
||||
MODULES=$(EMHOME)/modules
|
||||
HDIR = $(MODULES)/h
|
||||
INCLUDES = -I$(HDIR)
|
||||
CFLAGS = $(INCLUDES) -O $(COPT)
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: libassert.$(LIBSUF)
|
||||
|
||||
libassert.$(LIBSUF): BadAssert.$(SUF)
|
||||
$(AR) r libassert.$(LIBSUF) BadAssert.$(SUF)
|
||||
-sh -c 'ranlib libassert.$(LIBSUF)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libassert.$(LIBSUF)
|
||||
$(INSTALL) man/assert.3
|
||||
$(INSTALL) h/assert.h
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/libassert.$(LIBSUF)
|
||||
-$(COMPARE) man/assert.3
|
||||
-$(COMPARE) h/assert.h
|
||||
|
||||
pr:
|
||||
@pr Makefile assert.h BadAssert.c
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(LIBSUF) *.$(SUF)
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Cassert BadAssert.c
|
||||
mv llib-lassert.ln $(MODULES)/lib
|
||||
@@ -1,68 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
ETC = $(EMHOME)/etc
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
CFLAGS = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/src/read_em -I. -O $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
SRC = bhcst.c bhdlb.c bhdnam.c bhfcon.c bhicon.c bhilb.c bhpnam.c bhucon.c \
|
||||
crcst.c crdlb.c crdnam.c crxcon.c crilb.c crpnam.c crscon.c \
|
||||
cst.c dfdlb.c dfdnam.c dfilb.c dlb.c dnam.c end.c endarg.c \
|
||||
exc.c fcon.c getid.c icon.c ilb.c insert.c internerr.c \
|
||||
msend.c op.c opcst.c opdlb.c opdnam.c opilb.c opnarg.c oppnam.c pnam.c \
|
||||
pro.c pronarg.c msstart.c psdlb.c psdnam.c pspnam.c scon.c ucon.c \
|
||||
C_out.c failed.c em.c
|
||||
|
||||
OBS = failed.$(SUF) insert.$(SUF) internerr.$(SUF) getid.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: em_codeEK.h libeme.$(LIBSUF) libemk.$(LIBSUF) em_code.3
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libeme.$(LIBSUF)
|
||||
$(INSTALL) lib/libemk.$(LIBSUF)
|
||||
$(INSTALL) man/em_code.3
|
||||
$(INSTALL) h/em_codeEK.h
|
||||
|
||||
compare: all
|
||||
-$(COMPARE) lib/libeme.$(LIBSUF)
|
||||
-$(COMPARE) lib/libemk.$(LIBSUF)
|
||||
-$(COMPARE) man/em_code.3
|
||||
-$(COMPARE) h/em_codeEK.h
|
||||
|
||||
em_code.3: em_code.3X
|
||||
-sh -c 'tbl < em_code.3X > em_code.3'
|
||||
-sh -c 'if test -s em_code.3 ; then : ; else cp em_code.3X em_code.3 ; fi '
|
||||
|
||||
libeme.$(LIBSUF): em_private.h $(SRC) $(OBS)
|
||||
EMHOME=$(EMHOME); cc="$(CC)"; suf="$(SUF)"; libsuf="$(LIBSUF)"; cflags="-c -DREADABLE_EM $(CFLAGS)"; ar="$(AR)"; export EMHOME cc ar suf libsuf cflags; sh make.sh e $(SRC)
|
||||
-sh -c 'ranlib libeme.$(LIBSUF)'
|
||||
|
||||
libemk.$(LIBSUF): em_private.h $(SRC) $(OBS)
|
||||
EMHOME=$(EMHOME); cc="$(CC)"; suf="$(SUF)"; libsuf="$(LIBSUF)"; cflags="-c $(CFLAGS)"; ar="$(AR)"; export EMHOME cc ar suf libsuf cflags; sh make.sh k $(SRC)
|
||||
-sh -c 'ranlib libemk.$(LIBSUF)'
|
||||
|
||||
em_codeEK.h: make.em.gen $(ETC)/em_table em.nogen
|
||||
make.em.gen $(ETC)/em_table > em_codeEK.h
|
||||
cat em.nogen >> em_codeEK.h
|
||||
|
||||
pr:
|
||||
@pr Makefile em.nogen make.em.gen make.sh insert.h $(SRC) em_private.h
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF) em_code.3 em_codeEK.h
|
||||
|
||||
lintlib: make.sh
|
||||
lint -I. -I../../h -I../../../h -Ceme -DREADABLE_EM $(SRC)
|
||||
lint -I. -I../../h -I../../../h -Cemk $(SRC)
|
||||
mv llib-leme.ln llib-lemk.ln $(EMHOME)/modules/lib
|
||||
|
||||
insert.$(SUF): insert.c insert.h
|
||||
$(CC) $(CFLAGS) -c insert.c
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "em_private.h"
|
||||
|
||||
/* $Header$ */
|
||||
|
||||
CC_crfcon(op, v, s)
|
||||
char *v;
|
||||
arith s;
|
||||
{
|
||||
/* CON or ROM with argument FCON(v,z)
|
||||
*/
|
||||
PS(op);
|
||||
WCON(sp_fcon, v, s);
|
||||
CEND();
|
||||
NL();
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "em_private.h"
|
||||
|
||||
/* $Header$ */
|
||||
|
||||
CC_cricon(op, v, s)
|
||||
char *v;
|
||||
arith s;
|
||||
{
|
||||
/* CON or ROM with argument ICON(v,z)
|
||||
*/
|
||||
PS(op);
|
||||
WCON(sp_icon, v, s);
|
||||
CEND();
|
||||
NL();
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "em_private.h"
|
||||
|
||||
/* $Header$ */
|
||||
|
||||
CC_crucon(op, v, s)
|
||||
char *v;
|
||||
arith s;
|
||||
{
|
||||
/* CON or ROM with argument UCON(v,z)
|
||||
*/
|
||||
PS(op);
|
||||
WCON(sp_ucon, v, s);
|
||||
CEND();
|
||||
NL();
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
em.c
|
||||
em_private.h
|
||||
@@ -1,12 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include <system.h>
|
||||
|
||||
C_failed()
|
||||
{
|
||||
sys_write(STDERR,"write failed\n",13);
|
||||
sys_stop(S_EXIT);
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* EM CODE OUTPUT ROUTINES */
|
||||
|
||||
#include "io.c"
|
||||
#include "em_private.h"
|
||||
|
||||
/*
|
||||
The C_pt_*() functions serve as formatting functions of the
|
||||
various EM language constructs.
|
||||
See "Description of a Machine Architecture for use with
|
||||
Block Structured Languages" par. 11.2 for the meaning of these
|
||||
names.
|
||||
*/
|
||||
|
||||
C_magic()
|
||||
{
|
||||
}
|
||||
|
||||
/*** the readable code generating routines ***/
|
||||
|
||||
static
|
||||
wrs(s)
|
||||
register char *s;
|
||||
{
|
||||
while (*s) {
|
||||
C_putbyte(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_dnam(s)
|
||||
char *s;
|
||||
{
|
||||
wrs(s);
|
||||
}
|
||||
|
||||
C_pt_ilb(l)
|
||||
label l;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
sprint(buf, "*%ld", (long) l);
|
||||
wrs(buf);
|
||||
}
|
||||
|
||||
extern char em_mnem[][4];
|
||||
extern char em_pseu[][4];
|
||||
|
||||
C_pt_op(x)
|
||||
{
|
||||
C_putbyte(' ');
|
||||
wrs(em_mnem[x - sp_fmnem]);
|
||||
C_putbyte(' ');
|
||||
}
|
||||
|
||||
C_pt_cst(l)
|
||||
arith l;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
sprint(buf, "%ld", (long) l);
|
||||
wrs(buf);
|
||||
}
|
||||
|
||||
C_pt_scon(x, y)
|
||||
char *x;
|
||||
arith y;
|
||||
{
|
||||
char xbuf[1024];
|
||||
register char *p;
|
||||
char *bts2str();
|
||||
|
||||
C_putbyte('\'');
|
||||
p = bts2str(x, (int) y, xbuf);
|
||||
while (*p) {
|
||||
if (*p == '\'') {
|
||||
C_putbyte('\\');
|
||||
}
|
||||
C_putbyte(*p++);
|
||||
}
|
||||
C_putbyte('\'');
|
||||
}
|
||||
|
||||
C_pt_ps(x)
|
||||
{
|
||||
C_putbyte(' ');
|
||||
wrs(em_pseu[x - sp_fpseu]);
|
||||
C_putbyte(' ');
|
||||
}
|
||||
|
||||
C_pt_dlb(l)
|
||||
label l;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
sprint(buf, ".%ld", (long) l);
|
||||
wrs(buf);
|
||||
}
|
||||
|
||||
C_pt_doff(l, v)
|
||||
label l;
|
||||
arith v;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
C_pt_dlb(l);
|
||||
if (v != 0) {
|
||||
sprint(buf,"+%ld", (long) v);
|
||||
wrs(buf);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_noff(s, v)
|
||||
char *s;
|
||||
arith v;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
wrs(s);
|
||||
if (v != 0) {
|
||||
sprint(buf,"+%ld", (long) v);
|
||||
wrs(buf);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_pnam(s)
|
||||
char *s;
|
||||
{
|
||||
C_putbyte('$');
|
||||
wrs(s);
|
||||
}
|
||||
|
||||
C_pt_dfilb(l)
|
||||
label l;
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
sprint(buf, "%ld", (long) l);
|
||||
wrs(buf);
|
||||
}
|
||||
|
||||
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
|
||||
int sp;
|
||||
char *v;
|
||||
arith sz;
|
||||
{
|
||||
int ch = sp == sp_icon ? 'I' : sp == sp_ucon ? 'U' : 'F';
|
||||
|
||||
wrs(v);
|
||||
C_putbyte(ch);
|
||||
C_pt_cst(sz);
|
||||
}
|
||||
|
||||
C_pt_nl() { C_putbyte('\n'); }
|
||||
C_pt_comma() { C_putbyte(','); }
|
||||
C_pt_ccend() { C_putbyte('?'); }
|
||||
@@ -1,37 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* private inclusion file */
|
||||
|
||||
#include <em_arith.h>
|
||||
#include <em_label.h>
|
||||
|
||||
/* include the EM description files */
|
||||
#include <em_spec.h>
|
||||
#include <em_pseu.h>
|
||||
#include <em_mnem.h>
|
||||
#include <em_reg.h>
|
||||
|
||||
/* macros used in the definitions of the interface functions C_* */
|
||||
#define OP(x) C_pt_op(x)
|
||||
#define CST(x) C_pt_cst(x)
|
||||
#define DCST(x) C_pt_cst(x)
|
||||
#define SCON(x,y) C_pt_scon((x), (y))
|
||||
#define PS(x) C_pt_ps(x)
|
||||
#define DLB(x) C_pt_dlb(x)
|
||||
#define DFDLB(x) C_pt_dlb(x)
|
||||
#define ILB(x) C_pt_ilb(x)
|
||||
#define DFILB(x) C_pt_dfilb(x)
|
||||
#define NOFF(x,y) C_pt_noff((x), (y))
|
||||
#define DOFF(x,y) C_pt_doff((x), (y))
|
||||
#define PNAM(x) C_pt_pnam(x)
|
||||
#define DNAM(x) C_pt_dnam(x)
|
||||
#define DFDNAM(x) C_pt_dnam(x)
|
||||
#define CEND()
|
||||
#define CCEND() C_pt_ccend()
|
||||
#define WCON(x,y,z) C_pt_wcon((x), (y), (z))
|
||||
#define COMMA() C_pt_comma()
|
||||
#define NL() C_pt_nl()
|
||||
#define CILB(x) C_pt_ilb(x)
|
||||
@@ -1,143 +0,0 @@
|
||||
/* $Header$ */
|
||||
|
||||
/* I/O part of em_code module.
|
||||
Also contains C_open, C_close
|
||||
*/
|
||||
#include <alloc.h>
|
||||
#include <em_path.h>
|
||||
#include <em_arith.h>
|
||||
#include "insert.h"
|
||||
|
||||
int C_ontmpfile = 0;
|
||||
int C_sequential = 1;
|
||||
Part *C_curr_part;
|
||||
Part *C_stable[TABSIZ];
|
||||
char *C_tmpdir = TMP_DIR;
|
||||
int (*C_outpart)(), (*C_swtout)(), (*C_swttmp)();
|
||||
|
||||
#ifdef INCORE
|
||||
char *C_BASE;
|
||||
#endif
|
||||
|
||||
File *C_ofp;
|
||||
|
||||
#ifndef INCORE
|
||||
File *C_tfr, *C_old_ofp;
|
||||
char *C_tmpfile;
|
||||
char *strcpy(), *strcat();
|
||||
char *C_ibuf = 0;
|
||||
long C_current_out;
|
||||
#endif
|
||||
|
||||
#if BUFSIZ <= 1024 && BIGMACHINE
|
||||
#define BUFFERSIZ 8*BUFSIZ
|
||||
#else
|
||||
#define BUFFERSIZ BUFSIZ
|
||||
#endif
|
||||
|
||||
static char obuf[BUFFERSIZ];
|
||||
char *C_top = &obuf[BUFFERSIZ];
|
||||
char *C_old_top;
|
||||
char *C_old_opp;
|
||||
#ifdef INCORE
|
||||
char *C_current_out = obuf;
|
||||
#else
|
||||
char *C_opp = obuf;
|
||||
#endif
|
||||
|
||||
C_flush() {
|
||||
#ifdef INCORE
|
||||
static unsigned int bufsiz;
|
||||
|
||||
if (C_ontmpfile) {
|
||||
if (C_BASE == 0) {
|
||||
C_BASE = Malloc(BUFFERSIZ);
|
||||
bufsiz = BUFFERSIZ;
|
||||
C_current_out = C_BASE;
|
||||
}
|
||||
else {
|
||||
C_BASE = Srealloc(C_BASE, (bufsiz << 1));
|
||||
C_current_out = C_BASE + bufsiz;
|
||||
bufsiz <<= 1;
|
||||
}
|
||||
C_top = C_BASE + bufsiz;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (C_opp != obuf && sys_write(C_ofp, obuf, C_opp - obuf) == 0) {
|
||||
C_failed();
|
||||
}
|
||||
C_opp = obuf;
|
||||
}
|
||||
|
||||
#ifndef INCORE
|
||||
#define Xputbyte(c) if (C_ontmpfile) C_current_out++; put(c)
|
||||
#else
|
||||
#define Xputbyte(c) put(c)
|
||||
#endif
|
||||
|
||||
C_putbyte(c)
|
||||
int c;
|
||||
{
|
||||
Xputbyte(c);
|
||||
}
|
||||
|
||||
#define C_putbyte Xputbyte
|
||||
|
||||
C_init(w, p)
|
||||
arith w, p;
|
||||
{
|
||||
}
|
||||
|
||||
C_open(nm)
|
||||
char *nm;
|
||||
{
|
||||
/* Open file "nm" for output
|
||||
*/
|
||||
|
||||
if (nm == 0)
|
||||
C_ofp = STDOUT; /* standard output */
|
||||
else
|
||||
if (sys_open(nm, OP_WRITE, &C_ofp) == 0)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
C_close()
|
||||
{
|
||||
/* Finish the code-generation.
|
||||
*/
|
||||
|
||||
#ifndef INCORE
|
||||
C_flush();
|
||||
if (C_tmpfile) {
|
||||
(*C_swttmp)();
|
||||
sys_close(C_ofp);
|
||||
#else
|
||||
if (C_BASE) {
|
||||
#endif
|
||||
if (C_curr_part) {
|
||||
C_curr_part->p_parts->pp_end = C_current_out - C_BASE;
|
||||
}
|
||||
(*C_swtout)();
|
||||
if (! C_sequential) {
|
||||
(*C_outpart)(0);
|
||||
}
|
||||
#ifndef INCORE
|
||||
sys_close(C_tfr);
|
||||
sys_remove(C_tmpfile);
|
||||
if (C_ibuf) free(C_ibuf);
|
||||
#else
|
||||
free(C_BASE);
|
||||
#endif
|
||||
}
|
||||
C_flush();
|
||||
if (C_ofp != STDOUT)
|
||||
sys_close(C_ofp);
|
||||
C_ofp = 0;
|
||||
}
|
||||
|
||||
C_busy()
|
||||
{
|
||||
return C_ofp != 0; /* true if code is being generated */
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
em.c
|
||||
em_private.h
|
||||
@@ -1,12 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include <system.h>
|
||||
|
||||
C_failed()
|
||||
{
|
||||
sys_write(STDERR,"write failed\n",13);
|
||||
sys_stop(S_EXIT);
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Header$ */
|
||||
/* EM CODE OUTPUT ROUTINES */
|
||||
|
||||
#include "io.c"
|
||||
#include "em_private.h"
|
||||
|
||||
#define put8(x) C_putbyte(x)
|
||||
#define put16(x) put8((int) x); put8((int) (x >> 8))
|
||||
#define put32(x) put16((int) x); put16((int) (x >> 16))
|
||||
|
||||
/*
|
||||
The C_pt_*() functions serve as formatting functions of the
|
||||
various EM language constructs.
|
||||
See "Description of a Machine Architecture for use with
|
||||
Block Structured Languages" par. 11.2 for the meaning of these
|
||||
names.
|
||||
*/
|
||||
|
||||
C_magic()
|
||||
{
|
||||
put16(sp_magic);
|
||||
}
|
||||
|
||||
/*** the compact code generating routines ***/
|
||||
#define fit16i(x) ((x) >= (long)0xFFFF8000 && (x) <= (long)0x00007FFF)
|
||||
#define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */
|
||||
|
||||
C_pt_ilb(l)
|
||||
register label l;
|
||||
{
|
||||
if (fit8u(l)) {
|
||||
put8(sp_ilb1);
|
||||
put8(l);
|
||||
}
|
||||
else {
|
||||
put8(sp_ilb2);
|
||||
put16(l);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_dlb(l)
|
||||
register label l;
|
||||
{
|
||||
if (fit8u(l)) {
|
||||
put8(sp_dlb1);
|
||||
put8(l);
|
||||
}
|
||||
else {
|
||||
put8(sp_dlb2);
|
||||
put16((int)l);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_cst(l)
|
||||
register arith l;
|
||||
{
|
||||
if (l >= (arith) -sp_zcst0 && l < (arith) (sp_ncst0 - sp_zcst0)) {
|
||||
/* we can convert 'l' to an int because its value
|
||||
can be stored in a byte.
|
||||
*/
|
||||
put8((int)l + (sp_zcst0 + sp_fcst0));
|
||||
}
|
||||
else
|
||||
if (fit16i(l)) { /* the cast from long to int causes no trouble here */
|
||||
put8(sp_cst2);
|
||||
put16((int) l);
|
||||
}
|
||||
else {
|
||||
put8(sp_cst4);
|
||||
put32(l);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_doff(l, v)
|
||||
label l;
|
||||
arith v;
|
||||
{
|
||||
if (v == 0) {
|
||||
C_pt_dlb(l);
|
||||
}
|
||||
else {
|
||||
put8(sp_doff);
|
||||
C_pt_dlb(l);
|
||||
C_pt_cst(v);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_noff(s, v)
|
||||
char *s;
|
||||
arith v;
|
||||
{
|
||||
if (v == 0) {
|
||||
C_pt_dnam(s);
|
||||
}
|
||||
else {
|
||||
put8(sp_doff);
|
||||
C_pt_dnam(s);
|
||||
C_pt_cst(v);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_dnam(s)
|
||||
char *s;
|
||||
{
|
||||
put8(sp_dnam);
|
||||
C_pt_str(s);
|
||||
}
|
||||
|
||||
C_pt_pnam(s)
|
||||
char *s;
|
||||
{
|
||||
put8(sp_pnam);
|
||||
C_pt_str(s);
|
||||
}
|
||||
|
||||
C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
|
||||
int sp;
|
||||
char *v;
|
||||
arith sz;
|
||||
{
|
||||
/* how 'bout signextension int --> long ??? */
|
||||
put8(sp);
|
||||
C_pt_cst(sz);
|
||||
C_pt_str(v);
|
||||
}
|
||||
|
||||
C_pt_str(s)
|
||||
register char *s;
|
||||
{
|
||||
register int len;
|
||||
|
||||
C_pt_cst((arith) (len = strlen(s)));
|
||||
while (--len >= 0) {
|
||||
put8(*s++);
|
||||
}
|
||||
}
|
||||
|
||||
C_pt_scon(b, n)
|
||||
register char *b;
|
||||
register arith n;
|
||||
{
|
||||
put8(sp_scon);
|
||||
C_pt_cst(n);
|
||||
while (--n >= 0) {
|
||||
put8(*b++);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* private inclusion file */
|
||||
|
||||
#include <em_arith.h>
|
||||
#include <em_label.h>
|
||||
|
||||
/* include the EM description files */
|
||||
#include <em_spec.h>
|
||||
#include <em_pseu.h>
|
||||
#include <em_mnem.h>
|
||||
#include <em_reg.h>
|
||||
|
||||
/* macros used in the definitions of the interface functions C_* */
|
||||
#define OP(x) C_pt_op(x)
|
||||
#define CST(x) C_pt_cst(x)
|
||||
#define DCST(x) C_pt_cst(x)
|
||||
#define SCON(x,y) C_pt_scon((x), (y))
|
||||
#define PS(x) C_pt_ps(x)
|
||||
#define DLB(x) C_pt_dlb(x)
|
||||
#define DFDLB(x) C_pt_dlb(x)
|
||||
#define ILB(x) C_pt_ilb(x)
|
||||
#define DFILB(x) C_pt_ilb(x)
|
||||
#define NOFF(x,y) C_pt_noff((x), (y))
|
||||
#define DOFF(x,y) C_pt_doff((x), (y))
|
||||
#define PNAM(x) C_pt_pnam(x)
|
||||
#define DNAM(x) C_pt_dnam(x)
|
||||
#define DFDNAM(x) C_pt_dnam(x)
|
||||
#define CEND() C_pt_cend()
|
||||
#define CCEND() C_pt_cend()
|
||||
#define WCON(x,y,z) C_pt_wcon((x), (y), (z))
|
||||
#define COMMA()
|
||||
#define NL()
|
||||
#define CILB(x) CST((arith) x)
|
||||
|
||||
#define C_pt_cend() C_putbyte(sp_cend)
|
||||
#define C_pt_op(x) C_putbyte(x)
|
||||
#define C_pt_ps(x) C_putbyte(x)
|
||||
@@ -1,52 +0,0 @@
|
||||
TMP=tmp$$
|
||||
cat $* >$TMP
|
||||
ed - $TMP <<'--EOI--'
|
||||
g/^%/d
|
||||
g/^$/d
|
||||
g/^ /.-1,.j
|
||||
1,$s/[ ]*|[ ]*/|/g
|
||||
g/NOTIMPLEMENTED/d
|
||||
1,$s/\([^|]*\)|\([^|]*\)|\(.*\)$/\
|
||||
NAME \1\
|
||||
HEAD \1\
|
||||
PLST \2\
|
||||
DECL \2\
|
||||
BODY \3/
|
||||
$a
|
||||
END
|
||||
.
|
||||
g/^NAME/m$
|
||||
g/^PLST/s/[ ][ ]*\([^:]*\):\([^ ]*\)/,\2/g
|
||||
g/^PLST,/s//PLST /
|
||||
g/^PLST /s/^PLST \(.*\)$/(\1)/
|
||||
g/^HEAD/.,.+1j
|
||||
g/^HEAD /s/^HEAD \([^(]*\)\(.*\)$/cat >\1.c <<'--EOF--'\
|
||||
#include "em_private.h"\
|
||||
\
|
||||
\1\2/
|
||||
g/^DECL/s/[ ][ ]*\([^:]*\):\([^ ]*\)/\
|
||||
\1 \2;/g
|
||||
g/^DECL/d
|
||||
g/^BODY/s/^BODY \(.*\)$/{\
|
||||
\1;\
|
||||
}\
|
||||
--EOF--/
|
||||
1,/^END/-1p
|
||||
1,/^END/d
|
||||
g:^NAME:s:^NAME \(.*\)$:cc -c -O -I$1 -I$EMHOME/modules/h -I$EMHOME/h \1.c:
|
||||
1i
|
||||
cat >make.sh <<'--EOF--'
|
||||
: script for making lib
|
||||
rm -f C_*.o
|
||||
.
|
||||
$a
|
||||
rm -f libem$1.a
|
||||
cc -c -O -I. -I$1 -I$EMHOME/modules/h -I$EMHOME/h $1/em.c
|
||||
mv em.o em$1.o
|
||||
ar rc libem$1.a C_*.o em$1.o insert.o failed.o internerr.o getid.o
|
||||
rm -f C_*.o
|
||||
--EOF--
|
||||
.
|
||||
1,$p
|
||||
--EOI--
|
||||
rm -f $TMP
|
||||
@@ -1,15 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1990 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include <em.h>
|
||||
#include <em_mes.h>
|
||||
|
||||
C_ms_lin(l)
|
||||
int l;
|
||||
{
|
||||
C_mes_begin(ms_lin);
|
||||
C_cst((arith) l);
|
||||
C_mes_end();
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
HDIR = $(EMHOME)/modules/h
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
INCLUDES=-I$(EMHOME)/h -I$(HDIR)
|
||||
CFLAGS = $(INCLUDES) -O $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
SRC = C_ms_err.c C_ms_opt.c C_ms_emx.c C_ms_reg.c C_ms_src.c\
|
||||
C_ms_flt.c C_ms_com.c C_ms_par.c C_ms_ego.c C_ms_gto.c\
|
||||
C_ms_stb.c C_ms_std.c
|
||||
OBJ = C_ms_err.$(SUF) C_ms_opt.$(SUF) C_ms_emx.$(SUF) C_ms_reg.$(SUF) C_ms_src.$(SUF)\
|
||||
C_ms_flt.$(SUF) C_ms_com.$(SUF) C_ms_par.$(SUF) C_ms_ego.$(SUF) C_ms_gto.$(SUF)\
|
||||
C_ms_stb.$(SUF) C_ms_std.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: libem_mes.$(LIBSUF) libem_mesCE.$(LIBSUF) libem_mesO.$(LIBSUF)
|
||||
libem_mes.$(LIBSUF): $(OBJ)
|
||||
rm -f libem_mes.$(LIBSUF)
|
||||
$(AR) cr libem_mes.$(LIBSUF) $(OBJ)
|
||||
-sh -c 'ranlib libem_mes.$(LIBSUF)'
|
||||
|
||||
libem_mesO.$(LIBSUF):
|
||||
rm -f *.$(SUF) libem_mesO.$(LIBSUF)
|
||||
$(CC) -c $(CFLAGS) -DPEEPHOLE $(SRC)
|
||||
$(AR) cr libem_mesO.$(LIBSUF) $(OBJ)
|
||||
-sh -c 'ranlib libem_mesO.$(LIBSUF)'
|
||||
rm -f *.$(SUF)
|
||||
|
||||
libem_mesCE.$(LIBSUF):
|
||||
rm -f *.$(SUF) libem_mesCE.$(LIBSUF)
|
||||
$(CC) -c $(CFLAGS) -DCODE_EXPANDER $(SRC)
|
||||
$(AR) cr libem_mesCE.$(LIBSUF) $(OBJ)
|
||||
-sh -c 'ranlib libem_mesCE.$(LIBSUF)'
|
||||
rm -f *.$(SUF)
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libem_mes.$(LIBSUF)
|
||||
$(INSTALL) lib/libem_mesO.$(LIBSUF)
|
||||
$(INSTALL) lib/libem_mesCE.$(LIBSUF)
|
||||
$(INSTALL) man/em_mes.3
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/libem_mes.$(LIBSUF)
|
||||
-$(COMPARE) lib/libem_mesO.$(LIBSUF)
|
||||
-$(COMPARE) lib/libem_mesCE.$(LIBSUF)
|
||||
-$(COMPARE) man/em_mes.3
|
||||
|
||||
pr:
|
||||
@pr Makefile $(SRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF)
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Cem_mes $(SRC)
|
||||
mv llib-lem_mes.ln $(EMHOME)/modules/lib
|
||||
@@ -1,180 +0,0 @@
|
||||
# $Header$
|
||||
EMHOME = ../../..
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
LINT = lint
|
||||
BINDIR = $(EMHOME)/lib
|
||||
|
||||
# set HOWMUCH to head -20 to limit number of patterns used
|
||||
#HOWMUCH = head -20
|
||||
HOWMUCH = cat
|
||||
|
||||
LEXLIB = -ll
|
||||
INCLDIR = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
|
||||
PREFLAGS = $(INCLDIR) -DPRIVATE=static# -DDEBUG
|
||||
|
||||
# Enable the next line to produce a version that output's the line number
|
||||
# from the patterns file each time an optimization is performed.
|
||||
#PREFLAGS = $(PREFLAGS) -DSTATS
|
||||
|
||||
PROFFLAG = -O
|
||||
CFLAGS = $(PREFLAGS) $(PROFFLAG) $(COPT)
|
||||
LINTFLAGS = $(PREFLAGS) -DNORCSID
|
||||
LLOPT =
|
||||
CMD = '$(CC) -c $(CFLAGS)'
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
LIBOPT = libemopt.$(LIBSUF)
|
||||
LIBCEOPT = libCEopt.$(LIBSUF)
|
||||
|
||||
.SUFFIXES: .d .r
|
||||
|
||||
.r.d: ; CMD=$(CMD); export CMD; awk -f makefuns.awk $*.r | sh -x
|
||||
touch $@
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
CSRC = main.c nopt.c mkstrct.c aux.c outputdfa.c outcalls.c\
|
||||
findworst.c initlex.c
|
||||
|
||||
SRCS = Makefile nopt.h parser.h parser.g syntax.l pseudo.r\
|
||||
patterns $(CSRC)
|
||||
|
||||
NOFILES = nopt.$(SUF) dfa.$(SUF) trans.$(SUF) aux.$(SUF) mkstrct.$(SUF)
|
||||
|
||||
POFILES = parser.$(SUF) syntax.$(SUF) outputdfa.$(SUF) outcalls.$(SUF) findworst.$(SUF)\
|
||||
initlex.$(SUF) Lpars.$(SUF)
|
||||
|
||||
GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c \
|
||||
dfa.c dfa.c.new trans.c trans.c.new\
|
||||
incalls.d incalls.r incalls.r.new pseudo.d
|
||||
|
||||
all: em_nopt $(LIBOPT) $(LIBCEOPT) em_opt.3
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/$(LIBOPT)
|
||||
$(INSTALL) lib/$(LIBCEOPT)
|
||||
$(INSTALL) man/em_opt.3
|
||||
cp em_nopt.6 $(EMHOME)/man
|
||||
cp em_nopt $(BINDIR)/em_nopt
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/$(LIBOPT)
|
||||
-$(COMPARE) lib/$(LIBCEOPT)
|
||||
-$(COMPARE) man/em_opt.3
|
||||
-cmp em_nopt $(BINDIR)/em_nopt
|
||||
|
||||
pr:
|
||||
@pr $(SRCS)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
lint: lintparser lintnopt
|
||||
|
||||
clean:
|
||||
rm -f O_*.$(SUF)
|
||||
rm -f O_*.c
|
||||
rm -f $(NOFILES) main.$(SUF) $(POFILES)
|
||||
rm -f $(GENFILES) parser em_nopt $(LIBOPT) $(LIBCEOPT)
|
||||
|
||||
# How to build stand alone version of the optimizer
|
||||
|
||||
NOPTLIB = $(EMHOME)/modules/lib/libread_emk.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/libemk.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/liballoc.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/malloc.$(SUF)\
|
||||
$(EMHOME)/modules/lib/libprint.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/libstring.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/libsystem.$(LIBSUF)\
|
||||
$(EMHOME)/lib/em_data.$(LIBSUF)
|
||||
|
||||
em_nopt: incalls.r main.$(SUF) $(NOFILES)
|
||||
$(CC) -o em_nopt main.$(SUF) $(NOFILES) $(NOPTLIB)
|
||||
|
||||
OLINT = main.c mkstrct.c nopt.c aux.c dfa.c trans.c
|
||||
|
||||
OLINTLIB = $(EMHOME)/modules/lib/llib-lread_emkV.ln\
|
||||
$(EMHOME)/modules/lib/llib-lemk.ln\
|
||||
$(EMHOME)/modules/lib/llib-lsystem.ln\
|
||||
$(EMHOME)/modules/lib/llib-lalloc.ln\
|
||||
$(EMHOME)/modules/lib/llib-lprint.ln\
|
||||
$(EMHOME)/modules/lib/llib-lstring.ln
|
||||
|
||||
lintnopt: incalls.r $(OLINT)
|
||||
$(LINT) $(LINTFLAGS) $(OLINT) $(OLINTLIB)
|
||||
|
||||
# How to build the library version of the optimizer
|
||||
|
||||
$(LIBOPT): $(NOFILES) pseudo.d incalls.d
|
||||
rm -f $(LIBOPT)
|
||||
ar rc $(LIBOPT) O_*.$(SUF) $(NOFILES)
|
||||
-sh -c 'ranlib $(LIBOPT)'
|
||||
|
||||
$(LIBCEOPT): incalls.r
|
||||
rm -f O_*.$(SUF) $(NOFILES) pseudo.d incalls.d
|
||||
-mv $(LIBOPT) $(LIBOPT).saved
|
||||
make "EMHOME="$(EMHOME) PREFLAGS='$(INCLDIR) -DPRIVATE=static -DCODE_EXPANDER' $(LIBOPT)
|
||||
mv $(LIBOPT) $(LIBCEOPT)
|
||||
-mv $(LIBOPT).saved $(LIBOPT)
|
||||
rm -f O_*.$(SUF) $(NOFILES)
|
||||
|
||||
incalls.r: patterns parser
|
||||
-$(EMHOME)/lib/cpp patterns | $(HOWMUCH) >/tmp/patts
|
||||
parser </tmp/patts
|
||||
-rm /tmp/patts
|
||||
|
||||
# How to build the lint library for the optimizer
|
||||
|
||||
LLINT = nopt.c mkstrct.c aux.c dfa.c trans.c
|
||||
|
||||
lintlib: incalls.r $(LLINT)
|
||||
$(LINT) $(LINTFLAGS) $(LLINT) -Cemopt
|
||||
mv llib-lemopt.ln $(EMHOME)/modules/lib
|
||||
|
||||
# How to build program to parse patterns table and build c files.
|
||||
|
||||
PARSERLIB = $(EMHOME)/lib/em_data.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/liballoc.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/libstring.$(LIBSUF)\
|
||||
$(EMHOME)/modules/lib/libsystem.$(LIBSUF)
|
||||
|
||||
parser: parserdummy $(POFILES) $(PARSERLIB)
|
||||
$(CC) -o parser $(LDFLAGS) $(POFILES) $(PARSERLIB) $(LEXLIB)
|
||||
|
||||
parserdummy: parser.g
|
||||
LLgen $(LLOPT) parser.g
|
||||
touch parserdummy
|
||||
|
||||
PLINT = parser.c syntax.c outputdfa.c outcalls.c\
|
||||
findworst.c initlex.c Lpars.c
|
||||
|
||||
PLINTLIB = $(EMHOME)/modules/lib/llib-lalloc.ln\
|
||||
$(EMHOME)/modules/lib/llib-lstring.ln\
|
||||
$(EMHOME)/modules/lib/llib-lsystem.ln
|
||||
|
||||
lintparser: parserdummy $(PLINT)
|
||||
$(LINT) $(LINTFLAGS) $(PLINT) $(PLINTLIB)
|
||||
|
||||
# Dependancies
|
||||
|
||||
main.$(SUF): nopt.h
|
||||
nopt.$(SUF): nopt.h
|
||||
mkstrct.$(SUF): nopt.h
|
||||
aux.$(SUF): nopt.h
|
||||
pseudo.d: nopt.h makefuns.awk
|
||||
dfa.$(SUF): nopt.h
|
||||
trans.$(SUF): nopt.h
|
||||
incalls.d: nopt.h makefuns.awk
|
||||
|
||||
parser.$(SUF): Lpars.h parser.h
|
||||
Lpars.$(SUF): Lpars.h
|
||||
syntax.$(SUF): syntax.l parser.h Lpars.h
|
||||
outputdfa.$(SUF): parser.h Lpars.h
|
||||
outcalls.$(SUF): parser.h
|
||||
findworst.$(SUF): parser.h
|
||||
initlex.$(SUF): parser.h
|
||||
@@ -1,434 +0,0 @@
|
||||
.TL
|
||||
A Tour of the Peephole Optimizer Library
|
||||
.AU
|
||||
B. J. McKenzie
|
||||
.NH
|
||||
Introduction
|
||||
.LP
|
||||
The peephole optimizer consists of three major parts:
|
||||
.IP a)
|
||||
the table describing the optimization to be performed
|
||||
.IP b)
|
||||
a program to parse these tables and build input and output routines to
|
||||
interface to the library and a dfa based routine to recognize patterns and
|
||||
make the requested replacements.
|
||||
.IP c)
|
||||
common routines for the library that are independent of the table of a)
|
||||
.LP
|
||||
The library conforms to the
|
||||
.I EM_CODE(3)
|
||||
module interface with entry points with names like
|
||||
.I C_xxx.
|
||||
The library module results in calls to a module with an identical interface
|
||||
but with calls to routines with names of the form
|
||||
.I O_xxx.
|
||||
|
||||
.LP
|
||||
We shall now describe each of these in turn in some detail.
|
||||
|
||||
.NH
|
||||
The optimization table
|
||||
.LP
|
||||
The file
|
||||
.I patterns
|
||||
contains the patterns of EM instructions to be recognized by the optimizer
|
||||
and the EM instructions to replace them. Each pattern may have an
|
||||
optional restriction that must be satisfied before the replacement is made.
|
||||
The syntax of the table will be described using extended BNF notation
|
||||
used by
|
||||
.I LLGen
|
||||
where:
|
||||
.DS
|
||||
.I
|
||||
[...] - are used to group items
|
||||
| - is used to separate alternatives
|
||||
; - terminates a rule
|
||||
? - indicates item is optional
|
||||
* - indicates item is repeated zero or more times
|
||||
+ - indicates item is repeated one or more times
|
||||
.R
|
||||
.DE
|
||||
The format of each rule in the table is:
|
||||
.DS
|
||||
.I
|
||||
rule : pattern global_restriction? ':' replacement
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
Each rule must be on a single line except that it may be broken after the
|
||||
colon if the next line begins with a tab character.
|
||||
The pattern has the syntax:
|
||||
.DS
|
||||
.I
|
||||
pattern : [ EM_mnem [ local_restriction ]? ]+
|
||||
;
|
||||
EM-mnem : "An EM instruction mnemonic"
|
||||
| 'lab'
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
and consists of a sequence of one or more EM instructions or
|
||||
.I lab
|
||||
which stands for a defined instruction label. Each EM-mnem may optionally be
|
||||
followed by a local restriction on the argument of the mnemonic and take
|
||||
one of the following forms depending on the type of the EM instruction it
|
||||
follows:
|
||||
.DS
|
||||
.I
|
||||
local_restriction : normal_restriction
|
||||
| opt_arg_restriction
|
||||
| ext_arg_restriction
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
A normal restriction is used after all types of EM instruction except for
|
||||
those that allow an optional argument, (such as
|
||||
.I adi
|
||||
) or those involving external names, (such as
|
||||
.I lae
|
||||
)
|
||||
and takes the form:
|
||||
.DS
|
||||
.I
|
||||
normal_restriction : [ rel_op ]? expression
|
||||
;
|
||||
rel_op : '=='
|
||||
| '!='
|
||||
| '<='
|
||||
| '<'
|
||||
| '>='
|
||||
| '>'
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
If the rel_op is missing, the equality
|
||||
.I ==
|
||||
operator is assumed. The general form of expression is defined later but
|
||||
basically it involves simple constants, references to EM_mnem arguments
|
||||
that appear earlier in the pattern and expressions similar to those used
|
||||
in C expressions.
|
||||
|
||||
The form of the restriction after those EM instructions like
|
||||
.I adi
|
||||
whose arguments are optional takes the form:
|
||||
.DS
|
||||
.I
|
||||
opt_arg_restriction : normal_restriction
|
||||
| 'defined'
|
||||
| 'undefined'
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
The
|
||||
.I defined
|
||||
and
|
||||
.I undefined
|
||||
indicate that the argument is present
|
||||
or absent respectively. The normal restriction form implies that the
|
||||
argument is present and satisfies the restriction.
|
||||
|
||||
The form of the restriction after those EM instructions like
|
||||
.I lae
|
||||
whose arguments refer to external object take the form:
|
||||
.DS
|
||||
.I
|
||||
ext_arg_restriction : patarg offset_part?
|
||||
;
|
||||
offset_part : [ '+' | '-' ] expression
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
Such an argument has one of three forms: a offset with no name, an
|
||||
offset form a name or an offset from a label. With no offset part
|
||||
the restriction requires the argument to be identical to a previous
|
||||
external argument. With an offset part it requires an identical name
|
||||
part, (either empty, same name or same label) and supplies a relationship
|
||||
among the offset parts. It is possible to refer to test for the same
|
||||
external argument, the same name or to obtain the offset part of an external
|
||||
argument using the
|
||||
.I sameext
|
||||
,
|
||||
.I samenam
|
||||
and
|
||||
.I offset
|
||||
functions given below.
|
||||
.LP
|
||||
The general form of an expression is:
|
||||
.DS
|
||||
.I
|
||||
expression : expression binop expression
|
||||
| unaryop expression
|
||||
| '(' expression ')'
|
||||
| bin_function '(' expression ',' expression ')'
|
||||
| ext_function '(' patarg ',' patarg ')'
|
||||
| 'offset' '(' patarg ')'
|
||||
| patarg
|
||||
| 'p'
|
||||
| 'w'
|
||||
| INTEGER
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
.DS
|
||||
.I
|
||||
bin_function : 'sfit'
|
||||
| 'ufit'
|
||||
| 'samesign'
|
||||
| 'rotate'
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
.DS
|
||||
.I
|
||||
ext_function : 'samenam'
|
||||
| 'sameext'
|
||||
;
|
||||
patarg : '$' INTEGER
|
||||
;
|
||||
binop : "As for C language"
|
||||
unaryop : "As for C language"
|
||||
.R
|
||||
.DE
|
||||
The INTEGER in the
|
||||
.I patarg
|
||||
refers to the first, second, etc. argument in the pattern and it is
|
||||
required to refer to a pattern that appears earlier in the pattern
|
||||
The
|
||||
.I w
|
||||
and
|
||||
.I p
|
||||
refer to the word size and pointer size (in bytes) respectively. The
|
||||
various function test for:
|
||||
.IP sfit 10
|
||||
the first argument fits as a signed value of
|
||||
the number of bit specified by the second argument.
|
||||
.IP ufit 10
|
||||
as for sfit but for unsigned values.
|
||||
.IP samesign 10
|
||||
the first argument has the same sign as the second.
|
||||
.IP rotate 10
|
||||
the value of the first argument rotated by the number of bit specified
|
||||
by the second argument.
|
||||
.IP samenam 10
|
||||
both arguments refer to externals and have either no name, the same name
|
||||
or same label.
|
||||
.IP sameext 10
|
||||
both arguments refer to the same external.
|
||||
.IP offset 10
|
||||
the argument is an external and this yields it offset part.
|
||||
|
||||
.LP
|
||||
The global restriction takes the form:
|
||||
.DS
|
||||
.I
|
||||
global_restriction : '?' expression
|
||||
;
|
||||
.R
|
||||
.DE
|
||||
and is used to express restrictions that cannot be expressed as simple
|
||||
restrictions on a single argument or are can be expressed in a more
|
||||
readable fashion as a global restriction. An example of such a rule is:
|
||||
.DS
|
||||
.I
|
||||
dup w ldl stf ? p==2*w : ldl $2 stf $3 ldl $2 lof $3
|
||||
.R
|
||||
.DE
|
||||
which says that this rule only applies if the pointer size is twice the
|
||||
word size.
|
||||
|
||||
.NH
|
||||
Incompatibilities with Previous Optimizer
|
||||
.LP
|
||||
The current table format is not compatible with previous versions of the
|
||||
peephole optimizer tables. In particular the previous table had no provision
|
||||
for local restrictions and only the equivalent of the global restriction.
|
||||
This meant that our
|
||||
.I '?'
|
||||
character that announces the presence of the optional global restriction was
|
||||
not required. The previous optimizer performed a number of other tasks that
|
||||
were unrelated to optimization that were possible because the old optimizer
|
||||
read the EM code for a complete procedure at a time. This included task such
|
||||
as register variable reference counting and moving the information regarding
|
||||
the number of bytes of local storage required by a procedure from it
|
||||
.I end
|
||||
pseudo instruction to it's
|
||||
.I pro
|
||||
pseudo instruction. These tasks are no longer done. If there are required
|
||||
then the must be performed by some other program in the pipeline.
|
||||
|
||||
.NH
|
||||
The Parser
|
||||
.LP
|
||||
The program to parse the tables and build the pattern table dependent dfa
|
||||
routines is built from the files:
|
||||
.IP parser.h 15
|
||||
header file
|
||||
.IP parser.g 15
|
||||
LLGen source file defining syntax of table
|
||||
.IP syntax.l 15
|
||||
Lex sources file defining form of tokens in table.
|
||||
.IP initlex.c 15
|
||||
Uses the data in the library
|
||||
.I em_data.a
|
||||
to initialize the lexical analyser to recognize EM instruction mnemonics.
|
||||
.IP outputdfa.c 15
|
||||
Routines to output dfa when it has been constructed.
|
||||
.IP outcalls.c 15
|
||||
Routines to output the file
|
||||
.I incalls.c
|
||||
defined in section 4.
|
||||
.IP findworst.c 15
|
||||
Routines to analyze patterns to find how to continue matching after a
|
||||
successful replacement or failed match.
|
||||
|
||||
.LP
|
||||
The parser checks that the tables conform to the syntax outlined in the
|
||||
previous section and also mades a number of semantic checks on their
|
||||
validity. Further versions could make further checks such as looking for
|
||||
cycles in the rules or checking that each replacement leaves the same
|
||||
number of bytes on the stack as the pattern it replaces. The parser
|
||||
builds an internal dfa representation of the rules by combining rules with
|
||||
common prefixes. All local and global restrictions are combined into a single
|
||||
test to be performed are a complete pattern has been detected in the input.
|
||||
The idea is to build a structure so that each of the patterns can be matched
|
||||
and then the corresponding tests made and the first that succeeds is replaced.
|
||||
If two rules have the same pattern and both their tests also succeed the one
|
||||
that appears first in the tables file will be done. Somewhat less obvious
|
||||
is that id one pattern is a proper prefix of a longer pattern and its test
|
||||
succeeds then the second pattern will not be checked for.
|
||||
|
||||
A major task of the parser if to decide on the action to take when a rule has
|
||||
been partially matched or when a pattern has been completely matched but its
|
||||
test does not succeed. This requires a search of all patterns to see if any
|
||||
part of the part matched could be part of some other pattern. for example
|
||||
given the two patterns:
|
||||
.DS
|
||||
.I
|
||||
loc adi w loc adi w : loc $1+$3 adi w
|
||||
loc adi w loc sbi w : loc $1-$3 adi w
|
||||
.R
|
||||
.DE
|
||||
If the first pattern fails after seeing the input:
|
||||
.DS
|
||||
.I
|
||||
loc adi loc
|
||||
.R
|
||||
.DE
|
||||
the parser will still need to check whether the second pattern matches.
|
||||
This requires a decision on how to fix up any internal data structures in
|
||||
the dfa matcher, such as moving some instructions from the pattern to the
|
||||
output queue and moving the pattern along and then deciding what state
|
||||
it should continue from. Similar decisions are requires after a pattern
|
||||
has been replaced. For example if the replacement is empty it is necessary
|
||||
to backup
|
||||
.I n-1
|
||||
instructions where
|
||||
.I n
|
||||
is the length of the longest pattern in the tables.
|
||||
|
||||
.NH
|
||||
Structure of the Resulting Library
|
||||
|
||||
.LP
|
||||
The major data structures maintained by the library consist of three queues;
|
||||
an
|
||||
.I output
|
||||
queue of instructions awaiting output, a
|
||||
.I pattern
|
||||
queue containing instructions that match the current prefix, and a
|
||||
.I backup
|
||||
queue of instructions that have been backed up over and need to be reparsed
|
||||
for further pattern matches.
|
||||
|
||||
.LP
|
||||
If no errors are detected by the parser in the tables it output the following
|
||||
files:
|
||||
.IP dfa.c 10
|
||||
this consists of a large switch statement that maintains the current state of
|
||||
the dfa and makes a transition to the next state if the next input instruction
|
||||
matches.
|
||||
.IP incalls.r 10
|
||||
this contains an entry for every EM instruction (plus
|
||||
.I lab
|
||||
) giving information on how to build a routine with the name
|
||||
.I C_xxx
|
||||
that conforms to the
|
||||
.I EM_CODE(3)
|
||||
modules interface. If the EM instruction does not appear in the tables
|
||||
patterns at all then the dfa routine is called to flush any current queued
|
||||
output and the the output
|
||||
.I O_xxx
|
||||
routine is called. If the EM instruction does appear in a pattern then the instruction is added onto the end of the pattern queue and the dfa routines called
|
||||
to attempted to make a transition. This file is input to the
|
||||
.I awk
|
||||
program
|
||||
.I makefuns.awk
|
||||
to produce individual C files with names like
|
||||
.I C_xxx.c
|
||||
each containing a single function definition. This enables the loader to
|
||||
only load those routines that are actually needed when the library is loaded.
|
||||
.IP trans.c 10
|
||||
this contains a routine that is called after each transition to a state that
|
||||
contains restrictions and replacements. The restrictions a converted to
|
||||
C expressions and the replacements coded as calls to output instructions
|
||||
into the output queue.
|
||||
|
||||
.LP
|
||||
The following files contain code that is independent of the pattern tables:
|
||||
.IP nopt.c 10
|
||||
general routines to initialize, and maintain the data structures.
|
||||
.IP aux.c 10
|
||||
routines to implement the functions used in the rules.
|
||||
.IP mkcalls.c 10
|
||||
code to convert the internal data structures to calls on the output
|
||||
.I O_xxx
|
||||
routines when the output queue is flushed.
|
||||
|
||||
.NH
|
||||
Miscellaneous Issues
|
||||
.LP
|
||||
The size of the output and backup queues are fixed in size according to the
|
||||
values of
|
||||
.I MAXOUTPUT
|
||||
and
|
||||
.I MAXBACKUP
|
||||
defined in the file
|
||||
.I nopt.h.
|
||||
The size of the pattern queue is set to the length of the maximum pattern
|
||||
length by the tables output by the parser. The queues are implemented as
|
||||
arrays of pointers to structures containing the instruction and its arguments.
|
||||
The space for the structures are initially obtained by calls to
|
||||
.I Malloc
|
||||
(from the
|
||||
.I alloc(3)
|
||||
module),
|
||||
and freed when the output queue or patterns queue is cleared. These freed
|
||||
structures are collected on a free list and reused to avoid the overheads
|
||||
of repeated calls to
|
||||
.I malloc
|
||||
and
|
||||
.I free.
|
||||
|
||||
.LP
|
||||
The fixed size of the output and pattern queues causes no difficulty in
|
||||
practice and can only result in some potential optimizations being missed.
|
||||
When the output queue fills it is simply prematurely flushed and backups
|
||||
when the backup queue is fill are simply ignored. A possible improvement
|
||||
would be to flush only part of the output queue when it fills. It should
|
||||
be noted that it is not possible to statically determine the maximum possible
|
||||
size for these queues as they need to be unbounded in the worst case. A
|
||||
study of the rule
|
||||
.DS
|
||||
.I
|
||||
inc dec :
|
||||
.R
|
||||
.DE
|
||||
with the input consisting of
|
||||
.I N
|
||||
.I inc
|
||||
and then
|
||||
.I N
|
||||
.I dec
|
||||
instructions requires an output queue length of
|
||||
.I N-1
|
||||
to find all possible replacements.
|
||||
@@ -1,303 +0,0 @@
|
||||
#ifndef NORCSID
|
||||
static char rcsid[] = "$Header$";
|
||||
#endif
|
||||
|
||||
#include "nopt.h"
|
||||
|
||||
static Linenumber = 0; /* Local optimization of lin to lni if possible */
|
||||
|
||||
OO_mkcalls(p)
|
||||
struct instr *p;
|
||||
{
|
||||
switch(p->opcode) {
|
||||
case op_aar:
|
||||
O_aar(p->acst); break;
|
||||
case op_adf:
|
||||
O_adf(p->acst); break;
|
||||
case op_adi:
|
||||
O_adi(p->acst); break;
|
||||
case op_adp:
|
||||
O_adp(p->acst); break;
|
||||
case op_ads:
|
||||
O_ads(p->acst); break;
|
||||
case op_adu:
|
||||
O_adu(p->acst); break;
|
||||
case op_and:
|
||||
O_and(p->acst); break;
|
||||
case op_asp:
|
||||
O_asp(p->acst); break;
|
||||
case op_ass:
|
||||
O_ass(p->acst); break;
|
||||
case op_beq:
|
||||
O_beq((label)p->acst); break;
|
||||
case op_bge:
|
||||
O_bge((label)p->acst); break;
|
||||
case op_bgt:
|
||||
O_bgt((label)p->acst); break;
|
||||
case op_ble:
|
||||
O_ble((label)p->acst); break;
|
||||
case op_blm:
|
||||
O_blm(p->acst); break;
|
||||
case op_bls:
|
||||
O_bls(p->acst); break;
|
||||
case op_blt:
|
||||
O_blt((label)p->acst); break;
|
||||
case op_bne:
|
||||
O_bne((label)p->acst); break;
|
||||
case op_bra:
|
||||
O_bra((label)p->acst); break;
|
||||
case op_cai:
|
||||
O_cai(); break;
|
||||
case op_cal:
|
||||
O_cal(p->apnam); break;
|
||||
case op_cff:
|
||||
O_cff(); break;
|
||||
case op_cfi:
|
||||
O_cfi(); break;
|
||||
case op_cfu:
|
||||
O_cfu(); break;
|
||||
case op_cif:
|
||||
O_cif(); break;
|
||||
case op_cii:
|
||||
O_cii(); break;
|
||||
case op_ciu:
|
||||
O_ciu(); break;
|
||||
case op_cmf:
|
||||
O_cmf(p->acst); break;
|
||||
case op_cmi:
|
||||
O_cmi(p->acst); break;
|
||||
case op_cmp:
|
||||
O_cmp(); break;
|
||||
case op_cms:
|
||||
O_cms(p->acst); break;
|
||||
case op_cmu:
|
||||
O_cmu(p->acst); break;
|
||||
case op_com:
|
||||
O_com(p->acst); break;
|
||||
case op_csa:
|
||||
O_csa(p->acst); break;
|
||||
case op_csb:
|
||||
O_csb(p->acst); break;
|
||||
case op_cuf:
|
||||
O_cuf(); break;
|
||||
case op_cui:
|
||||
O_cui(); break;
|
||||
case op_cuu:
|
||||
O_cuu(); break;
|
||||
case op_dch:
|
||||
O_dch(); break;
|
||||
case op_dec:
|
||||
O_dec(); break;
|
||||
case op_dee:
|
||||
if(p->argtype==nof_ptyp) O_dee_dlb(p->adlb, p->anoff);
|
||||
else O_dee_dnam(p->adnam, p->asoff); break;
|
||||
case op_del:
|
||||
O_del(p->acst); break;
|
||||
case op_dup:
|
||||
O_dup(p->acst); break;
|
||||
case op_dus:
|
||||
O_dus(p->acst); break;
|
||||
case op_dvf:
|
||||
O_dvf(p->acst); break;
|
||||
case op_dvi:
|
||||
O_dvi(p->acst); break;
|
||||
case op_dvu:
|
||||
O_dvu(p->acst); break;
|
||||
case op_exg:
|
||||
O_exg(p->acst); break;
|
||||
case op_fef:
|
||||
O_fef(p->acst); break;
|
||||
case op_fif:
|
||||
O_fif(p->acst); break;
|
||||
case op_fil:
|
||||
Linenumber = 0;
|
||||
if(p->argtype==nof_ptyp) O_fil_dlb(p->adlb, p->anoff);
|
||||
else O_fil_dnam(p->adnam, p->asoff); break;
|
||||
case op_gto:
|
||||
if(p->argtype==nof_ptyp) O_gto_dlb(p->adlb, p->anoff);
|
||||
else O_gto_dnam(p->adnam, p->asoff); break;
|
||||
case op_inc:
|
||||
O_inc(); break;
|
||||
case op_ine:
|
||||
if(p->argtype==nof_ptyp) O_ine_dlb(p->adlb, p->anoff);
|
||||
else O_ine_dnam(p->adnam, p->asoff); break;
|
||||
case op_inl:
|
||||
O_inl(p->acst); break;
|
||||
case op_inn:
|
||||
O_inn(p->acst); break;
|
||||
case op_ior:
|
||||
O_ior(p->acst); break;
|
||||
case op_lab:
|
||||
Linenumber = 0;
|
||||
O_df_ilb(p->alab); break;
|
||||
case op_lae:
|
||||
if(p->argtype==nof_ptyp) O_lae_dlb(p->adlb, p->anoff);
|
||||
else O_lae_dnam(p->adnam, p->asoff); break;
|
||||
case op_lal:
|
||||
O_lal(p->acst); break;
|
||||
case op_lar:
|
||||
O_lar(p->acst); break;
|
||||
case op_ldc:
|
||||
O_ldc(p->acst); break;
|
||||
case op_lde:
|
||||
if(p->argtype==nof_ptyp) O_lde_dlb(p->adlb, p->anoff);
|
||||
else O_lde_dnam(p->adnam, p->asoff); break;
|
||||
case op_ldf:
|
||||
O_ldf(p->acst); break;
|
||||
case op_ldl:
|
||||
O_ldl(p->acst); break;
|
||||
case op_lfr:
|
||||
O_lfr(p->acst); break;
|
||||
case op_lil:
|
||||
O_lil(p->acst); break;
|
||||
case op_lim:
|
||||
O_lim(); break;
|
||||
case op_lin:
|
||||
if(Linenumber && p->acst == ++Linenumber) {
|
||||
O_lni();
|
||||
}
|
||||
else {
|
||||
O_lin(p->acst);
|
||||
Linenumber = p->acst;
|
||||
}
|
||||
break;
|
||||
case op_lni:
|
||||
O_lni();
|
||||
Linenumber++;
|
||||
break;
|
||||
case op_loc:
|
||||
O_loc(p->acst); break;
|
||||
case op_loe:
|
||||
if(p->argtype==nof_ptyp) O_loe_dlb(p->adlb, p->anoff);
|
||||
else O_loe_dnam(p->adnam, p->asoff); break;
|
||||
case op_lof:
|
||||
O_lof(p->acst); break;
|
||||
case op_loi:
|
||||
O_loi(p->acst); break;
|
||||
case op_lol:
|
||||
O_lol(p->acst); break;
|
||||
case op_lor:
|
||||
O_lor(p->acst); break;
|
||||
case op_los:
|
||||
O_los(p->acst); break;
|
||||
case op_lpb:
|
||||
O_lpb(); break;
|
||||
case op_lpi:
|
||||
O_lpi(p->apnam); break;
|
||||
case op_lxa:
|
||||
O_lxa(p->acst); break;
|
||||
case op_lxl:
|
||||
O_lxl(p->acst); break;
|
||||
case op_mlf:
|
||||
O_mlf(p->acst); break;
|
||||
case op_mli:
|
||||
O_mli(p->acst); break;
|
||||
case op_mlu:
|
||||
O_mlu(p->acst); break;
|
||||
case op_mon:
|
||||
O_mon(); break;
|
||||
case op_ngf:
|
||||
O_ngf(p->acst); break;
|
||||
case op_ngi:
|
||||
O_ngi(p->acst); break;
|
||||
case op_nop:
|
||||
O_nop(); break;
|
||||
case op_rck:
|
||||
O_rck(p->acst); break;
|
||||
case op_ret:
|
||||
O_ret(p->acst); break;
|
||||
case op_rmi:
|
||||
O_rmi(p->acst); break;
|
||||
case op_rmu:
|
||||
O_rmu(p->acst); break;
|
||||
case op_rol:
|
||||
O_rol(p->acst); break;
|
||||
case op_ror:
|
||||
O_ror(p->acst); break;
|
||||
case op_rtt:
|
||||
O_rtt(); break;
|
||||
case op_sar:
|
||||
O_sar(p->acst); break;
|
||||
case op_sbf:
|
||||
O_sbf(p->acst); break;
|
||||
case op_sbi:
|
||||
O_sbi(p->acst); break;
|
||||
case op_sbs:
|
||||
O_sbs(p->acst); break;
|
||||
case op_sbu:
|
||||
O_sbu(p->acst); break;
|
||||
case op_sde:
|
||||
if(p->argtype==nof_ptyp) O_sde_dlb(p->adlb, p->anoff);
|
||||
else O_sde_dnam(p->adnam, p->asoff); break;
|
||||
case op_sdf:
|
||||
O_sdf(p->acst); break;
|
||||
case op_sdl:
|
||||
O_sdl(p->acst); break;
|
||||
case op_set:
|
||||
O_set(p->acst); break;
|
||||
case op_sig:
|
||||
O_sig(); break;
|
||||
case op_sil:
|
||||
O_sil(p->acst); break;
|
||||
case op_sim:
|
||||
O_sim(); break;
|
||||
case op_sli:
|
||||
O_sli(p->acst); break;
|
||||
case op_slu:
|
||||
O_slu(p->acst); break;
|
||||
case op_sri:
|
||||
O_sri(p->acst); break;
|
||||
case op_sru:
|
||||
O_sru(p->acst); break;
|
||||
case op_ste:
|
||||
if(p->argtype==nof_ptyp) O_ste_dlb(p->adlb, p->anoff);
|
||||
else O_ste_dnam(p->adnam, p->asoff); break;
|
||||
case op_stf:
|
||||
O_stf(p->acst); break;
|
||||
case op_sti:
|
||||
O_sti(p->acst); break;
|
||||
case op_stl:
|
||||
O_stl(p->acst); break;
|
||||
case op_str:
|
||||
O_str(p->acst); break;
|
||||
case op_sts:
|
||||
O_sts(p->acst); break;
|
||||
case op_teq:
|
||||
O_teq(); break;
|
||||
case op_tge:
|
||||
O_tge(); break;
|
||||
case op_tgt:
|
||||
O_tgt(); break;
|
||||
case op_tle:
|
||||
O_tle(); break;
|
||||
case op_tlt:
|
||||
O_tlt(); break;
|
||||
case op_tne:
|
||||
O_tne(); break;
|
||||
case op_trp:
|
||||
O_trp(); break;
|
||||
case op_xor:
|
||||
O_xor(p->acst); break;
|
||||
case op_zeq:
|
||||
O_zeq((label)p->acst); break;
|
||||
case op_zer:
|
||||
O_zer(p->acst); break;
|
||||
case op_zge:
|
||||
O_zge((label)p->acst); break;
|
||||
case op_zgt:
|
||||
O_zgt((label)p->acst); break;
|
||||
case op_zle:
|
||||
O_zle((label)p->acst); break;
|
||||
case op_zlt:
|
||||
O_zlt((label)p->acst); break;
|
||||
case op_zne:
|
||||
O_zne((label)p->acst); break;
|
||||
case op_zre:
|
||||
if(p->argtype==nof_ptyp) O_zre_dlb(p->adlb, p->anoff);
|
||||
else O_zre_dnam(p->adnam, p->asoff); break;
|
||||
case op_zrf:
|
||||
O_zrf(p->acst); break;
|
||||
case op_zrl:
|
||||
O_zrl(p->acst); break;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
# $Header$
|
||||
EMHOME = ../../..
|
||||
MODDIR=$(EMHOME)/modules
|
||||
INSTALL = $(MODDIR)/install
|
||||
COMPARE = $(MODDIR)/compare
|
||||
INCLUDES = -I. -I$(MODDIR)/h
|
||||
CFLAGS = -O $(INCLUDES) $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
LIBFLT = libflt.$(LIBSUF)
|
||||
|
||||
SRC = flt_ar2flt.c flt_div.c flt_flt2ar.c flt_modf.c flt_str2fl.c \
|
||||
flt_cmp.c flt_add.c b64_add.c flt_mul.c flt_nrm.c b64_sft.c \
|
||||
flt_umin.c flt_chk.c split.c ucmp.c
|
||||
|
||||
OBJ = flt_ar2flt.$(SUF) flt_div.$(SUF) flt_flt2ar.$(SUF) flt_modf.$(SUF) \
|
||||
flt_str2fl.$(SUF) flt_cmp.$(SUF) flt_add.$(SUF) b64_add.$(SUF) \
|
||||
flt_mul.$(SUF) flt_nrm.$(SUF) b64_sft.$(SUF) flt_umin.$(SUF) \
|
||||
flt_chk.$(SUF) split.$(SUF) ucmp.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: $(LIBFLT)
|
||||
|
||||
test: $(LIBFLT) test.o
|
||||
$(CC) -o tst test.o $(LIBFLT)
|
||||
./tst
|
||||
|
||||
$(LIBFLT): $(OBJ)
|
||||
rm -f $(LIBFLT)
|
||||
$(AR) r $(LIBFLT) $(OBJ)
|
||||
-sh -c 'ranlib $(LIBFLT)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/$(LIBFLT)
|
||||
$(INSTALL) h/flt_arith.h
|
||||
$(INSTALL) man/flt_arith.3
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/$(LIBFLT)
|
||||
-$(COMPARE) h/flt_arith.h
|
||||
-$(COMPARE) man/flt_arith.3
|
||||
|
||||
pr:
|
||||
@pr Makefile $(SRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) $(LIBFLT)
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Cflt $(SRC)
|
||||
mv llib-lflt.ln $(MODDIR)/lib
|
||||
|
||||
b64_add.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_ar2flt.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_div.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_nrm.$(SUF): flt_misc.h flt_arith.h
|
||||
b64_sft.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_chk.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_flt2ar.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_str2fl.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_add.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_cmp.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_mul.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_modf.$(SUF): flt_misc.h flt_arith.h
|
||||
flt_umin.$(SUF): flt_misc.h
|
||||
ucmp.$(SUF): flt_misc.h flt_arith.h
|
||||
split.$(SUF): flt_misc.h flt_arith.h
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1989 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#include <flt_arith.h>
|
||||
|
||||
/* some short-hands ... */
|
||||
#define m1 flt_mantissa.flt_h_32
|
||||
#define m2 flt_mantissa.flt_l_32
|
||||
|
||||
/* some constants */
|
||||
#define EXT_MAX 16384 /* max exponent */
|
||||
#define EXT_MIN (-16384) /* min exponent */
|
||||
|
||||
/* hiding of names: */
|
||||
#define ucmp flt__ucmp
|
||||
#define flt_nrm flt__nrm
|
||||
#define flt_chk flt__chk
|
||||
#define flt_b64_add flt__64add
|
||||
#define flt_split flt__split
|
||||
@@ -1,23 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
|
||||
all:
|
||||
|
||||
install: all
|
||||
$(INSTALL) pkg/idf_pkg.body
|
||||
$(INSTALL) pkg/idf_pkg.spec
|
||||
$(INSTALL) man/idf.3
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) pkg/idf_pkg.body
|
||||
-$(COMPARE) pkg/idf_pkg.spec
|
||||
-$(COMPARE) man/idf.3
|
||||
|
||||
pr:
|
||||
@pr Makefile idf_pkg.spec idf_pkg.body
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
@@ -1,46 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODULES = $(EMHOME)/modules
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
CFLAGS = -O $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
OBJECTS = AtEoIF.$(SUF)\
|
||||
AtEoIT.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: libinput.$(LIBSUF)
|
||||
|
||||
libinput.$(LIBSUF): $(OBJECTS)
|
||||
$(AR) cr libinput.$(LIBSUF) $(OBJECTS)
|
||||
-sh -c 'ranlib libinput.$(LIBSUF)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libinput.$(LIBSUF)
|
||||
$(INSTALL) man/input.3
|
||||
$(INSTALL) pkg/inp_pkg.body
|
||||
$(INSTALL) pkg/inp_pkg.spec
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/libinput.$(LIBSUF)
|
||||
-$(COMPARE) man/input.3
|
||||
-$(COMPARE) pkg/inp_pkg.body
|
||||
-$(COMPARE) pkg/inp_pkg.spec
|
||||
|
||||
pr:
|
||||
@pr Makefile inp_pkg.spec inp_pkg.body AtEoIF.c AtEoIT.c
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF)
|
||||
|
||||
lintlib:
|
||||
lint -Cinput AtEoIF.c AtEoIT.c
|
||||
mv llib-linput.ln $(MODULES)/lib
|
||||
@@ -1,44 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
CFLAGS = -O -I$(EMHOME)/modules/h $(COPT)
|
||||
SUF = o
|
||||
RCC = cc #$ must produce a runnable object
|
||||
|
||||
MALLOCSRC = READ_ME size_type.h gensize_type.h param.h impl.h check.h log.h phys.h \
|
||||
mal.c log.c phys.c check.c
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: malloc.$(SUF)
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/malloc.$(SUF)
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/malloc.$(SUF)
|
||||
|
||||
malloc1.c: $(MALLOCSRC) Makefile add_file
|
||||
rm -f malloc1.c
|
||||
for i in $(MALLOCSRC) ; do add_file $$i >> malloc1.c ; done
|
||||
|
||||
malloc.c: malloc1.c
|
||||
cclash -l7 -c malloc1.c > clashes
|
||||
cid -Fclashes < malloc1.c > malloc.c
|
||||
|
||||
pr:
|
||||
@pr Makefile add_file $(MALLOCSRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) clashes malloc1.c gensize_type.h getsize malloc.c
|
||||
|
||||
gensize_type.h: getsize
|
||||
getsize > gensize_type.h
|
||||
|
||||
getsize: getsize.c
|
||||
$(RCC) -o getsize getsize.c
|
||||
@@ -1,80 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODULES = $(EMHOME)/modules
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
INCLUDES = -I$(EMHOME)/h
|
||||
CFLAGS = -O $(INCLUDES) $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
RCC = cc # must produce a runnable object
|
||||
|
||||
CFILES = rd_arhdr.c wr_arhdr.c \
|
||||
rd_ranlib.c wr_ranlib.c \
|
||||
rd_bytes.c wr_bytes.c \
|
||||
rd.c wr.c \
|
||||
wr_putc.c \
|
||||
rd_int2.c wr_int2.c \
|
||||
rd_unsig2.c \
|
||||
rd_long.c wr_long.c
|
||||
# do not change the order in OFILES
|
||||
OFILES = rd.$(SUF) rd_arhdr.$(SUF) rd_int2.$(SUF) rd_long.$(SUF) rd_ranlib.$(SUF) rd_unsig2.$(SUF) \
|
||||
rd_bytes.$(SUF) wr_arhdr.$(SUF) wr_int2.$(SUF) wr_long.$(SUF) wr_putc.$(SUF) wr.$(SUF) \
|
||||
wr_ranlib.$(SUF) wr_bytes.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: libobject.$(LIBSUF)
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libobject.$(LIBSUF)
|
||||
$(INSTALL) man/object.3
|
||||
|
||||
compare: all
|
||||
-$(COMPARE) lib/libobject.$(LIBSUF)
|
||||
-$(COMPARE) man/object.3
|
||||
|
||||
pr:
|
||||
@pr Makefile byte_order.c object.h $(CFILES)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF) nohup.out Out byte_order byte_order.h
|
||||
|
||||
libobject.$(LIBSUF): $(OFILES)
|
||||
$(AR) r libobject.$(LIBSUF) $(OFILES)
|
||||
-sh -c 'ranlib libobject.$(LIBSUF)'
|
||||
|
||||
depend: byte_order.h
|
||||
sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new
|
||||
echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new
|
||||
mkdep $(CFILES) | sed 's/\.c:/\.$(SUF):/' >> Makefile.new
|
||||
mv Makefile Makefile.$(SUF)ld
|
||||
mv Makefile.new Makefile
|
||||
|
||||
byte_order: byte_order.c
|
||||
$(RCC) -o byte_order byte_order.c
|
||||
|
||||
byte_order.h: byte_order
|
||||
byte_order > byte_order.h
|
||||
|
||||
lintlib: byte_order.h
|
||||
lint $(INCLUDES) -Cobject $(CFILES)
|
||||
mv llib-lobject.ln $(MODULES)/lib
|
||||
|
||||
#AUTOAUTOAUTOAUTOAUTOAUTOAUTO
|
||||
rd_arhdr.$(SUF): byte_order.h object.h
|
||||
wr_arhdr.$(SUF): byte_order.h object.h
|
||||
rd_ranlib.$(SUF): byte_order.h object.h
|
||||
wr_ranlib.$(SUF): byte_order.h object.h
|
||||
rd.$(SUF): byte_order.h object.h
|
||||
wr.$(SUF): byte_order.h object.h
|
||||
rd_int2.$(SUF): byte_order.h object.h
|
||||
wr_int2.$(SUF): byte_order.h object.h
|
||||
rd_unsig2.$(SUF): byte_order.h object.h
|
||||
rd_long.$(SUF): byte_order.h object.h
|
||||
wr_long.$(SUF): byte_order.h object.h
|
||||
@@ -1,54 +0,0 @@
|
||||
/* $Header$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
char bytes_reversed = 0;
|
||||
char words_reversed = 0;
|
||||
char char_unsigned = 0;
|
||||
|
||||
/*
|
||||
* Determine the byte/word order in shorts/longs, assuming the size of a short
|
||||
* is 2 chars, and the size of a long is 4 chars. Not all theoretical
|
||||
* possibilities are tested; only bytes reversed and/or words reversed.
|
||||
*/
|
||||
determine_ordering()
|
||||
{
|
||||
short s;
|
||||
long l;
|
||||
register char *cp;
|
||||
register short *sp;
|
||||
|
||||
cp = (char *)&s;
|
||||
cp[0] = 0x01; cp[1] = 0x02;
|
||||
if (s != 0x01 + (0x02 << 8))
|
||||
bytes_reversed = 1;
|
||||
sp = (short *)&l;
|
||||
sp[0] = 0x0001; sp[1] = 0x0002;
|
||||
if (l != 0x0001 + (0x0002L << 16))
|
||||
words_reversed = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* determine whether characters are unsigned or signed
|
||||
*/
|
||||
|
||||
uns_char()
|
||||
{
|
||||
char c = 0200;
|
||||
int i = c;
|
||||
|
||||
if (i > 0) char_unsigned = 1;
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
determine_ordering();
|
||||
uns_char();
|
||||
printf("#define BYTES_REVERSED %d\n", bytes_reversed);
|
||||
printf("#define WORDS_REVERSED %d\n", words_reversed);
|
||||
printf("#define CHAR_UNSIGNED %d\n", char_unsigned);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODDIR=$(EMHOME)/modules
|
||||
INSTALL = $(MODDIR)/install
|
||||
COMPARE = $(MODDIR)/compare
|
||||
INCLUDES = -I$(MODDIR)/h
|
||||
CFLAGS = -O $(INCLUDES) $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
LIBPRINT = libprint.$(LIBSUF)
|
||||
|
||||
SRC = doprnt.c fprint.c print.c sprint.c format.c
|
||||
OBJ = doprnt.$(SUF) fprint.$(SUF) print.$(SUF) sprint.$(SUF) format.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: $(LIBPRINT)
|
||||
|
||||
$(LIBPRINT): $(OBJ)
|
||||
rm -f $(LIBPRINT)
|
||||
$(AR) r $(LIBPRINT) $(OBJ)
|
||||
-sh -c 'ranlib $(LIBPRINT)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/$(LIBPRINT)
|
||||
$(INSTALL) man/print.3
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/$(LIBPRINT)
|
||||
-$(COMPARE) man/print.3
|
||||
|
||||
pr:
|
||||
@pr Makefile $(SRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) $(LIBPRINT)
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Cprint $(SRC)
|
||||
mv llib-lprint.ln $(MODDIR)/lib
|
||||
|
||||
doprnt.$(SUF): param.h
|
||||
fprint.$(SUF): param.h
|
||||
print.$(SUF): param.h
|
||||
sprint.$(SUF): param.h
|
||||
@@ -1,119 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODULES = $(EMHOME)/modules
|
||||
HDIR = $(MODULES)/h
|
||||
EMHDIR = $(EMHOME)/h
|
||||
INCLUDES = -I$(HDIR) -I$(EMHDIR)
|
||||
DEFINES = -DPRIVATE=static -DEXPORT=
|
||||
CFLAGS = -O $(INCLUDES) $(DEFINES) $(COPT)
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
TARGETS = libread_emk.$(LIBSUF)\
|
||||
libread_emkV.$(LIBSUF)\
|
||||
libread_emeV.$(LIBSUF) # makecallsO.$(SUF) makecallsCE.$(SUF)
|
||||
|
||||
ESRCFILES = read_em.c\
|
||||
mkcalls.c\
|
||||
EM_vars.c
|
||||
|
||||
KSRCFILES = read_em.c\
|
||||
mkcalls.c\
|
||||
EM_vars.c
|
||||
|
||||
SRCFILES = em_comp.h\
|
||||
read_em.c\
|
||||
reade.c\
|
||||
readk.c \
|
||||
mkcalls.c\
|
||||
EM_vars.c
|
||||
|
||||
EV_OFILES = read_emeV.$(SUF) makecallsV.$(SUF) EM_vars.$(SUF)
|
||||
KV_OFILES = read_emkV.$(SUF) makecallsV.$(SUF) EM_vars.$(SUF)
|
||||
K_OFILES = read_emk.$(SUF) makecalls.$(SUF) EM_vars.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
install: all
|
||||
$(INSTALL) h/em_comp.h
|
||||
$(INSTALL) lib/libread_emk.$(LIBSUF)
|
||||
$(INSTALL) lib/libread_emkV.$(LIBSUF)
|
||||
$(INSTALL) lib/libread_emeV.$(LIBSUF)
|
||||
$(INSTALL) man/read_em.3
|
||||
# $(INSTALL) lib/makecallsO.$(SUF)
|
||||
# $(INSTALL) lib/makecallsCE.$(SUF)
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) h/em_comp.h
|
||||
-$(COMPARE) lib/libread_emk.$(LIBSUF)
|
||||
-$(COMPARE) lib/libread_emkV.$(LIBSUF)
|
||||
-$(COMPARE) lib/libread_emeV.$(LIBSUF)
|
||||
-$(COMPARE) man/read_em.3
|
||||
# -$(COMPARE) lib/makecallsO.$(SUF)
|
||||
# -$(COMPARE) lib/makecallsCE.$(SUF)
|
||||
|
||||
pr:
|
||||
@pr Makefile m_C_mnem m_C_mnem_na argtype $(SRCFILES)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF) C_mnem C_mnem_narg
|
||||
|
||||
libread_emk.$(LIBSUF): $(K_OFILES)
|
||||
$(AR) r libread_emk.$(LIBSUF) $(K_OFILES)
|
||||
-sh -c 'ranlib libread_emk.$(LIBSUF)'
|
||||
|
||||
libread_emkV.$(LIBSUF): $(KV_OFILES)
|
||||
$(AR) r libread_emkV.$(LIBSUF) $(KV_OFILES)
|
||||
-sh -c 'ranlib libread_emkV.$(LIBSUF)'
|
||||
|
||||
libread_emeV.$(LIBSUF): $(EV_OFILES)
|
||||
$(AR) r libread_emeV.$(LIBSUF) $(EV_OFILES)
|
||||
-sh -c 'ranlib libread_emeV.$(LIBSUF)'
|
||||
|
||||
read_emk.$(SUF): read_em.c em_comp.h readk.c
|
||||
$(CC) -c $(CFLAGS) -DCOMPACT read_em.c
|
||||
mv read_em.$(SUF) read_emk.$(SUF)
|
||||
|
||||
read_emkV.$(SUF): read_em.c em_comp.h readk.c
|
||||
$(CC) -c $(CFLAGS) -DCOMPACT -DCHECKING read_em.c
|
||||
mv read_em.$(SUF) read_emkV.$(SUF)
|
||||
|
||||
read_emeV.$(SUF): read_em.c em_comp.h reade.c
|
||||
$(CC) -c $(CFLAGS) -DCHECKING read_em.c
|
||||
mv read_em.$(SUF) read_emeV.$(SUF)
|
||||
|
||||
makecalls.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c
|
||||
$(CC) -c $(CFLAGS) mkcalls.c
|
||||
mv mkcalls.$(SUF) makecalls.$(SUF)
|
||||
|
||||
makecallsV.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c
|
||||
$(CC) -c $(CFLAGS) -DCHECKING mkcalls.c
|
||||
mv mkcalls.$(SUF) makecallsV.$(SUF)
|
||||
|
||||
makecallsO.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c
|
||||
$(CC) -c -DPEEPHOLE $(CFLAGS) mkcalls.c
|
||||
mv mkcalls.$(SUF) makecallsO.$(SUF)
|
||||
|
||||
makecallsCE.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c
|
||||
$(CC) -c -DCODE_EXPANDER $(CFLAGS) mkcalls.c
|
||||
mv mkcalls.$(SUF) makecallsCE.$(SUF)
|
||||
|
||||
C_mnem: m_C_mnem argtype
|
||||
sh m_C_mnem > C_mnem
|
||||
|
||||
C_mnem_narg: m_C_mnem_na argtype
|
||||
sh m_C_mnem_na > C_mnem_narg
|
||||
|
||||
lintlib: C_mnem C_mnem_narg
|
||||
lint $(INCLUDES) $(DEFINES) -DCOMPACT -DCHECKING -Cread_emkV $(KSRCFILES)
|
||||
lint $(INCLUDES) $(DEFINES) -DCHECKING -Cread_emeV $(ESRCFILES)
|
||||
mv llib-lread_emeV.ln llib-lread_emkV.ln $(MODULES)/lib
|
||||
@@ -1,25 +0,0 @@
|
||||
EM_TABLE=../../../etc/em_table
|
||||
ed - $EM_TABLE << EOF
|
||||
1,/^\$/d
|
||||
1,/^\$/d
|
||||
1,\$s/^\(...\).*/int C_\\1();/
|
||||
w blabla1
|
||||
q
|
||||
EOF
|
||||
ed - $EM_TABLE << A
|
||||
1,/^\$/d
|
||||
1,/^\$/d
|
||||
/^\$/d
|
||||
1,\$s/^\(...\).*/C_\\1,/
|
||||
\$a
|
||||
};
|
||||
.
|
||||
1i
|
||||
static int (*C_funcs[])() = {
|
||||
0,
|
||||
.
|
||||
w blabla2
|
||||
q
|
||||
A
|
||||
cat blabla1 blabla2 > C_funcs
|
||||
rm blabla1 blabla2
|
||||
@@ -1,49 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODULES = $(EMHOME)/modules
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
CFLAGS = -O $(COPT)
|
||||
|
||||
SRC = bts2str.c btscat.c btscmp.c btscpy.c btszero.c long2str.c \
|
||||
str2bts.c str2long.c strcat.c strcmp.c strcpy.c strindex.c \
|
||||
strlen.c strncat.c strncmp.c strncpy.c strrindex.c strzero.c
|
||||
OBJ = bts2str.$(SUF) btscat.$(SUF) btscmp.$(SUF) btscpy.$(SUF) \
|
||||
btszero.$(SUF) long2str.$(SUF) str2bts.$(SUF) str2long.$(SUF) \
|
||||
strcat.$(SUF) strcmp.$(SUF) strcpy.$(SUF) strindex.$(SUF) \
|
||||
strlen.$(SUF) strncat.$(SUF) strncmp.$(SUF) strncpy.$(SUF) \
|
||||
strrindex.$(SUF) strzero.$(SUF)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: libstring.$(LIBSUF)
|
||||
|
||||
libstring.$(LIBSUF): $(OBJ) Makefile
|
||||
$(AR) r libstring.$(LIBSUF) $(OBJ)
|
||||
-sh -c 'ranlib libstring.$(LIBSUF)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/libstring.$(LIBSUF)
|
||||
$(INSTALL) man/string.3
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/libstring.$(LIBSUF)
|
||||
-$(COMPARE) man/string.3
|
||||
|
||||
pr:
|
||||
@pr Makefile $(SRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF)
|
||||
|
||||
lintlib:
|
||||
lint -Cstring $(SRC)
|
||||
mv llib-lstring.ln $(MODULES)/lib
|
||||
@@ -1,63 +0,0 @@
|
||||
EMHOME = ../../..
|
||||
MODULES = $(EMHOME)/modules
|
||||
INSTALL = $(MODULES)/install
|
||||
COMPARE = $(MODULES)/compare
|
||||
INCLUDES = -I.
|
||||
CFLAGS = $(INCLUDES) -O $(COPT)
|
||||
AR = ar
|
||||
SUF = o
|
||||
LIBSUF = a
|
||||
|
||||
LIBSYS = libsystem.$(LIBSUF)
|
||||
OBJ = access.$(SUF) break.$(SUF) chmode.$(SUF) close.$(SUF) create.$(SUF) \
|
||||
filesize.$(SUF) modtime.$(SUF) lock.$(SUF) open.$(SUF) read.$(SUF) \
|
||||
remove.$(SUF) stop.$(SUF) system.$(SUF) time.$(SUF) unlock.$(SUF) \
|
||||
write.$(SUF) seek.$(SUF) rename.$(SUF)
|
||||
CSRC = access.c break.c chmode.c close.c create.c filesize.c \
|
||||
modtime.c lock.c open.c read.c remove.c stop.c \
|
||||
system.c time.c unlock.c write.c seek.c rename.c
|
||||
SRC = Makefile system.h $(CSRC)
|
||||
|
||||
.SUFFIXES: .$(SUF)
|
||||
.c.$(SUF):
|
||||
$(CC) -c $(CFLAGS) $*.c
|
||||
|
||||
all: $(LIBSYS)
|
||||
|
||||
$(LIBSYS): $(OBJ)
|
||||
rm -f $(LIBSYS)
|
||||
$(AR) r $(LIBSYS) $(OBJ)
|
||||
-sh -c 'ranlib $(LIBSYS)'
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/$(LIBSYS)
|
||||
$(INSTALL) man/system.3
|
||||
$(INSTALL) h/system.h
|
||||
|
||||
cmp: all
|
||||
-$(COMPARE) lib/$(LIBSYS)
|
||||
-$(COMPARE) man/system.3
|
||||
-$(COMPARE) h/system.h
|
||||
|
||||
clean:
|
||||
rm -f *.$(SUF) *.$(LIBSUF)
|
||||
|
||||
pr:
|
||||
@pr $(SRC)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
lintlib:
|
||||
lint $(INCLUDES) -Csystem $(CSRC)
|
||||
mv llib-lsystem.ln $(MODULES)/lib
|
||||
|
||||
access.$(SUF): system.h
|
||||
break.$(SUF): system.h
|
||||
close.$(SUF): system.h
|
||||
create.$(SUF): system.h
|
||||
open.$(SUF): system.h
|
||||
read.$(SUF): system.h
|
||||
stop.$(SUF): system.h
|
||||
system.$(SUF): system.h
|
||||
write.$(SUF): system.h
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Header$ */
|
||||
/* called by /lib/crt0.o; needed to suppress the loading of the
|
||||
standard exit() which performs unnecessary cleanup actions
|
||||
*/
|
||||
|
||||
exit(n)
|
||||
{
|
||||
_exit(n);
|
||||
}
|
||||
Reference in New Issue
Block a user