参照元†
返り値†
/* If X is a SUBREG, try to replace it with a REG or a MEM, based on
the thing it is a subreg of. Do it anyway if FINAL_P. */
rtx
alter_subreg (rtx *xp, bool final_p)
{
rtx x = *xp;
rtx y = SUBREG_REG (x);
/* simplify_subreg does not remove subreg from volatile references.
We are required to. */
if (MEM_P (y))
{
poly_int64 offset = SUBREG_BYTE (x);
/* For paradoxical subregs on big-endian machines, SUBREG_BYTE
contains 0 instead of the proper offset. See simplify_subreg. */
if (paradoxical_subreg_p (x))
offset = byte_lowpart_offset (GET_MODE (x), GET_MODE (y));
if (final_p)
*xp = adjust_address (y, GET_MODE (x), offset);
else
*xp = adjust_address_nv (y, GET_MODE (x), offset);
}
else if (REG_P (y) && HARD_REGISTER_P (y))
{
rtx new_rtx = simplify_subreg (GET_MODE (x), y, GET_MODE (y),
SUBREG_BYTE (x));
if (new_rtx != 0)
*xp = new_rtx;
else if (final_p && REG_P (y))
{
/* Simplify_subreg can't handle some REG cases, but we have to. */
unsigned int regno;
poly_int64 offset;
regno = subreg_regno (x);
if (subreg_lowpart_p (x))
offset = byte_lowpart_offset (GET_MODE (x), GET_MODE (y));
else
offset = SUBREG_BYTE (x);
*xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, offset);
}
}
return *xp;
}
コメント†