m68hc11.h (HARD_REGNO_RENAME_OK): Define.

* 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.

From-SVN: r64134
This commit is contained in:
Stephane Carrez 2003-03-10 23:10:37 +01:00 committed by Stephane Carrez
parent 70f0e2883a
commit 2d8d15b762
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
* 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.
2003-03-10 Stephane Carrez <stcarrez@nerim.fr>
* config/m68hc11/m68hc11.md ("*addhi3_68hc12"): Accept any constant

View File

@ -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));

View File

@ -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;

View File

@ -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.