Commit b17fe233 by Nick Clifton Committed by Nick Clifton

(print_multi_reg): Do not generate a type 2 LDM instructions with writeback enabled.

(print_multi_reg): Do not generate a type 2 LDM instructions with writeback
enabled.
(output_return_instruction): Likewise.

From-SVN: r64306
parent 2ed0b52a
2003-03-13 Nick Clifton <nickc@redhat.com> 2003-03-13 Nick Clifton <nickc@redhat.com>
* config/arm/arm.c (print_multi_reg): Do not generate a type 2
LDM instructions with writeback enabled.
(output_return_instruction): Likewise.
* config/arm/pe.h (FIXED_REGISTERS): Remove definition. * config/arm/pe.h (FIXED_REGISTERS): Remove definition.
(CALL_USED_REGISTERS): Remove definition. (CALL_USED_REGISTERS): Remove definition.
(SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define. (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define.
......
...@@ -7204,7 +7204,17 @@ print_multi_reg (stream, instr, reg, mask) ...@@ -7204,7 +7204,17 @@ print_multi_reg (stream, instr, reg, mask)
not_first = TRUE; not_first = TRUE;
} }
fprintf (stream, "}%s\n", TARGET_APCS_32 ? "" : "^"); fprintf (stream, "}");
/* Add a ^ character for the 26-bit ABI, but only if we were loading
the PC or not updating the stack pointer. Otherwise we generate
an UNPREDICTABLE instruction. */
if (! TARGET_APCS_32
&& (((mask & (1 << PC_REGNUM)) != 0)
|| strchr (instr, '!') == NULL))
fprintf (stream, "^");
fprintf (stream, "\n");
} }
/* Output a 'call' insn. */ /* Output a 'call' insn. */
...@@ -8210,20 +8220,26 @@ output_return_instruction (operand, really_return, reverse) ...@@ -8210,20 +8220,26 @@ output_return_instruction (operand, really_return, reverse)
if (live_regs_mask & (1 << LR_REGNUM)) if (live_regs_mask & (1 << LR_REGNUM))
{ {
int l = strlen (return_reg); sprintf (p, "%s%%|%s}", first ? "" : ", ", return_reg);
/* Decide if we need to add the ^ symbol to the end of the
if (! first) register list. This causes the saved condition codes
{ register to be copied into the current condition codes
memcpy (p, ", ", 2); register. We do the copy if we are conforming to the 32-bit
p += 2; ABI and this is an interrupt function, or if we are
} conforming to the 26-bit ABI. There is a special case for
the 26-bit ABI however, which is if we are writing back the
memcpy (p, "%|", 2); stack pointer but not loading the PC. In this case adding
memcpy (p + 2, return_reg, l); the ^ symbol would create a type 2 LDM instruction, where
strcpy (p + 2 + l, ((TARGET_APCS_32 writeback is UNPREDICTABLE. We are safe in leaving the ^
&& !IS_INTERRUPT (func_type)) character off in this case however, since the actual return
|| !really_return) instruction will be a MOVS which will restore the CPSR. */
? "}" : "}^"); if ((TARGET_APCS_32 && IS_INTERRUPT (func_type))
|| (really_return
&& ! frame_pointer_needed
&& ((live_regs_mask & (1 << SP_REGNUM)) == 0)
&& ((live_regs_mask & (1 << PC_REGNUM)) == 0))
)
strcat (p, "^");
} }
else else
strcpy (p, "}"); strcpy (p, "}");
......
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