1 /*-------------------------------------------------------------------------
3 SDCCralloc.h - header file register allocation
5 Written By - Philipp Krause . pkk@spth.de (2012)
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 -------------------------------------------------------------------------*/
27 #define SDCCRALLOC_H 1
33 XL_IDX
= 0,// Lower byte of X - The main 8-bot accumulator
34 XH_IDX
, // Upper byte of X
35 YL_IDX
, // Lower byte of Y
36 YH_IDX
, // Upper byte of Y
37 ZL_IDX
, // Lower byte of Z
38 ZH_IDX
, // Upper byte of Z
39 F_IDX
, // Flag register
42 X_IDX
, // X - for use with code generation support functions only.
43 Y_IDX
, // Y - for use with code generation support functions only.
44 Z_IDX
, // Z - for use with code generation support functions only.
46 SP_IDX
// SP - for use with debug info.
55 /* definition for the registers */
56 typedef struct reg_info
58 short type
; /* can have value
59 REG_GPR, REG_PTR or REG_CND */
60 short rIdx
; /* index into register table */
61 char *name
; /* name */
64 extern reg_info f8_regs
[];
66 void f8_assignRegisters (ebbIndex
*);
68 void f8SpillThis (symbol
*sym
, bool force_spill
);
69 iCode
*f8_ralloc2_cc(ebbIndex
*ebbi
);
71 void f8RegFix (eBBlock
**ebbs
, int count
);