Commit 2d8d15b7 by Stephane Carrez Committed by Stephane Carrez

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
parent 70f0e288
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
when adding to X and Y since leax/leay are fast.
("*addhi3"): Accept 'I' constraint when adding to address register.
......
......@@ -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));
......
......@@ -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;
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment