Commit a7887475 by Bill Schmidt Committed by William Schmidt

rs6000.c (rs6000_frame_related): Add split_reg parameter and use it in REG_FRAME_RELATED_EXPR note.

2011-11-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_frame_related): Add split_reg
	parameter and use it in REG_FRAME_RELATED_EXPR note.
	(emit_frame_save): Call rs6000_frame_related with extra NULL_RTX
	parameter.
	(rs6000_emit_prologue): Likewise, but for little endian VSX
	stores, pass the source register of the store instead.

From-SVN: r204920
parent 1fe37220
2011-11-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000.c (rs6000_frame_related): Add split_reg
parameter and use it in REG_FRAME_RELATED_EXPR note.
(emit_frame_save): Call rs6000_frame_related with extra NULL_RTX
parameter.
(rs6000_emit_prologue): Likewise, but for little endian VSX
stores, pass the source register of the store instead.
2013-11-17 Andrew MacLeod <amacleod@redhat.com>
* gimple.h: Reorder prototypes to match .c declaration order, and remove
......@@ -21439,7 +21439,7 @@ output_probe_stack_range (rtx reg1, rtx reg2)
static rtx
rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val,
rtx reg2, rtx rreg)
rtx reg2, rtx rreg, rtx split_reg)
{
rtx real, temp;
......@@ -21530,6 +21530,11 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val,
}
}
/* If a store insn has been split into multiple insns, the
true source register is given by split_reg. */
if (split_reg != NULL_RTX)
real = gen_rtx_SET (VOIDmode, SET_DEST (real), split_reg);
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR, real);
......@@ -21637,7 +21642,7 @@ emit_frame_save (rtx frame_reg, enum machine_mode mode,
reg = gen_rtx_REG (mode, regno);
insn = emit_insn (gen_frame_store (reg, frame_reg, offset));
return rs6000_frame_related (insn, frame_reg, frame_reg_to_sp,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
}
/* Emit an offset memory reference suitable for a frame store, while
......@@ -22217,7 +22222,7 @@ rs6000_emit_prologue (void)
insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
rs6000_frame_related (insn, frame_reg_rtx, sp_off - frame_off,
treg, GEN_INT (-info->total_size));
treg, GEN_INT (-info->total_size), NULL_RTX);
sp_off = frame_off = info->total_size;
}
......@@ -22302,7 +22307,7 @@ rs6000_emit_prologue (void)
insn = emit_move_insn (mem, reg);
rs6000_frame_related (insn, frame_reg_rtx, sp_off - frame_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
END_USE (0);
}
}
......@@ -22358,7 +22363,7 @@ rs6000_emit_prologue (void)
info->lr_save_offset,
DFmode, sel);
rs6000_frame_related (insn, ptr_reg, sp_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
if (lr)
END_USE (0);
}
......@@ -22437,7 +22442,7 @@ rs6000_emit_prologue (void)
SAVRES_SAVE | SAVRES_GPR);
rs6000_frame_related (insn, spe_save_area_ptr, sp_off - save_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
}
/* Move the static chain pointer back. */
......@@ -22487,7 +22492,7 @@ rs6000_emit_prologue (void)
info->lr_save_offset + ptr_off,
reg_mode, sel);
rs6000_frame_related (insn, ptr_reg, sp_off - ptr_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
if (lr)
END_USE (0);
}
......@@ -22503,7 +22508,7 @@ rs6000_emit_prologue (void)
info->gp_save_offset + frame_off + reg_size * i);
insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
rs6000_frame_related (insn, frame_reg_rtx, sp_off - frame_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
}
else if (!WORLD_SAVE_P (info))
{
......@@ -22826,7 +22831,7 @@ rs6000_emit_prologue (void)
info->altivec_save_offset + ptr_off,
0, V4SImode, SAVRES_SAVE | SAVRES_VR);
rs6000_frame_related (insn, scratch_reg, sp_off - ptr_off,
NULL_RTX, NULL_RTX);
NULL_RTX, NULL_RTX, NULL_RTX);
if (REGNO (frame_reg_rtx) == REGNO (scratch_reg))
{
/* The oddity mentioned above clobbered our frame reg. */
......@@ -22842,7 +22847,7 @@ rs6000_emit_prologue (void)
for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
{
rtx areg, savereg, mem;
rtx areg, savereg, mem, split_reg;
int offset;
offset = (info->altivec_save_offset + frame_off
......@@ -22860,8 +22865,18 @@ rs6000_emit_prologue (void)
insn = emit_move_insn (mem, savereg);
/* When we split a VSX store into two insns, we need to make
sure the DWARF info knows which register we are storing.
Pass it in to be used on the appropriate note. */
if (!BYTES_BIG_ENDIAN
&& GET_CODE (PATTERN (insn)) == SET
&& GET_CODE (SET_SRC (PATTERN (insn))) == VEC_SELECT)
split_reg = savereg;
else
split_reg = NULL_RTX;
rs6000_frame_related (insn, frame_reg_rtx, sp_off - frame_off,
areg, GEN_INT (offset));
areg, GEN_INT (offset), split_reg);
}
}
......
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