summaryrefslogtreecommitdiff
path: root/gcc/config/m68hc11
diff options
context:
space:
mode:
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-10 22:10:37 +0000
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-10 22:10:37 +0000
commit4b2ade62d9c945c0334eda264d0d0a24cfb5f62d (patch)
treef742d7d89ab767ab7a0bad18a7bdcd9c8ea996db /gcc/config/m68hc11
parentcf399df174fcef82af55904a30eecdd9f93196ff (diff)
downloadgcc-4b2ade62d9c945c0334eda264d0d0a24cfb5f62d.tar.gz
* config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define.
* config/m68hc11/m68hc11-protos.h (m68hc11_hard_regno_rename_ok): Declare. * config/m68hc11/m68hc11.c (m68hc11_hard_regno_rename_ok): New function for reg rename optimization to avoid using Z and Y registers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64134 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68hc11')
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h1
-rw-r--r--gcc/config/m68hc11/m68hc11.c17
-rw-r--r--gcc/config/m68hc11/m68hc11.h6
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index dda14692b31..01352b3d87a 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -24,6 +24,7 @@ extern int m68hc11_override_options PARAMS((void));
extern int m68hc11_optimization_options PARAMS((int,int));
extern void m68hc11_conditional_register_usage PARAMS((void));
extern int hard_regno_mode_ok PARAMS((int, enum machine_mode));
+extern int m68hc11_hard_regno_rename_ok PARAMS((int, int));
extern int m68hc11_total_frame_size PARAMS((void));
extern int m68hc11_initial_frame_pointer_offset PARAMS((void));
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 9ccac2ee657..ba4407b9f35 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -394,6 +394,23 @@ hard_regno_mode_ok (regno, mode)
}
}
+int
+m68hc11_hard_regno_rename_ok (reg1, reg2)
+ int reg1, reg2;
+{
+ /* Don't accept renaming to Z register. We will replace it to
+ X,Y or D during machine reorg pass. */
+ if (reg2 == HARD_Z_REGNUM)
+ return 0;
+
+ /* Don't accept renaming D,X to Y register as the code will be bigger. */
+ if (TARGET_M6811 && reg2 == HARD_Y_REGNUM
+ && (D_REGNO_P (reg1) || X_REGNO_P (reg1)))
+ return 0;
+
+ return 1;
+}
+
enum reg_class
preferred_reload_class (operand, class)
rtx operand;
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 3aa6a8eb4f7..95d3f609ae5 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -801,6 +801,12 @@ extern enum reg_class m68hc11_tmp_regs_class;
#define SMALL_REGISTER_CLASSES 1
+/* A C expression that is nonzero if hard register number REGNO2 can be
+ considered for use as a rename register for REGNO1 */
+
+#define HARD_REGNO_RENAME_OK(REGNO1,REGNO2) \
+ m68hc11_hard_regno_rename_ok ((REGNO1), (REGNO2))
+
/* A C expression whose value is nonzero if pseudos that have been
assigned to registers of class CLASS would likely be spilled
because registers of CLASS are needed for spill registers.