1 /*-------------------------------------------------------------------------
3 SDCCralloc.h - header file register allocation
5 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
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
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.
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.
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"
28 #define SDCCRALLOC_H 1
30 #define REG_PTR 0x01 // pointer register
31 #define REG_GPR 0x02 // general purpose register
32 #define REG_CND 0x04 // condition (bit) register
33 #define REG_SCR 0x40 // scratch register
34 #define REG_STK 0x80 // stack pointer register
38 R0L_ID=0x10,R0H_ID,R1L_ID,R1H_ID,R2L_ID,R2H_ID,R3L_ID,R3H_ID,
39 R4L_ID,R4H_ID,R5L_ID,R5H_ID,R6L_ID,R6H_ID,R7L_ID,R7H_ID,
40 R0_ID=0x20, R1_ID, R2_ID, R3_ID, R4_ID, R5_ID, R6_ID, R7_ID,
41 R8_ID, I9_ID, R10_ID, R11_ID, R12_ID, R13_ID, R14_ID, R15_ID,
42 R0R1_ID=0x40, R2R3_ID, R4R5_ID, R6R7_ID
46 unsigned char rIdx; // the register ID
47 unsigned char size; // size of register (1,2,4)
48 unsigned char type; // scratch, pointer, general purpose, stack, condition (bit)
50 unsigned long regMask;
52 symbol *sym; // used by symbol
55 extern regs regsXA51[];
56 extern unsigned long xa51RegsInUse;
58 regs *xa51_regWithIdx (int);
60 bitVect *xa51_rUmaskForOp (operand * op);