summaryrefslogtreecommitdiff
path: root/gcc/config/cris/cris.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/cris/cris.h')
-rw-r--r--gcc/config/cris/cris.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 4d04ef869f3..1ab830e4d75 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -373,8 +373,8 @@ extern int cris_cpu_version;
/* Node: Register Basics */
/* We count all 16 non-special registers, SRP, a faked argument
- pointer register, MOF and CCR/DCCR. */
-#define FIRST_PSEUDO_REGISTER (16 + 1 + 1 + 1 + 1)
+ pointer register, MOF, CCR/DCCR, and the faked frame-pointer. */
+#define FIRST_PSEUDO_REGISTER (16 + 1 + 1 + 1 + 1 + 1)
/* For CRIS, these are r15 (pc) and r14 (sp). Register r8 is used as a
frame-pointer, but is not fixed. SRP is not included in general
@@ -382,12 +382,12 @@ extern int cris_cpu_version;
registers are fixed at the moment. The faked argument pointer register
is fixed too. */
#define FIXED_REGISTERS \
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1}
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}
/* Register r9 is used for structure-address, r10-r13 for parameters,
r10- for return values. */
#define CALL_USED_REGISTERS \
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1}
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1}
/* Node: Allocation Order */
@@ -410,7 +410,8 @@ extern int cris_cpu_version;
Use struct-return address first, since very few functions use
structure return values so it is likely to be available. */
#define REG_ALLOC_ORDER \
- {9, 13, 12, 11, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 17, 16, 18, 19}
+ {9, 13, 12, 11, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 17, 16, 18, 19, \
+ 20}
/* Node: Leaf Functions */
@@ -451,6 +452,9 @@ enum reg_class
#define CRIS_SPECIAL_REGS_CONTENTS \
((1 << CRIS_SRP_REGNUM) | (1 << CRIS_MOF_REGNUM) | (1 << CRIS_CC0_REGNUM))
+#define CRIS_FAKED_REGS_CONTENTS \
+ ((1 << CRIS_AP_REGNUM) | (1 << CRIS_FP_REGNUM))
+
/* Count in the faked argument register in GENERAL_REGS. Keep out SRP. */
#define REG_CLASS_CONTENTS \
{ \
@@ -464,13 +468,13 @@ enum reg_class
{CRIS_SPECIAL_REGS_CONTENTS}, \
{CRIS_SPECIAL_REGS_CONTENTS \
| (1 << CRIS_ACR_REGNUM)}, \
- {(0xffff | (1 << CRIS_AP_REGNUM)) \
+ {(0xffff | CRIS_FAKED_REGS_CONTENTS) \
& ~(1 << CRIS_ACR_REGNUM)}, \
- {(0xffff | (1 << CRIS_AP_REGNUM) \
+ {(0xffff | CRIS_FAKED_REGS_CONTENTS \
| CRIS_SPECIAL_REGS_CONTENTS) \
& ~(1 << CRIS_ACR_REGNUM)}, \
- {0xffff | (1 << CRIS_AP_REGNUM)}, \
- {0xffff | (1 << CRIS_AP_REGNUM) \
+ {0xffff | CRIS_FAKED_REGS_CONTENTS}, \
+ {0xffff | CRIS_FAKED_REGS_CONTENTS \
| CRIS_SPECIAL_REGS_CONTENTS} \
}
@@ -493,8 +497,10 @@ enum reg_class
allocation. */
#define REGNO_OK_FOR_BASE_P(REGNO) \
((REGNO) <= CRIS_LAST_GENERAL_REGISTER \
+ || (REGNO) == FRAME_POINTER_REGNUM \
|| (REGNO) == ARG_POINTER_REGNUM \
|| (unsigned) reg_renumber[REGNO] <= CRIS_LAST_GENERAL_REGISTER \
+ || (unsigned) reg_renumber[REGNO] == FRAME_POINTER_REGNUM \
|| (unsigned) reg_renumber[REGNO] == ARG_POINTER_REGNUM)
/* See REGNO_OK_FOR_BASE_P. */
@@ -580,6 +586,9 @@ enum reg_class
/* Register used for frame pointer. This is also the last of the saved
registers, when a frame pointer is not used. */
+#define HARD_FRAME_POINTER_REGNUM CRIS_REAL_FP_REGNUM
+
+/* Faked register, is always eliminated to at least CRIS_REAL_FP_REGNUM. */
#define FRAME_POINTER_REGNUM CRIS_FP_REGNUM
/* Faked register, is always eliminated. We need it to eliminate
@@ -596,8 +605,9 @@ enum reg_class
#define ELIMINABLE_REGS \
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
- {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
- {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
+ {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
+ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET) = cris_initial_elimination_offset (FROM, TO)
@@ -818,7 +828,8 @@ struct cum_args {int regs;};
#define REGISTER_NAMES \
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
- "r9", "r10", "r11", "r12", "r13", "sp", "pc", "srp", "mof", "faked_ap", "dccr"}
+ "r9", "r10", "r11", "r12", "r13", "sp", "pc", "srp", \
+ "mof", "faked_ap", "dccr", "faked_fp"}
#define ADDITIONAL_REGISTER_NAMES \
{{"r14", 14}, {"r15", 15}}