Commit 7d2c38c0 by Uros Bizjak

i386.md (popdi1): Rewrite using POST_INC memory operand.

	* config/i386/i386.md (popdi1): Rewrite using POST_INC memory operand.
	(popsi1): Ditto.
	(*popdi1_epilogue): Ditto.
	(*popsi1_epilogue): Ditto.
	(popsi, popdi peephole2 patterns): Update peepholes for changed
	pop{si,di}1 and *pop{si,di}1_epilogue patterns.

	(pop<mode>1): Macroize insn from pop{si,di}1 using P code iterator.
	(*pop<mode>1_epilogue): Ditto from *pop{si,di}1_epilogue.

	* config/i386/i386.c (*ix86_gen_pop1): Remove indirect function.
	(override_options): Do not initialize removed ix86_gen_pop1.
	(gen_pop): New static function.
	(ix86_expand_prologue): Use gen_pop instead of ix86_gen_pop1.
	(release_scratch_register_on_entry): Ditto.
	(ix86_restore_reg_using_pop): Ditto.
	(ix86_expand_epilogue): Ditto.

From-SVN: r163679
parent 0f643366
2010-08-31 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (popdi1): Rewrite using POST_INC memory operand.
(popsi1): Ditto.
(*popdi1_epilogue): Ditto.
(*popsi1_epilogue): Ditto.
(popsi, popdi peephole2 patterns): Update peepholes for changed
pop{si,di}1 and *pop{si,di}1_epilogue patterns.
(pop<mode>1): Macroize insn from pop{si,di}1 using P code iterator.
(*pop<mode>1_epilogue): Ditto from *pop{si,di}1_epilogue.
* config/i386/i386.c (*ix86_gen_pop1): Remove indirect function.
(override_options): Do not initialize removed ix86_gen_pop1.
(gen_pop): New static function.
(ix86_expand_prologue): Use gen_pop instead of ix86_gen_pop1.
(release_scratch_register_on_entry): Ditto.
(ix86_restore_reg_using_pop): Ditto.
(ix86_expand_epilogue): Ditto.
2010-08-31 Jakub Jelinek <jakub@redhat.com> 2010-08-31 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45461 PR middle-end/45461
...@@ -414,9 +434,9 @@ ...@@ -414,9 +434,9 @@
(VSr3): Ditto. (VSr3): Ditto.
2010-08-27 Basile Starynkevitch <basile@starynkevitch.net> 2010-08-27 Basile Starynkevitch <basile@starynkevitch.net>
Jeremie Salvucci <jeremie.salvucci@free.fr> Jeremie Salvucci <jeremie.salvucci@free.fr>
* gengtype.c (output_type_enum): Test the right union member. * gengtype.c (output_type_enum): Test the right union member.
2010-08-27 Uros Bizjak <ubizjak@gmail.com> 2010-08-27 Uros Bizjak <ubizjak@gmail.com>
......
...@@ -1896,7 +1896,6 @@ static const char ix86_force_align_arg_pointer_string[] ...@@ -1896,7 +1896,6 @@ static const char ix86_force_align_arg_pointer_string[]
= "force_align_arg_pointer"; = "force_align_arg_pointer";
static rtx (*ix86_gen_leave) (void); static rtx (*ix86_gen_leave) (void);
static rtx (*ix86_gen_pop1) (rtx);
static rtx (*ix86_gen_add3) (rtx, rtx, rtx); static rtx (*ix86_gen_add3) (rtx, rtx, rtx);
static rtx (*ix86_gen_sub3) (rtx, rtx, rtx); static rtx (*ix86_gen_sub3) (rtx, rtx, rtx);
static rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx, rtx); static rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx, rtx);
...@@ -3655,7 +3654,6 @@ override_options (bool main_args_p) ...@@ -3655,7 +3654,6 @@ override_options (bool main_args_p)
if (TARGET_64BIT) if (TARGET_64BIT)
{ {
ix86_gen_leave = gen_leave_rex64; ix86_gen_leave = gen_leave_rex64;
ix86_gen_pop1 = gen_popdi1;
ix86_gen_add3 = gen_adddi3; ix86_gen_add3 = gen_adddi3;
ix86_gen_sub3 = gen_subdi3; ix86_gen_sub3 = gen_subdi3;
ix86_gen_sub3_carry = gen_subdi3_carry; ix86_gen_sub3_carry = gen_subdi3_carry;
...@@ -3669,7 +3667,6 @@ override_options (bool main_args_p) ...@@ -3669,7 +3667,6 @@ override_options (bool main_args_p)
else else
{ {
ix86_gen_leave = gen_leave; ix86_gen_leave = gen_leave;
ix86_gen_pop1 = gen_popsi1;
ix86_gen_add3 = gen_addsi3; ix86_gen_add3 = gen_addsi3;
ix86_gen_sub3 = gen_subsi3; ix86_gen_sub3 = gen_subsi3;
ix86_gen_sub3_carry = gen_subsi3_carry; ix86_gen_sub3_carry = gen_subsi3_carry;
...@@ -8173,6 +8170,18 @@ gen_push (rtx arg) ...@@ -8173,6 +8170,18 @@ gen_push (rtx arg)
arg); arg);
} }
/* Generate an "pop" pattern for input ARG. */
static rtx
gen_pop (rtx arg)
{
return gen_rtx_SET (VOIDmode,
arg,
gen_rtx_MEM (Pmode,
gen_rtx_POST_INC (Pmode,
stack_pointer_rtx)));
}
/* Return >= 0 if there is an unused call-clobbered register available /* Return >= 0 if there is an unused call-clobbered register available
for the entire function. */ for the entire function. */
...@@ -9052,7 +9061,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr) ...@@ -9052,7 +9061,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr)
{ {
if (sr->saved) if (sr->saved)
{ {
rtx x, insn = emit_insn (ix86_gen_pop1 (sr->reg)); rtx x, insn = emit_insn (gen_pop (sr->reg));
/* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */ /* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
...@@ -9478,7 +9487,7 @@ ix86_expand_prologue (void) ...@@ -9478,7 +9487,7 @@ ix86_expand_prologue (void)
{ {
/* The frame pointer is not needed so pop %ebp again. /* The frame pointer is not needed so pop %ebp again.
This leaves us with a pristine state. */ This leaves us with a pristine state. */
emit_insn (ix86_gen_pop1 (hard_frame_pointer_rtx)); emit_insn (gen_pop (hard_frame_pointer_rtx));
} }
} }
...@@ -9786,7 +9795,7 @@ static void ...@@ -9786,7 +9795,7 @@ static void
ix86_emit_restore_reg_using_pop (rtx reg) ix86_emit_restore_reg_using_pop (rtx reg)
{ {
struct machine_function *m = cfun->machine; struct machine_function *m = cfun->machine;
rtx insn = emit_insn (ix86_gen_pop1 (reg)); rtx insn = emit_insn (gen_pop (reg));
ix86_add_cfa_restore_note (insn, reg, m->fs.sp_offset); ix86_add_cfa_restore_note (insn, reg, m->fs.sp_offset);
m->fs.sp_offset -= UNITS_PER_WORD; m->fs.sp_offset -= UNITS_PER_WORD;
...@@ -9809,10 +9818,12 @@ ix86_emit_restore_reg_using_pop (rtx reg) ...@@ -9809,10 +9818,12 @@ ix86_emit_restore_reg_using_pop (rtx reg)
if (m->fs.cfa_reg == stack_pointer_rtx) if (m->fs.cfa_reg == stack_pointer_rtx)
{ {
m->fs.cfa_offset -= UNITS_PER_WORD; rtx x = plus_constant (stack_pointer_rtx, UNITS_PER_WORD);
add_reg_note (insn, REG_CFA_ADJUST_CFA, x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
copy_rtx (XVECEXP (PATTERN (insn), 0, 1))); add_reg_note (insn, REG_CFA_ADJUST_CFA, x);
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
m->fs.cfa_offset -= UNITS_PER_WORD;
} }
/* When the frame pointer is the CFA, and we pop it, we are /* When the frame pointer is the CFA, and we pop it, we are
...@@ -10229,7 +10240,7 @@ ix86_expand_epilogue (int style) ...@@ -10229,7 +10240,7 @@ ix86_expand_epilogue (int style)
/* There is no "pascal" calling convention in any 64bit ABI. */ /* There is no "pascal" calling convention in any 64bit ABI. */
gcc_assert (!TARGET_64BIT); gcc_assert (!TARGET_64BIT);
insn = emit_insn (gen_popsi1 (ecx)); insn = emit_insn (gen_pop (ecx));
m->fs.cfa_offset -= UNITS_PER_WORD; m->fs.cfa_offset -= UNITS_PER_WORD;
m->fs.sp_offset -= UNITS_PER_WORD; m->fs.sp_offset -= UNITS_PER_WORD;
......
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