rs6000.h (RS6000_PIC_OFFSET_TABLE_REGNUM): New.
2002-03-31 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> * config/rs6000/rs6000.h (RS6000_PIC_OFFSET_TABLE_REGNUM): New. (PIC_OFFSET_TABLE_REGNUM): Use it and return INVALID_REGNUM if !flag_pic. (CONDITIONAL_REGISTER_USAGE): Adjust accordingly. * config/rs6000/rs6000.h: Use RS6000_PIC_OFFSET_TABLE_REGNUM instead of PIC_OFFSET_TABLE_REGNUM thruout. * config/rs6000/rs6000.md: Likewise. * config/rs6000/darwin.h: Likewise. From-SVN: r51671
This commit is contained in:
parent
3bf1e98453
commit
1db0243780
5 changed files with 42 additions and 27 deletions
|
@ -1,3 +1,14 @@
|
|||
2002-03-31 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
||||
|
||||
* config/rs6000/rs6000.h (RS6000_PIC_OFFSET_TABLE_REGNUM): New.
|
||||
(PIC_OFFSET_TABLE_REGNUM): Use it and return INVALID_REGNUM if
|
||||
!flag_pic.
|
||||
(CONDITIONAL_REGISTER_USAGE): Adjust accordingly.
|
||||
* config/rs6000/rs6000.h: Use RS6000_PIC_OFFSET_TABLE_REGNUM instead
|
||||
of PIC_OFFSET_TABLE_REGNUM thruout.
|
||||
* config/rs6000/rs6000.md: Likewise.
|
||||
* config/rs6000/darwin.h: Likewise.
|
||||
|
||||
Sun Mar 31 14:43:24 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
||||
|
||||
* emit-rtl.c (adjust_address_1, offset_address): Cast value to
|
||||
|
|
|
@ -60,8 +60,8 @@ Boston, MA 02111-1307, USA. */
|
|||
#undef FRAME_POINTER_REGNUM
|
||||
#define FRAME_POINTER_REGNUM 30
|
||||
|
||||
#undef PIC_OFFSET_TABLE_REGNUM
|
||||
#define PIC_OFFSET_TABLE_REGNUM 31
|
||||
#undef RS6000_PIC_OFFSET_TABLE_REGNUM
|
||||
#define RS6000_PIC_OFFSET_TABLE_REGNUM 31
|
||||
|
||||
/* Pad the outgoing args area to 16 bytes instead of the usual 8. */
|
||||
|
||||
|
|
|
@ -6095,8 +6095,8 @@ rs6000_got_register (value)
|
|||
/* The second flow pass currently (June 1999) can't update
|
||||
regs_ever_live without disturbing other parts of the compiler, so
|
||||
update it here to make the prolog/epilogue code happy. */
|
||||
if (no_new_pseudos && ! regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
|
||||
regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
|
||||
if (no_new_pseudos && ! regs_ever_live[RS6000_PIC_OFFSET_TABLE_REGNUM])
|
||||
regs_ever_live[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1;
|
||||
|
||||
current_function_uses_pic_offset_table = 1;
|
||||
|
||||
|
@ -7400,7 +7400,7 @@ first_reg_to_save ()
|
|||
for (first_reg = 13; first_reg <= 31; first_reg++)
|
||||
if (regs_ever_live[first_reg]
|
||||
&& (! call_used_regs[first_reg]
|
||||
|| (first_reg == PIC_OFFSET_TABLE_REGNUM
|
||||
|| (first_reg == RS6000_PIC_OFFSET_TABLE_REGNUM
|
||||
&& ((DEFAULT_ABI == ABI_V4 && flag_pic == 1)
|
||||
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic)))))
|
||||
break;
|
||||
|
@ -7454,8 +7454,8 @@ first_reg_to_save ()
|
|||
|
||||
#if TARGET_MACHO
|
||||
if (flag_pic && current_function_uses_pic_offset_table &&
|
||||
(first_reg > PIC_OFFSET_TABLE_REGNUM))
|
||||
return PIC_OFFSET_TABLE_REGNUM;
|
||||
(first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM))
|
||||
return RS6000_PIC_OFFSET_TABLE_REGNUM;
|
||||
#endif
|
||||
|
||||
return first_reg;
|
||||
|
@ -7667,13 +7667,13 @@ rs6000_stack_info ()
|
|||
|
||||
/* Calculate which registers need to be saved & save area size. */
|
||||
info_ptr->first_gp_reg_save = first_reg_to_save ();
|
||||
/* Assume that we will have to save PIC_OFFSET_TABLE_REGNUM,
|
||||
/* Assume that we will have to save RS6000_PIC_OFFSET_TABLE_REGNUM,
|
||||
even if it currently looks like we won't. */
|
||||
if (((TARGET_TOC && TARGET_MINIMAL_TOC)
|
||||
|| (flag_pic == 1 && abi == ABI_V4)
|
||||
|| (flag_pic && abi == ABI_DARWIN))
|
||||
&& info_ptr->first_gp_reg_save > PIC_OFFSET_TABLE_REGNUM)
|
||||
info_ptr->gp_size = reg_size * (32 - PIC_OFFSET_TABLE_REGNUM);
|
||||
&& info_ptr->first_gp_reg_save > RS6000_PIC_OFFSET_TABLE_REGNUM)
|
||||
info_ptr->gp_size = reg_size * (32 - RS6000_PIC_OFFSET_TABLE_REGNUM);
|
||||
else
|
||||
info_ptr->gp_size = reg_size * (32 - info_ptr->first_gp_reg_save);
|
||||
|
||||
|
@ -8090,7 +8090,7 @@ rs6000_emit_load_toc_table (fromprolog)
|
|||
int fromprolog;
|
||||
{
|
||||
rtx dest;
|
||||
dest = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
|
||||
dest = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
|
||||
|
||||
if (TARGET_ELF && DEFAULT_ABI != ABI_AIX)
|
||||
{
|
||||
|
@ -8829,7 +8829,7 @@ rs6000_emit_prologue ()
|
|||
for (i = 0; i < 32 - info->first_gp_reg_save; i++)
|
||||
if ((regs_ever_live[info->first_gp_reg_save+i]
|
||||
&& ! call_used_regs[info->first_gp_reg_save+i])
|
||||
|| (i+info->first_gp_reg_save == PIC_OFFSET_TABLE_REGNUM
|
||||
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
|
||||
&& ((DEFAULT_ABI == ABI_V4 && flag_pic == 1)
|
||||
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
|
||||
{
|
||||
|
@ -8931,10 +8931,10 @@ rs6000_emit_prologue ()
|
|||
RTX_FRAME_RELATED_P (insn) = 1;
|
||||
}
|
||||
|
||||
/* If we are using PIC_OFFSET_TABLE_REGNUM, we need to set it up. */
|
||||
/* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */
|
||||
if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
|
||||
|| (DEFAULT_ABI == ABI_V4 && flag_pic == 1
|
||||
&& regs_ever_live[PIC_OFFSET_TABLE_REGNUM]))
|
||||
&& regs_ever_live[RS6000_PIC_OFFSET_TABLE_REGNUM]))
|
||||
{
|
||||
/* If emit_load_toc_table will use the link register, we need to save
|
||||
it. We use R11 for this purpose because emit_load_toc_table
|
||||
|
@ -8962,7 +8962,7 @@ rs6000_emit_prologue ()
|
|||
rs6000_maybe_dead (emit_insn (gen_load_macho_picbase (dest)));
|
||||
|
||||
rs6000_maybe_dead (
|
||||
emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM),
|
||||
emit_move_insn (gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM),
|
||||
gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)));
|
||||
}
|
||||
}
|
||||
|
@ -9204,7 +9204,7 @@ rs6000_emit_epilogue (sibcall)
|
|||
for (i = 0; i < 32 - info->first_gp_reg_save; i++)
|
||||
if ((regs_ever_live[info->first_gp_reg_save+i]
|
||||
&& ! call_used_regs[info->first_gp_reg_save+i])
|
||||
|| (i+info->first_gp_reg_save == PIC_OFFSET_TABLE_REGNUM
|
||||
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
|
||||
&& ((DEFAULT_ABI == ABI_V4 && flag_pic == 1)
|
||||
|| (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
|
||||
{
|
||||
|
|
|
@ -940,15 +940,18 @@ extern int rs6000_altivec_abi;
|
|||
for (i = 32; i < 64; i++) \
|
||||
fixed_regs[i] = call_used_regs[i] \
|
||||
= call_really_used_regs[i] = 1; \
|
||||
if (DEFAULT_ABI == ABI_V4 && flag_pic == 1) \
|
||||
fixed_regs[PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_used_regs[PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_really_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
|
||||
if (DEFAULT_ABI == ABI_DARWIN && flag_pic) \
|
||||
global_regs[PIC_OFFSET_TABLE_REGNUM] \
|
||||
= fixed_regs[PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_used_regs[PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_really_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
|
||||
if (DEFAULT_ABI == ABI_V4 \
|
||||
&& PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM \
|
||||
&& flag_pic == 1) \
|
||||
fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \
|
||||
if (DEFAULT_ABI == ABI_DARWIN \
|
||||
&& PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \
|
||||
global_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \
|
||||
= fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \
|
||||
= call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \
|
||||
if (! TARGET_ALTIVEC) \
|
||||
{ \
|
||||
for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i) \
|
||||
|
@ -2080,7 +2083,8 @@ do { \
|
|||
this macro is not defined, it is up to the machine-dependent files
|
||||
to allocate such a register (if necessary). */
|
||||
|
||||
#define PIC_OFFSET_TABLE_REGNUM 30
|
||||
#define RS6000_PIC_OFFSET_TABLE_REGNUM 30
|
||||
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM)
|
||||
|
||||
#define TOC_REGISTER (TARGET_MINIMAL_TOC ? 30 : 2)
|
||||
|
||||
|
|
|
@ -7606,7 +7606,7 @@
|
|||
operands2[0] = operands[0];
|
||||
operands2[1] = operands[1];
|
||||
operands2[2] = operands[2];
|
||||
operands2[3] = gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM);
|
||||
operands2[3] = gen_rtx_REG (SImode, RS6000_PIC_OFFSET_TABLE_REGNUM);
|
||||
output_asm_insn (\"{l|lwz} %0,lo16(%2)(%1)\", operands);
|
||||
/* We cannot rely on ha16(low half)==ha16(high half), alas,
|
||||
although in practice it almost always is. */
|
||||
|
|
Loading…
Add table
Reference in a new issue