arm.c (arm_size_return_regs): New.

2005-05-13  Josh Conner  <jconner@apple.com>

	* config/arm/arm.c (arm_size_return_regs): New.
	(thumb_unexpanded_epilogue): replace in-line calculation
	of return registers with call to arm_size_return_regs.
	(use_return_insn): Include test of which registers are
	being used to hold return values, to accommodate
	vector return values.

From-SVN: r99679
This commit is contained in:
Josh Conner 2005-05-13 21:13:17 +00:00 committed by Paul Brook
parent 9c309ac9a4
commit 4f5dfed0dc
2 changed files with 30 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2005-05-13 Josh Conner <jconner@apple.com>
* config/arm/arm.c (arm_size_return_regs): New.
(thumb_unexpanded_epilogue): replace in-line calculation
of return registers with call to arm_size_return_regs.
(use_return_insn): Include test of which registers are
being used to hold return values, to accommodate
vector return values.
2005-05-11 Aldy Hernandez <aldyh@redhat.com> 2005-05-11 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/sysv4.opt (mlittle): Handle. * config/rs6000/sysv4.opt (mlittle): Handle.

View file

@ -73,6 +73,7 @@ static int thumb_far_jump_used_p (void);
static bool thumb_force_lr_save (void); static bool thumb_force_lr_save (void);
static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code); static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
static rtx emit_sfm (int, int); static rtx emit_sfm (int, int);
static int arm_size_return_regs (void);
#ifndef AOF_ASSEMBLER #ifndef AOF_ASSEMBLER
static bool arm_assemble_integer (rtx, unsigned int, int); static bool arm_assemble_integer (rtx, unsigned int, int);
#endif #endif
@ -1465,9 +1466,11 @@ use_return_insn (int iscond, rtx sibling)
if (!call_used_regs[3]) if (!call_used_regs[3])
return 0; return 0;
/* ... that it isn't being used for a return value (always true /* ... that it isn't being used for a return value ... */
until we implement return-in-regs), or for a tail-call if (arm_size_return_regs () >= (4 * UNITS_PER_WORD))
argument ... */ return 0;
/* ... or for a tail-call argument ... */
if (sibling) if (sibling)
{ {
gcc_assert (GET_CODE (sibling) == CALL_INSN); gcc_assert (GET_CODE (sibling) == CALL_INSN);
@ -9851,6 +9854,20 @@ emit_multi_reg_push (unsigned long mask)
return par; return par;
} }
/* Calculate the size of the return value that is passed in registers. */
static int
arm_size_return_regs (void)
{
enum machine_mode mode;
if (current_function_return_rtx != 0)
mode = GET_MODE (current_function_return_rtx);
else
mode = DECL_MODE (DECL_RESULT (current_function_decl));
return GET_MODE_SIZE (mode);
}
static rtx static rtx
emit_sfm (int base_reg, int count) emit_sfm (int base_reg, int count)
{ {
@ -12920,13 +12937,7 @@ thumb_unexpanded_epilogue (void)
This is more reliable that examining regs_ever_live[] because that This is more reliable that examining regs_ever_live[] because that
will be set if the register is ever used in the function, not just if will be set if the register is ever used in the function, not just if
the register is used to hold a return value. */ the register is used to hold a return value. */
size = arm_size_return_regs ();
if (current_function_return_rtx != 0)
mode = GET_MODE (current_function_return_rtx);
else
mode = DECL_MODE (DECL_RESULT (current_function_decl));
size = GET_MODE_SIZE (mode);
/* The prolog may have pushed some high registers to use as /* The prolog may have pushed some high registers to use as
work registers. e.g. the testsuite file: work registers. e.g. the testsuite file: