xref: /csrg-svn/old/pcc/ccom.tahoe/mac2defs.h (revision 33365)
1*33365Sdonn /*	mac2defs.h	1.4	88/01/19	*/
225833Ssam 
326074Ssam /*
426074Ssam  * Tahoe Registers
526074Ssam  */
625833Ssam 
726074Ssam /*
826074Ssam  * Scratch registers
926074Ssam  */
1026074Ssam #define R0	0
1126074Ssam #define R1	1
1226074Ssam #define R2	2
1326074Ssam #define R3	3
1426074Ssam #define R4	4
1526074Ssam #define R5	5
1625833Ssam 
1726074Ssam /*
1826074Ssam  * Register variables
1926074Ssam  */
2026074Ssam #define R6	6
2126074Ssam #define R7	7
2226074Ssam #define R8	8
2326074Ssam #define R9	9
2426074Ssam #define R10	10
2526074Ssam #define R11	11
2626074Ssam #define R12	12
2725833Ssam 
2826074Ssam /*
2926074Ssam  * Special purpose registers
3026074Ssam  */
3126074Ssam #define FP	13		/* frame pointer */
3226074Ssam #define SP	14		/* stack pointer */
3326074Ssam #define PC	15		/* program counter */
3425833Ssam 
3526074Ssam /*
3626074Ssam  * Floating registers
3726074Ssam  */
3826074Ssam #define	ACC	16		/* accumulator */
3925833Ssam 
4026074Ssam #define	TMPREG	FP		/* reg off which temporaries are referenced */
4126074Ssam #define	REGSZ	16		/* size of register set */
4225833Ssam 
4326074Ssam #define R2REGS	1		/* permit double indexing */
4425833Ssam 
4526074Ssam extern	int fregs;
4626074Ssam extern	int maxargs;
4725833Ssam 
4826074Ssam #define BYTEOFF(x)	((x)&03)
4926074Ssam #define wdal(k)		(BYTEOFF(k)==0)		/* word align */
5026074Ssam #define BITOOR(x)	((x)>>3)		/* bit offset to oreg offset */
5125833Ssam 
5226074Ssam /*
5326074Ssam  * Some macros used in store():
5426074Ssam  *	just evaluate the arguments, and be done with it...
5526074Ssam  */
5626074Ssam #define STOARG(p)
5726074Ssam #define STOFARG(p)
5826074Ssam #define STOSTARG(p)
5925833Ssam 
6026074Ssam /*
6126074Ssam  * Some short routines that get called an awful lot are actually macros.
6226074Ssam  */
6326074Ssam #define	szty(t)	((t) == DOUBLE ? 2 : 1)
6426074Ssam #define	shltype(o, p) \
6526074Ssam 	((o) == REG || (o) == NAME || (o) == ICON || \
6626074Ssam 	 (o) == OREG || ((o) == UNARY MUL && shumul((p)->in.left)))
6726074Ssam #define	ncopy(q, p)	((q)->in = (p)->in)
6825833Ssam 
6926074Ssam #define MYREADER(p)	myreader(p)
7026074Ssam int	optim2();
71*33365Sdonn #define	SIREG		(SPECIAL|7)	/* indexed OREG */
7226074Ssam int	special();			/* additional special shapes */
7326074Ssam #define callchk(p)	if ((p)->in.op != FORTCALL) allchk()
74