head     56.1;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.1
date     91.11.05.09.27.49;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.05.28;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.14.45;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.15.26;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.00.33;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.15.59.30;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.13.02;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.01.37;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.07.23;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.43.29;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.32.04;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.39.01;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.21.56.42;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.13.46.36;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.32.08;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.14.35;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.37.34;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.22.54;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.13.06;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.26.10;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.05.10;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.15.32;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.15.51.18;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.27.13;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.32.28;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.17.53.27;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.31.35;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.15.51;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.46.06;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.09.41;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.12.24.13;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.03.12;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.06.58;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.09.44.16;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.10.23.26;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.12.04;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.10.22.00;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.07.41.10;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.14.34.02;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.09.49.19;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.07.49;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.08.30.58;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.14.20.46;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.17.58.02;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.12.43.16;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.09.46;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.10.13.55;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.13.33.36;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.12.11;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.12.57.41;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.16.54.02;  author paws;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.14.14.50;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.10.08.11.21.19;  author geli;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@/*      SCCS    REV(31.1);      DATE(85/08/13   14:32:18) */
/* KLEENIX_ID @@(#)mfile2        31.1 85/07/23 */

# include "macdefs"
# include "mac2defs"
# include "manifest"

# ifdef ONEPASS

/*      bunch of stuff for putting the passes together... */
# define crslab crs2lab
# define where where2

# ifdef DEBUGGING
#       define xdebug x2debug
#       define edebug e2debug
#       define tdebug t2debug
#endif

# define deflab def2lab
# define eprint e2print
# define getlab get2lab
# define filename ftitle
# endif

/*      cookies, used as arguments to codgen */

# define FOREFF 01 /* compute for effects only */
# define INAREG 02 /* compute into a register */
# define INTAREG 04 /* compute into a scratch register */
# define INBREG 010 /* compute into a lvalue register */
# define INTBREG 020 /* compute into a scratch lvalue register */
# define FORCC 040 /* compute for condition codes only */
# define INTEMP 010000 /* compute into a temporary location */
# define FORARG 020000 /* compute for an argument of a function */
# define FORREW 040000 /* search the table, looking for a rewrite rule */
# define INTFREG 0200000 /* compute into a flt reguster (all are temps) */
# define FORARGP 0400000 /* compute for an argument of a pascal function */

	/* OP descriptors */
	/* the ASG operator may be used on some of these */

# define OPSIMP 010000    /* +, -, &, |, ^ */
# define OPCOMM 010002  /* +, &, |, ^ */
# define OPMUL 010004  /* *, / */
# define OPDIV 010006 /* /, % */
# define OPUNARY 010010  /* unary ops */
# define OPLEAF 010012  /* leaves */
# define OPANY 010014  /* any op... */
# define OPLOG 010016 /* logical ops */
# define OPFLOAT 010020 /* +, -, *, or / (for floats) */
# define OPSHFT 010022  /* <<, >> */
# define OPLTYPE 010024  /* leaf type nodes (e.g, NAME, ICON, etc. ) */

	/* match returns */

# define MNOPE 010000
# define MDONE 010001

	/* shapes */

# define SANY 01        /* same as FOREFF */
# define SAREG 02       /* same as INAREG */
# define STAREG 04      /* same as INTAREG */
# define SBREG 010      /* same as INBREG */
# define STBREG 020     /* same as INTBREG */
# define SCC 040        /* same as FORCC */
# define SNAME 0100
# define SCON 0200
# define SFLD 0400
# define SOREG 01000
# define STARNM 02000
# define STARREG 04000
# define SPECIAL 0100000
# define STFREG  0200000        /* all fregs are temporaries */
# define SWADD   040000000      /* this shape never used on MC68000 */
/* additional specials defined in mac2defs */

	/* FORARG and INTEMP are carefully not conflicting with shapes */

	/* types */

# define TCHAR 01
# define TSHORT 02
# define TINT 04
# define TLONG 010
# define TFLOAT 020
# define TDOUBLE 040
# define TPOINT 0100
# define TUCHAR 0200
# define TUSHORT 0400
# define TUNSIGNED 01000
# define TULONG 02000
# define TPTRTO 04000  /* pointer to one of the above */
# define TANY 010000  /* matches anything within reason */
# define TSTRUCT 020000   /* structure or union */

	/* reclamation cookies */

# define RNULL 0    /* clobber result */
# define RLEFT 01
# define RRIGHT 02
# define RESC1 04
# define RESC2 010
# define RESC3 020
# define RESC4 040
# define RESC5 0100
# define RESCC 04000
# define RNOP 010000   /* DANGER: can cause loops.. */

	/* needs */

