xref: /csrg-svn/sys/vax/inline/inline.h (revision 49438)
1*49438Sbostic /*-
2*49438Sbostic  * Copyright (c) 1984, 1986 The Regents of the University of California.
3*49438Sbostic  * All rights reserved.
423341Smckusick  *
5*49438Sbostic  * %sccs.include.redist.c%
6*49438Sbostic  *
7*49438Sbostic  *	@(#)inline.h	7.2 (Berkeley) 05/08/91
823341Smckusick  */
916958Smckusick 
1016958Smckusick /*
1116958Smckusick  * COMMENTCHAR is the character delimiting comments in the assembler.
1216958Smckusick  * LABELCHAR is the character that separates labels from instructions.
1316977Smckusick  * ARGSEPCHAR is the character that separates arguments in instructions.
1416958Smckusick  */
1516958Smckusick #define COMMENTCHAR	'#'
1616958Smckusick #define LABELCHAR	':'
1716977Smckusick #define ARGSEPCHAR	','
1816958Smckusick 
1916958Smckusick /*
2016958Smckusick  * Expansion parameters:
2116958Smckusick  *   QUEUESIZE is the number of instructions to be considered for
2216958Smckusick  *	integration of argument pushes and pops
2316958Smckusick  *   MAXLINELEN is the longest expected input line
2416958Smckusick  *   MAXARGS is the maximum number of arguments in an assembly instruction
2516958Smckusick  */
2616958Smckusick #define QUEUESIZE	16
2726905Smckusick #define MAXLINELEN	1024
2816958Smckusick #define MAXARGS		10
2916958Smckusick 
3016958Smckusick /*
3116958Smckusick  * The following global variables are used to manipulate the queue of
3216958Smckusick  * recently seen instructions.
3316958Smckusick  *	line - The queue of instructions.
3416958Smckusick  *	bufhead - Pointer to next availble queue slot. It is not
3516958Smckusick  *		considered part of te instruction stream until
3616958Smckusick  *		bufhead is advanced.
3716958Smckusick  *	buftail - Pointer to last instruction in queue.
3816958Smckusick  * Note that bufhead == buftail implies that the queue is empty.
3916958Smckusick  */
4016958Smckusick int bufhead, buftail;
4116958Smckusick char line[QUEUESIZE][MAXLINELEN];
4216958Smckusick 
4316958Smckusick #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1)
4416958Smckusick #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1)
4516958Smckusick 
4616958Smckusick /*
4716977Smckusick  * Hash table headers should be twice as big as the number of patterns.
4816977Smckusick  * They must be a power of two.
4916958Smckusick  */
5016958Smckusick #define HSHSIZ	128
5116958Smckusick 
5216977Smckusick /*
5316977Smckusick  * These tables specify the substitutions that are to be done.
5416977Smckusick  */
5516958Smckusick struct pats {
5624382Smckusick 	int	args;
5716958Smckusick 	char	*name;
5816958Smckusick 	char	*replace;
5916958Smckusick 	struct	pats *next;
6016958Smckusick 	int	size;
6116958Smckusick };
6216977Smckusick struct pats *patshdr[HSHSIZ];
6316958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
6427462Skarels extern struct pats vax_libc_ptab[], vaxsubset_libc_ptab[];
6527462Skarels extern struct pats vax_ptab[], vaxsubset_ptab[];
6616977Smckusick 
6716977Smckusick /*
6816977Smckusick  * This table defines the set of instructions that demark the
6916977Smckusick  * end of a basic block.
7016977Smckusick  */
7116977Smckusick struct inststoptbl {
7216977Smckusick 	char	*name;
7316977Smckusick 	struct	inststoptbl *next;
7416977Smckusick 	int	size;
7516977Smckusick };
7616977Smckusick struct inststoptbl *inststoptblhdr[HSHSIZ];
7716977Smckusick extern struct inststoptbl inststoptable[];
7816977Smckusick 
7916977Smckusick /*
8016977Smckusick  * Miscellaneous functions.
8116977Smckusick  */
8216958Smckusick char *newline(), *copyline(), *doreplaceon();
83