/* Offset from virtual_stack_vars_rtx to the start of the ABI_V4
varargs save area. */
HOST_WIDE_INT varargs_save_offset;
- /* Temporary stack slot to use for SDmode copies. This slot is
- 64-bits wide and is allocated early enough so that the offset
- does not overflow the 16-bit load/store offset field. */
- rtx sdmode_stack_slot;
/* Alternative internal arg pointer for -fsplit-stack. */
rtx split_stack_arg_pointer;
bool split_stack_argp_used;
#undef TARGET_BUILTIN_RECIPROCAL
#define TARGET_BUILTIN_RECIPROCAL rs6000_builtin_reciprocal
-#undef TARGET_EXPAND_TO_RTL_HOOK
-#define TARGET_EXPAND_TO_RTL_HOOK rs6000_alloc_sdmode_stack_slot
-
-#undef TARGET_INSTANTIATE_DECLS
-#define TARGET_INSTANTIATE_DECLS rs6000_instantiate_decls
-
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD rs6000_secondary_reload
op0 = XEXP (x, 0);
op1 = XEXP (x, 1);
- /* Recognize the rtl generated by reload which we know will later be
- replaced with proper base and index regs. */
- if (!strict
- && reload_in_progress
- && (REG_P (op0) || GET_CODE (op0) == PLUS)
- && REG_P (op1))
- return true;
-
return (REG_P (op0) && REG_P (op1)
&& ((INT_REG_OK_FOR_BASE_P (op0, strict)
&& INT_REG_OK_FOR_INDEX_P (op1, strict))
ret ? "true" : "false",
GET_MODE_NAME (mode),
reg_ok_strict,
- (reload_completed
- ? "after"
- : (reload_in_progress ? "progress" : "before")),
+ (reload_completed ? "after" : "before"),
GET_RTX_NAME (GET_CODE (x)));
debug_rtx (x);
static void
rs6000_eliminate_indexed_memrefs (rtx operands[2])
{
- if (reload_in_progress)
- return;
-
if (GET_CODE (operands[0]) == MEM
&& GET_CODE (XEXP (operands[0], 0)) != REG
&& ! legitimate_constant_pool_address_p (XEXP (operands[0], 0),
void
rs6000_emit_le_vsx_store (rtx dest, rtx source, machine_mode mode)
{
- /* This should never be called during or after reload, because it does
+ /* This should never be called during or after LRA, because it does
not re-permute the source register. It is intended only for use
during expand. */
- gcc_assert (!reload_in_progress && !lra_in_progress && !reload_completed);
+ gcc_assert (!lra_in_progress && !reload_completed);
/* Use V2DImode to do swaps of types with 128-bit scalar parts (TImode,
V1TImode). */
static bool
rs6000_emit_move_si_sf_subreg (rtx dest, rtx source, machine_mode mode)
{
- if (TARGET_DIRECT_MOVE_64BIT && !reload_in_progress && !reload_completed
- && !lra_in_progress
+ if (TARGET_DIRECT_MOVE_64BIT && !lra_in_progress && !reload_completed
&& (!SUBREG_P (dest) || !sf_subreg_operand (dest, mode))
&& SUBREG_P (source) && sf_subreg_operand (source, mode))
{
if (TARGET_DEBUG_ADDR)
{
fprintf (stderr,
- "\nrs6000_emit_move: mode = %s, reload_in_progress = %d, "
+ "\nrs6000_emit_move: mode = %s, lra_in_progress = %d, "
"reload_completed = %d, can_create_pseudos = %d.\ndest:\n",
GET_MODE_NAME (mode),
- reload_in_progress,
+ lra_in_progress,
reload_completed,
can_create_pseudo_p ());
debug_rtx (dest);
operands[1] = tmp;
}
- /* Handle the case where reload calls us with an invalid address. */
- if (reload_in_progress && mode == Pmode
- && (! general_operand (operands[1], mode)
- || ! nonimmediate_operand (operands[0], mode)))
- goto emit_set;
-
/* 128-bit constant floating-point values on Darwin should really be loaded
as two parts. However, this premature splitting is a problem when DFmode
values can go into Altivec registers. */
return;
}
- if (reload_in_progress && cfun->machine->sdmode_stack_slot != NULL_RTX)
- cfun->machine->sdmode_stack_slot =
- eliminate_regs (cfun->machine->sdmode_stack_slot, VOIDmode, NULL_RTX);
-
-
/* Transform (p0:DD, (SUBREG:DD p1:SD)) to ((SUBREG:SD p0:DD),
p1:SD) if p1 is not of floating point class and p0 is spilled as
we can have no analogous movsd_store for this. */
return;
}
- if (reload_in_progress
- && mode == SDmode
- && cfun->machine->sdmode_stack_slot != NULL_RTX
- && MEM_P (operands[0])
- && rtx_equal_p (operands[0], cfun->machine->sdmode_stack_slot)
- && REG_P (operands[1]))
- {
- if (FP_REGNO_P (REGNO (operands[1])))
- {
- rtx mem = adjust_address_nv (operands[0], DDmode, 0);
- mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- emit_insn (gen_movsd_store (mem, operands[1]));
- }
- else if (INT_REGNO_P (REGNO (operands[1])))
- {
- rtx mem = operands[0];
- if (BYTES_BIG_ENDIAN)
- mem = adjust_address_nv (mem, mode, 4);
- mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- emit_insn (gen_movsd_hardfloat (mem, operands[1]));
- }
- else
- gcc_unreachable();
- return;
- }
- if (reload_in_progress
- && mode == SDmode
- && REG_P (operands[0])
- && MEM_P (operands[1])
- && cfun->machine->sdmode_stack_slot != NULL_RTX
- && rtx_equal_p (operands[1], cfun->machine->sdmode_stack_slot))
- {
- if (FP_REGNO_P (REGNO (operands[0])))
- {
- rtx mem = adjust_address_nv (operands[1], DDmode, 0);
- mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- emit_insn (gen_movsd_load (operands[0], mem));
- }
- else if (INT_REGNO_P (REGNO (operands[0])))
- {
- rtx mem = operands[1];
- if (BYTES_BIG_ENDIAN)
- mem = adjust_address_nv (mem, mode, 4);
- mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- emit_insn (gen_movsd_hardfloat (operands[0], mem));
- }
- else
- gcc_unreachable();
- return;
- }
-
/* FIXME: In the long term, this switch statement should go away
and be replaced by a sequence of tests based on things like
mode == Pmode. */
/* If we are to limit the number of things we put in the TOC and
this is a symbol plus a constant we can add in one insn,
- just put the symbol in the TOC and add the constant. Don't do
- this if reload is in progress. */
+ just put the symbol in the TOC and add the constant. */
if (GET_CODE (operands[1]) == CONST
- && TARGET_NO_SUM_IN_TOC && ! reload_in_progress
+ && TARGET_NO_SUM_IN_TOC
&& GET_CODE (XEXP (operands[1], 0)) == PLUS
&& add_operand (XEXP (XEXP (operands[1], 0), 1), mode)
&& (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF
/* Above, we may have called force_const_mem which may have returned
an invalid address. If we can, fix this up; otherwise, reload will
have to deal with it. */
- if (GET_CODE (operands[1]) == MEM && ! reload_in_progress)
+ if (GET_CODE (operands[1]) == MEM)
operands[1] = validize_mem (operands[1]);
- emit_set:
emit_insn (gen_rtx_SET (operands[0], operands[1]));
}
\f
return 1;
}
\f
-
-rtx
-rs6000_secondary_memory_needed_rtx (machine_mode mode)
-{
- static bool eliminated = false;
- rtx ret;
-
- if (mode != SDmode || TARGET_NO_SDMODE_STACK)
- ret = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
- else
- {
- rtx mem = cfun->machine->sdmode_stack_slot;
- gcc_assert (mem != NULL_RTX);
-
- if (!eliminated)
- {
- mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- cfun->machine->sdmode_stack_slot = mem;
- eliminated = true;
- }
- ret = mem;
- }
-
- if (TARGET_DEBUG_ADDR)
- {
- fprintf (stderr, "\nrs6000_secondary_memory_needed_rtx, mode %s, rtx:\n",
- GET_MODE_NAME (mode));
- if (!ret)
- fprintf (stderr, "\tNULL_RTX\n");
- else
- debug_rtx (ret);
- }
-
- return ret;
-}
-
/* Return the mode to be used for memory when a secondary memory
location is needed. For SDmode values we need to use DDmode, in
all other cases we can use the same mode. */
return mode;
}
-static tree
-rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
-{
- /* Don't walk into types. */
- if (*tp == NULL_TREE || *tp == error_mark_node || TYPE_P (*tp))
- {
- *walk_subtrees = 0;
- return NULL_TREE;
- }
-
- switch (TREE_CODE (*tp))
- {
- case VAR_DECL:
- case PARM_DECL:
- case FIELD_DECL:
- case RESULT_DECL:
- case SSA_NAME:
- case REAL_CST:
- case MEM_REF:
- case VIEW_CONVERT_EXPR:
- if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode)
- return *tp;
- break;
- default:
- break;
- }
-
- return NULL_TREE;
-}
-
/* Classify a register type. Because the FMRGOW/FMRGEW instructions only work
on traditional floating point registers, and the VMRGOW/VMRGEW instructions
only work on the traditional altivec registers, note if an altivec register
regno = REGNO (reg);
if (regno >= FIRST_PSEUDO_REGISTER)
{
- if (!lra_in_progress && !reload_in_progress && !reload_completed)
+ if (!lra_in_progress && !reload_completed)
return PSEUDO_REG_TYPE;
regno = true_regnum (reg);
return;
}
-/* Allocate a 64-bit stack slot to be used for copying SDmode values through if
- this function has any SDmode references. If we are on a power7 or later, we
- don't need the 64-bit stack slot since the LFIWZX and STIFWX instructions
- can load/store the value. */
-
-static void
-rs6000_alloc_sdmode_stack_slot (void)
-{
- tree t;
- basic_block bb;
- gimple_stmt_iterator gsi;
-
- gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
- /* We use a different approach for dealing with the secondary
- memory in LRA. */
- if (ira_use_lra_p)
- return;
-
- if (TARGET_NO_SDMODE_STACK)
- return;
-
- FOR_EACH_BB_FN (bb, cfun)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- tree ret = walk_gimple_op (gsi_stmt (gsi), rs6000_check_sdmode, NULL);
- if (ret)
- {
- rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
- cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
- SDmode, 0);
- return;
- }
- }
-
- /* Check for any SDmode parameters of the function. */
- for (t = DECL_ARGUMENTS (cfun->decl); t; t = DECL_CHAIN (t))
- {
- if (TREE_TYPE (t) == error_mark_node)
- continue;
-
- if (TYPE_MODE (TREE_TYPE (t)) == SDmode
- || TYPE_MODE (DECL_ARG_TYPE (t)) == SDmode)
- {
- rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
- cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
- SDmode, 0);
- return;
- }
- }
-}
-
-static void
-rs6000_instantiate_decls (void)
-{
- if (cfun->machine->sdmode_stack_slot != NULL_RTX)
- instantiate_decl_rtl (cfun->machine->sdmode_stack_slot);
-}
-
/* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use.
In general this is just CLASS; but on some machines
rs6000_pre_atomic_barrier (rtx mem, enum memmodel model)
{
rtx addr = XEXP (mem, 0);
- int strict_p = (reload_in_progress || reload_completed);
- if (!legitimate_indirect_address_p (addr, strict_p)
- && !legitimate_indexed_address_p (addr, strict_p))
+ if (!legitimate_indirect_address_p (addr, reload_completed)
+ && !legitimate_indexed_address_p (addr, reload_completed))
{
addr = force_reg (Pmode, addr);
mem = replace_equiv_address_nv (mem, addr);
{
rtx base, offset;
- if (reg == NULL && ! reload_in_progress && ! reload_completed)
+ if (reg == NULL && !reload_completed)
reg = gen_reg_rtx (Pmode);
if (GET_CODE (orig) == CONST)
{
if (SMALL_INT (offset))
return plus_constant (Pmode, base, INTVAL (offset));
- else if (! reload_in_progress && ! reload_completed)
+ else if (!reload_completed)
offset = force_reg (Pmode, offset);
else
{
{
rtx stack = assign_stack_temp (mode, GET_MODE_SIZE (mode));
rtx addr = XEXP (stack, 0);
- int strict_p = (reload_in_progress || reload_completed);
+ int strict_p = reload_completed;
if (!legitimate_indirect_address_p (addr, strict_p))
{
rtx
rs6000_address_for_fpconvert (rtx x)
{
- int strict_p = (reload_in_progress || reload_completed);
rtx addr;
gcc_assert (MEM_P (x));
addr = XEXP (x, 0);
- if (! legitimate_indirect_address_p (addr, strict_p)
- && ! legitimate_indexed_address_p (addr, strict_p))
+ if (! legitimate_indirect_address_p (addr, reload_completed)
+ && ! legitimate_indexed_address_p (addr, reload_completed))
{
if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC)
{
if (!altivec_indexed_or_indirect_operand (x, GET_MODE (x)))
{
rtx addr = XEXP (x, 0);
- int strict_p = (reload_in_progress || reload_completed);
- if (!legitimate_indexed_address_p (addr, strict_p)
- && !legitimate_indirect_address_p (addr, strict_p))
+ if (!legitimate_indexed_address_p (addr, reload_completed)
+ && !legitimate_indirect_address_p (addr, reload_completed))
addr = copy_to_mode_reg (Pmode, addr);
addr = gen_rtx_AND (Pmode, addr, GEN_INT (-16));