# define NAREG 01               /* need an A reg */
# define NACOUNT 03             /* a mask */
# define NAMASK 017             /* a mask */
# define NASL 04                /* share left A register */
# define NASR 010               /* share right A register */
# define NBREG 020              /* need a B reg */
# define NBCOUNT 060            /* a mask */
# define NBMASK 0360            /* a mask */
# define NBSL 0100              /* share left B reg */
# define NBSR 0200              /* share right B reg */
# define NTEMP 0400
# define NTMASK 07400           /* a mask */
# define REWRITE 010000
# define NFREG 020000           /* need an F reg */
# define NFCOUNT 060000         /* a mask */
# define NFMASK 0360000         /* a mask */
# define NFSL 0100000           /* share left F reg */
# define NFSR 0200000           /* share right F reg */


# define MUSTDO 010000   /* force register requirements */
# define NOPREF 020000  /* no preference for register assignment */


	/* register allocation */

extern unsigned rstatus[];
extern short busy[];

extern struct respref { int cform; int mform; } respref[];

# define isbreg(r) (rstatus[r]&SBREG)
# define isfreg(r) (rstatus[r]&STFREG)
# define istreg(r) (rstatus[r]&(STBREG|STAREG|STFREG))
# define istnode(p) (p->in.op==REG && istreg(p->tn.rval))
# define istfnode(p) (p->in.op==REG && isfreg(p->tn.rval))

# define TBUSY 01000
# define REGLOOP(i) for(i=0;i<REGSZ;++i)

# define SETSTO(x,y) (stotree=(x),stocook=(y))
# define DELAYS 20

extern int stocook;
extern NODE *deltrees[DELAYS];
extern int deli;   /* mmmmm */

extern NODE *stotree;
extern short callflag;
extern short fcallflag;                 /* used in sucomp() */

extern int fregs;                       /* # available type A scratch regs */
extern int ffregs;                      /* # available type F scratch regs */

# ifndef ONEPASS
union ndu {

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;       /* su for flt pt regs */
		flag fhwside;   /* true iff on side of tree for fhw */
		flag onebit;    /* true iff appropriate node for FLD btst */
		char *name;
		int nameunused; /* spacer to prevent overlap of left/stalign */
		NODE *left;
		NODE *right;
		}in; /* interior node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;   /* true iff on side of tree for fhw */
		flag onebit;    /* true iff appropriate node for FLD btst */
		char *name;
		int nameunused; /* spacer to prevent overlap of left/stalign */
		CONSZ lval;
		int rval;
		}tn; /* terminal node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;   /* true iff on side of tree for fhw */
		flag onebit;    /* true iff appropriate node for FLD btst */
		int label;  /* for use with branching */
		}bn; /* branch node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;   /* true iff on side of tree for fhw */
		flag onebit;    /* true iff appropriate node for FLD btst */
		int stsize;  /* sizes of structure objects */
		int stalign;  /* alignment of structure objects */
		}stn; /* structure node */

	};
#endif

extern NODE *node;
extern NODE resc[];

extern struct optab {
	short op;
	int visit;
	int lshape;
	int ltype;
	int rshape;
	int rtype;
	int needs;
	int rewrite;
	char * cstring;
	}
	table[];

extern OFFSZ tmpoff;
extern OFFSZ maxoff;
extern OFFSZ baseoff;
extern OFFSZ maxtemp;
extern int maxtreg;
extern int ftnno;
extern short nrecur;

# define NRECUR (10*TREESZ)

extern NODE
	*talloc(),
	*eread(),
	*tcopy(),
	*makety2(),
	*getlr();

extern CONSZ rdin();

extern int eprint();
extern int hardops();           /* in local2.c */

extern char *rnames[];
extern char *addtreeasciz();    /* in common or comm1.c */

extern int lineno;
extern char filename[];
extern int fldshf, fldsz;
extern flag lflag;
extern flag fphwflag;           /* in reader.c */

# ifdef DEBUGGING
extern flag ddebug;
extern flag d2debug;    /* pass 2 */
extern flag edebug;
extern flag fdebug;
extern flag odebug;
extern flag radebug;
extern flag rdebug;
extern flag sdebug;
extern flag tdebug;
extern flag udebug;
extern flag xdebug;
# endif

#ifndef callchk
#define callchk(x) allchk()
#endif

#ifndef PUTCHAR
# define PUTCHAR(x) putc(x,outfile)
#endif

	/* macros for doing double indexing */
# define R2PACK(x,y) (0200*((x)+1)+y)
# define R2UPK1(x) ((((x)>>7)&0177)-1)
# define R2UPK2(x) ((x)&0177)
# define R2TEST(x) ((x)>=0200)

# define MAXFFREGS 8            /* # float hw regs */

# define HWFLAG         "float_soft"
# define FHWCARDADDR    "float_loc"
# define BOGUS4         "float_loc+0x18"
# define BOGUS4S        "float_loc+0x16"
# define FCHECKOFF      "#3,float_loc+0x21"     /* offset for fhw status */
# define FHWERROR       "asm_flpt_error"/* fhw error handler in libraries */

#ifdef hp9000s200
#       define setincr(x)       0       /* don't bother */
#endif
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@@


1.1
log
@Initial revision
@
text
@@
