xref: /csrg-svn/old/pcc/c2.vax/c2.h (revision 1507)
1*1507Sbill /*static	char sccsid[] = "@(#)c2.h 4.2 10/18/80";*/
2*1507Sbill /* @(#)c2.h 1.19 80/08/26 13:39:07 */
31494Sbill /*
41494Sbill  * Header for object code improver
51494Sbill  */
61494Sbill 
71494Sbill #define	JBR	1
81494Sbill #define	CBR	2
91494Sbill #define	JMP	3
101494Sbill #define	LABEL	4
111494Sbill #define	DLABEL	5
121494Sbill #define	EROU	7
131494Sbill #define	JSW	9
141494Sbill #define	MOV	10
151494Sbill #define	CLR	11
161494Sbill #define	INC	12
171494Sbill #define	DEC	13
181494Sbill #define	TST	14
191494Sbill #define	PUSH	15
201494Sbill #define CVT 16
211494Sbill #define	CMP	17
221494Sbill #define	ADD	18
231494Sbill #define	SUB	19
241494Sbill #define	BIT	20
251494Sbill #define	BIC	21
261494Sbill #define	BIS	22
271494Sbill #define	XOR	23
281494Sbill #define	COM	24
291494Sbill #define	NEG	25
301494Sbill #define	MUL	26
311494Sbill #define	DIV	27
321494Sbill #define	ASH	28
331494Sbill #define EXTV	29
341494Sbill #define EXTZV	30
351494Sbill #define INSV	31
361494Sbill #define	CALLS	32
371494Sbill #define RET	33
381494Sbill #define	CASE	34
391494Sbill #define	SOB	35
401494Sbill #define	TEXT	36
411494Sbill #define	DATA	37
421494Sbill #define	BSS	38
431494Sbill #define	ALIGN	39
441494Sbill #define	END	40
451494Sbill #define MOVZ 41
461494Sbill #define WGEN 42
471494Sbill #define SOBGEQ 43
481494Sbill #define SOBGTR 44
491494Sbill #define AOBLEQ 45
501494Sbill #define AOBLSS 46
511494Sbill #define ACB 47
521494Sbill #define MOVA 48
531494Sbill #define PUSHA 49
541494Sbill #define LGEN 50
551494Sbill #define SET 51
561494Sbill #define MOVC3 52
571494Sbill #define RSB 53
581494Sbill #define JSB 54
591494Sbill #define MFPR 55
601494Sbill #define MTPR 56
611494Sbill #define PROBER 57
621494Sbill #define PROBEW 58
63*1507Sbill #define	LCOMM 59
64*1507Sbill #define	COMM 60
651494Sbill 
661494Sbill #define	JEQ	0
671494Sbill #define	JNE	1
681494Sbill #define	JLE	2
691494Sbill #define	JGE	3
701494Sbill #define	JLT	4
711494Sbill #define	JGT	5
721494Sbill /* rearranged for unsigned branches so that jxxu = jxx + 6 */
731494Sbill #define	JLOS	8
741494Sbill #define	JHIS	9
751494Sbill #define	JLO	10
761494Sbill #define	JHI	11
771494Sbill 
781494Sbill #define JBC 12
791494Sbill #define JBS 13
801494Sbill #define JLBC 14
811494Sbill #define JLBS 15
821494Sbill #define JBCC 16
831494Sbill #define JBSC 17
841494Sbill #define JBCS 18
851494Sbill #define JBSS 19
861494Sbill 
871494Sbill #define	BYTE	1
881494Sbill #define	WORD	2
891494Sbill #define LONG	3
901494Sbill #define	FLOAT	4
911494Sbill #define	DOUBLE	5
921494Sbill #define QUAD	6
931494Sbill #define OP2	7
941494Sbill #define OP3	8
951494Sbill #define OPB 9
961494Sbill #define OPX 10
971494Sbill 
981494Sbill #define T(a,b) (a|((b)<<8))
991494Sbill #define U(a,b) (a|((b)<<4))
1001494Sbill 
1011494Sbill struct optab {
1021494Sbill 	char	opstring[7];
1031494Sbill 	short	opcode;
1041494Sbill } optab[];
1051494Sbill 
1061494Sbill struct node {
1071494Sbill 	char	op;
1081494Sbill 	char	subop;
1091494Sbill 	short	refc;
1101494Sbill 	struct	node	*forw;
1111494Sbill 	struct	node	*back;
1121494Sbill 	struct	node	*ref;
1131494Sbill 	char	*code;
1141494Sbill 	struct	optab	*pop;
115*1507Sbill 	long	labno;
1161494Sbill 	short	seq;
1171494Sbill };
1181494Sbill 
1191494Sbill struct {
1201494Sbill 	short	combop;
1211494Sbill };
1221494Sbill 
1231494Sbill char	line[512];
1241494Sbill struct	node	first;
1251494Sbill char	*curlp;
1261494Sbill int	nbrbr;
1271494Sbill int	nsaddr;
1281494Sbill int	redunm;
1291494Sbill int	iaftbr;
1301494Sbill int	njp1;
1311494Sbill int	nrlab;
1321494Sbill int	nxjump;
1331494Sbill int	ncmot;
1341494Sbill int	nrevbr;
1351494Sbill int	loopiv;
1361494Sbill int	nredunj;
1371494Sbill int	nskip;
1381494Sbill int	ncomj;
1391494Sbill int	nsob;
1401494Sbill int	nrtst;
1411494Sbill int nbj;
1421494Sbill int nfield;
1431494Sbill 
1441494Sbill int	nchange;
1451494Sbill int	isn;
1461494Sbill int	debug;
1471494Sbill char	*lasta;
1481494Sbill char	*lastr;
1491494Sbill char	*firstr;
1501494Sbill char	revbr[];
1511494Sbill #define	NREG	12
1521494Sbill char	*regs[NREG+5]; /* 0-11, 4 for operands, 1 for running off end */
1531494Sbill char	conloc[20];
1541494Sbill char	conval[20];
1551494Sbill char	ccloc[20];
1561494Sbill 
1571494Sbill #define	RT1	12
1581494Sbill #define	RT2	13
1591494Sbill #define RT3 14
1601494Sbill #define RT4 15
1611494Sbill #define	LABHS	127
1621494Sbill 
1631494Sbill struct { char lbyte; };
1641494Sbill 
1651494Sbill char *copy();
1661494Sbill long getnum();
1671494Sbill struct node *codemove();
1681494Sbill struct node *insertl();
1691494Sbill struct node *nonlab();
170