Commit 12959abe by Andreas Krebbel Committed by Andreas Krebbel

s390.c (s390_emit_stack_tie): New function.

2007-12-06  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (s390_emit_stack_tie): New function.
	(s390_emit_prologue): Emit a stack tie when writing to the
	f8-f15 stack slots.
	* config/s390/s390.md ("stack_tie"): New insn definition.

From-SVN: r130646
parent 28267cfc
2007-12-06 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_emit_stack_tie): New function.
(s390_emit_prologue): Emit a stack tie when writing to the
f8-f15 stack slots.
* config/s390/s390.md ("stack_tie"): New insn definition.
2007-12-06 Ben Elliston <bje@au.ibm.com>
* SERVICE: Remove.
......@@ -7162,6 +7162,18 @@ s390_load_got (void)
return insns;
}
/* This ties together stack memory (MEM with an alias set of frame_alias_set)
and the change to the stack pointer. */
static void
s390_emit_stack_tie (void)
{
rtx mem = gen_frame_mem (BLKmode,
gen_rtx_REG (Pmode, STACK_POINTER_REGNUM));
emit_insn (gen_stack_tie (mem));
}
/* Expand the prologue into a bunch of separate insns. */
void
......@@ -7390,6 +7402,11 @@ s390_emit_prologue (void)
if (cfun_save_high_fprs_p && next_fpr)
{
/* If the stack might be accessed through a different register
we have to make sure that the stack pointer decrement is not
moved below the use of the stack slots. */
s390_emit_stack_tie ();
insn = emit_insn (gen_add2_insn (temp_reg,
GEN_INT (cfun_frame_layout.f8_offset)));
......
......@@ -61,6 +61,7 @@
(UNSPEC_CCU_TO_INT 2)
(UNSPEC_CCZ_TO_INT 3)
(UNSPEC_ICM 10)
(UNSPEC_TIE 11)
; GOT/PLT and lt-relative accesses
(UNSPEC_LTREL_OFFSET 100)
......@@ -7971,3 +7972,13 @@
""
"clc\t%O0(%G0,%R0),%S1"
[(set_attr "op_type" "SS")])
; This is used in s390_emit_prologue in order to prevent insns
; adjusting the stack pointer to be moved over insns writing stack
; slots using a copy of the stack pointer in a different register.
(define_insn "stack_tie"
[(set (match_operand:BLK 0 "memory_operand" "+m")
(unspec:BLK [(match_dup 0)] UNSPEC_TIE))]
""
""
[(set_attr "length" "0")])
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