return addr;
}
\f
+/* Return 1 if REG needs to be saved. */
+static inline bool reg_needs_saving_p (unsigned reg)
+{
+ if (!df_regs_ever_live_p (reg)
+ || call_used_or_fixed_reg_p (reg))
+ return false;
+ else
+ return true;
+}
+
/* Return 1 if it is possible to return using a single instruction.
If SIBLING is non-null, this is a test for a return before a sibling
call. SIBLING is the call insn, so we can examine its register usage. */
since this also requires an insn. */
if (TARGET_VFP_BASE)
for (regno = FIRST_VFP_REGNUM; regno <= LAST_VFP_REGNUM; regno++)
- if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
+ if (reg_needs_saving_p (regno))
return 0;
if (TARGET_REALLY_IWMMXT)
for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
- if (df_regs_ever_live_p (regno) && ! call_used_or_fixed_reg_p (regno))
+ if (reg_needs_saving_p (regno))
return 0;
return 1;
return mask;
}
-
/* Return the number of bytes required to save VFP registers. */
static int
arm_get_vfp_saved_size (void)
regno < LAST_VFP_REGNUM;
regno += 2)
{
- if ((!df_regs_ever_live_p (regno)
- || call_used_or_fixed_reg_p (regno))
- && (!df_regs_ever_live_p (regno + 1)
- || call_used_or_fixed_reg_p (regno + 1)))
+ if (!reg_needs_saving_p (regno) && !reg_needs_saving_p (regno + 1))
{
if (count > 0)
{
for (regno = FIRST_IWMMXT_REGNUM;
regno <= LAST_IWMMXT_REGNUM;
regno++)
- if (df_regs_ever_live_p (regno)
- && !call_used_or_fixed_reg_p (regno))
+ if (reg_needs_saving_p (regno))
saved += 8;
}
unsigned start_reg;
rtx insn;
+ if (TARGET_REALLY_IWMMXT)
for (reg = LAST_IWMMXT_REGNUM; reg >= FIRST_IWMMXT_REGNUM; reg--)
- if (df_regs_ever_live_p (reg) && !call_used_or_fixed_reg_p (reg))
+ if (reg_needs_saving_p (reg))
{
insn = gen_rtx_PRE_DEC (Pmode, stack_pointer_rtx);
insn = gen_rtx_MEM (V2SImode, insn);
for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
{
- if ((!df_regs_ever_live_p (reg) || call_used_or_fixed_reg_p (reg))
- && (!df_regs_ever_live_p (reg + 1)
- || call_used_or_fixed_reg_p (reg + 1)))
+ if (!reg_needs_saving_p (reg) && !reg_needs_saving_p (reg + 1))
{
if (start_reg != reg)
saved_size += vfp_emit_fstmd (start_reg,
/* Emit a clobber for each insn that will be restored in the epilogue,
so that flow2 will get register lifetimes correct. */
for (regno = 0; regno < 13; regno++)
- if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
+ if (reg_needs_saving_p (regno))
emit_clobber (gen_rtx_REG (SImode, regno));
if (! df_regs_ever_live_p (LR_REGNUM))
for (i = FIRST_VFP_REGNUM; i < LAST_VFP_REGNUM; i += 2)
/* Look for a case where a reg does not need restoring. */
- if ((!df_regs_ever_live_p (i) || call_used_or_fixed_reg_p (i))
- && (!df_regs_ever_live_p (i + 1)
- || call_used_or_fixed_reg_p (i + 1)))
+ if (!reg_needs_saving_p (i) && !reg_needs_saving_p (i + 1))
{
if (start_reg != i)
arm_emit_vfp_multi_reg_pop (start_reg,
int lrm_count = (num_regs % 2) ? (num_regs + 2) : (num_regs + 1);
for (i = LAST_IWMMXT_REGNUM; i >= FIRST_IWMMXT_REGNUM; i--)
- if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
+ if (reg_needs_saving_p (i))
{
rtx addr = gen_frame_mem (V2SImode,
plus_constant (Pmode, hard_frame_pointer_rtx,
unlike pop, vldm can only do consecutive regs. */
for (i = LAST_VFP_REGNUM - 1; i >= FIRST_VFP_REGNUM; i -= 2)
/* Look for a case where a reg does not need restoring. */
- if ((!df_regs_ever_live_p (i) || call_used_or_fixed_reg_p (i))
- && (!df_regs_ever_live_p (i + 1)
- || call_used_or_fixed_reg_p (i + 1)))
+ if (!reg_needs_saving_p (i) && !reg_needs_saving_p (i + 1))
{
/* Restore the regs discovered so far (from reg+2 to
end_reg). */
if (TARGET_IWMMXT)
for (i = FIRST_IWMMXT_REGNUM; i <= LAST_IWMMXT_REGNUM; i++)
- if (df_regs_ever_live_p (i) && !call_used_or_fixed_reg_p (i))
+ if (reg_needs_saving_p (i))
{
rtx_insn *insn;
rtx addr = gen_rtx_MEM (V2SImode,