Just to make sure I don't loose them again when syncing with cvs.
[fw/sdcc] / src / xa51 / ralloc.h
1 /*-------------------------------------------------------------------------
2
3   SDCCralloc.h - header file register allocation
4
5                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
6
7    This program is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by the
9    Free Software Foundation; either version 2, or (at your option) any
10    later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20    
21    In other words, you are welcome to use, share and improve this program.
22    You are forbidden to forbid anyone else to use, share and improve
23    what you give them.   Help stamp out software-hoarding!  
24 -------------------------------------------------------------------------*/
25 #include "SDCCicode.h"
26 #include "SDCCBBlock.h"
27 #ifndef SDCCRALLOC_H
28 #define SDCCRALLOC_H 1
29
30 #define ubyte unsigned char
31 #define byte ubyte
32 #define sbyte signed char
33 #define uword unsigned char
34 #define word uword
35 #define sword signed char
36 #define udword unsigned int
37 #define dword udword
38 #define sdword signed int
39
40 #define REG_PTR 0x01 // pointer register
41 #define REG_GPR 0x02 // general purpose register
42 #define REG_CND 0x04 // condition (bit) register
43 #define REG_SCR 0x40 // scratch register
44 #define REG_STK 0x80 // stack pointer register
45
46 typedef struct regs {
47   ubyte rIdx; // a unique # for this one
48   ubyte size; // size of register (0,1,2,4)
49   ubyte type; // pointer, general purpose, condition (bit)
50   char *name;
51   udword regMask;
52   uword offset;
53   bool isFree;
54   symbol *sym;
55 } regs;
56
57 #if 0
58 /* definition for the registers */
59 typedef struct regs
60   {
61     short type;                 /* can have value REG_CND, REG_8BITS, 
62                                    REG_16BITS or REG_32BITS */
63     short rIdx;                 /* index into register table */
64     short otype;
65     char *name;                 /* name */
66     char *dname;                /* name when direct access needed */
67     char *base;                 /* base address */
68     short offset;               /* offset from the base */
69     unsigned isFree:1;          /* is currently unassigned  */
70   }
71 regs;
72 #endif
73
74 extern regs regsXA51[];
75 extern udword xa51RegsInUse;
76
77 regs *xa51_regWithIdx (int);
78
79 bitVect *xa51_rUmaskForOp (operand * op);
80
81 #endif