Commit e3ba8d11 by J"orn Rennecke Committed by Joern Rennecke

sh-protos.h (sh_pr_interrupt): Declare.

	* sh-protos.h (sh_pr_interrupt): Declare.
	* sh.c (sh_pr_interrupt): New function.
	(print_operand, calc_live_regs, sh_expand_prologue): Use it.
	(sh_hard_regno_rename_ok): Likewise.
	* sh.h (NORMAL_MODE): FP_MODE_NONE for interupt handlers.

From-SVN: r54756
parent ab928b32
Tue Jun 18 20:00:37 2002 J"orn Rennecke <joern.rennecke@superh.com>
* sh-protos.h (sh_pr_interrupt): Declare.
* sh.c (sh_pr_interrupt): New function.
(print_operand, calc_live_regs, sh_expand_prologue): Use it.
(sh_hard_regno_rename_ok): Likewise.
* sh.h (NORMAL_MODE): FP_MODE_NONE for interupt handlers.
2002-06-18 Vladimir Makarov <vmakarov@redhat.com> 2002-06-18 Vladimir Makarov <vmakarov@redhat.com>
* rtl.def (DEFINE_AUTOMATON): Add description of new options * rtl.def (DEFINE_AUTOMATON): Add description of new options
......
...@@ -123,6 +123,7 @@ extern int initial_elimination_offset PARAMS ((int, int)); ...@@ -123,6 +123,7 @@ extern int initial_elimination_offset PARAMS ((int, int));
extern int fldi_ok PARAMS ((void)); extern int fldi_ok PARAMS ((void));
extern int sh_pr_n_sets PARAMS ((void)); extern int sh_pr_n_sets PARAMS ((void));
extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int)); extern int sh_hard_regno_rename_ok PARAMS ((unsigned int, unsigned int));
extern int sh_cfun_interrupt_handler_p (void);
#ifdef HARD_CONST #ifdef HARD_CONST
extern void fpscr_set_from_mem PARAMS ((int, HARD_REG_SET)); extern void fpscr_set_from_mem PARAMS ((int, HARD_REG_SET));
......
...@@ -341,25 +341,13 @@ print_operand (stream, x, code) ...@@ -341,25 +341,13 @@ print_operand (stream, x, code)
fprintf (stream, "%s", LOCAL_LABEL_PREFIX); fprintf (stream, "%s", LOCAL_LABEL_PREFIX);
break; break;
case '@': case '@':
{
int interrupt_handler;
if ((lookup_attribute
("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl)))
!= NULL_TREE)
interrupt_handler = 1;
else
interrupt_handler = 0;
if (trap_exit) if (trap_exit)
fprintf (stream, "trapa #%d", trap_exit); fprintf (stream, "trapa #%d", trap_exit);
else if (interrupt_handler) else if (sh_cfun_interrupt_handler_p ())
fprintf (stream, "rte"); fprintf (stream, "rte");
else else
fprintf (stream, "rts"); fprintf (stream, "rts");
break; break;
}
case '#': case '#':
/* Output a nop if there's nothing in the delay slot. */ /* Output a nop if there's nothing in the delay slot. */
if (dbr_sequence_length () == 0) if (dbr_sequence_length () == 0)
...@@ -4364,13 +4352,7 @@ calc_live_regs (count_ptr, live_regs_mask) ...@@ -4364,13 +4352,7 @@ calc_live_regs (count_ptr, live_regs_mask)
int interrupt_handler; int interrupt_handler;
int pr_live; int pr_live;
if ((lookup_attribute interrupt_handler = sh_cfun_interrupt_handler_p ();
("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl)))
!= NULL_TREE)
interrupt_handler = 1;
else
interrupt_handler = 0;
for (count = 0; 32 * count < FIRST_PSEUDO_REGISTER; count++) for (count = 0; 32 * count < FIRST_PSEUDO_REGISTER; count++)
live_regs_mask[count] = 0; live_regs_mask[count] = 0;
...@@ -4489,10 +4471,7 @@ sh_expand_prologue () ...@@ -4489,10 +4471,7 @@ sh_expand_prologue ()
int d_rounding = 0; int d_rounding = 0;
int save_flags = target_flags; int save_flags = target_flags;
current_function_interrupt current_function_interrupt = sh_cfun_interrupt_handler_p ();
= lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE;
/* We have pretend args if we had an object sent partially in registers /* We have pretend args if we had an object sent partially in registers
and partially on the stack, e.g. a large structure. */ and partially on the stack, e.g. a large structure. */
...@@ -5747,6 +5726,13 @@ sh_handle_trap_exit_attribute (node, name, args, flags, no_add_attrs) ...@@ -5747,6 +5726,13 @@ sh_handle_trap_exit_attribute (node, name, args, flags, no_add_attrs)
return NULL_TREE; return NULL_TREE;
} }
int
sh_cfun_interrupt_handler_p (void)
{
return (lookup_attribute ("interrupt_handler",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE);
}
/* Predicates used by the templates. */ /* Predicates used by the templates. */
...@@ -6712,10 +6698,7 @@ sh_hard_regno_rename_ok (old_reg, new_reg) ...@@ -6712,10 +6698,7 @@ sh_hard_regno_rename_ok (old_reg, new_reg)
saved by the prologue, even if they would normally be saved by the prologue, even if they would normally be
call-clobbered. */ call-clobbered. */
if ((lookup_attribute ("interrupt_handler", if (sh_cfun_interrupt_handler_p () && !regs_ever_live[new_reg])
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE)
&& !regs_ever_live[new_reg])
return 0; return 0;
return 1; return 1;
......
...@@ -3251,7 +3251,9 @@ extern struct rtx_def *fpscr_rtx; ...@@ -3251,7 +3251,9 @@ extern struct rtx_def *fpscr_rtx;
#define OPTIMIZE_MODE_SWITCHING(ENTITY) TARGET_SH4 #define OPTIMIZE_MODE_SWITCHING(ENTITY) TARGET_SH4
#define NORMAL_MODE(ENTITY) \ #define NORMAL_MODE(ENTITY) \
(TARGET_FPU_SINGLE ? FP_MODE_SINGLE : FP_MODE_DOUBLE) (sh_cfun_interrupt_handler_p () ? FP_MODE_NONE \
: TARGET_FPU_SINGLE ? FP_MODE_SINGLE \
: FP_MODE_DOUBLE)
#define EPILOGUE_USES(REGNO) ((TARGET_SH3E || TARGET_SH4) \ #define EPILOGUE_USES(REGNO) ((TARGET_SH3E || TARGET_SH4) \
&& (REGNO) == FPSCR_REG) && (REGNO) == FPSCR_REG)
......
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