/* Output routines for Sunplus S+CORE processor
- Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2005-2013 Free Software Foundation, Inc.
Contributed by Sunnorth.
This file is part of GCC.
#include "debug.h"
#include "target.h"
#include "target-def.h"
-#include "integrate.h"
#include "langhooks.h"
-#include "cfglayout.h"
#include "df.h"
#include "opts.h"
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE score_option_override
-#undef TARGET_LEGITIMIZE_ADDRESS
-#define TARGET_LEGITIMIZE_ADDRESS score_legitimize_address
-
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE score_issue_rate
f->var_size = SCORE_STACK_ALIGN (size);
f->args_size = crtl->outgoing_args_size;
f->cprestore_size = flag_pic ? UNITS_PER_WORD : 0;
- if (f->var_size == 0 && current_function_is_leaf)
+ if (f->var_size == 0 && crtl->is_leaf)
f->args_size = f->cprestore_size = 0;
if (f->args_size == 0 && cfun->calls_alloca)
offset &= 0x3fff;
}
- return plus_constant (reg, offset);
+ return plus_constant (GET_MODE (reg), reg, offset);
}
/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text
/* Run just enough of rest_of_compilation. This sequence was
"borrowed" from alpha.c. */
insn = get_insns ();
- insn_locators_alloc ();
split_all_insns_noflow ();
shorten_branches (insn);
final_start_function (insn, file, 1);
return gen_rtx_LO_SUM (Pmode, high, addr);
}
-/* This function is used to implement LEGITIMIZE_ADDRESS. If X can
- be legitimized in a way that the generic machinery might not expect,
- return the new address. */
-static rtx
-score_legitimize_address (rtx x)
-{
- enum score_symbol_type symbol_type;
-
- if (score_symbolic_constant_p (x, &symbol_type)
- && symbol_type == SYMBOL_GENERAL)
- return score_split_symbol (0, x);
-
- if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x, 1)) == CONST_INT)
- {
- rtx reg = XEXP (x, 0);
- if (!score_valid_base_register_p (reg, 0))
- reg = copy_to_mode_reg (Pmode, reg);
- return score_add_offset (reg, INTVAL (XEXP (x, 1)));
- }
-
- return x;
-}
-
/* Fill INFO with information about a single argument. CUM is the
cumulative state for earlier arguments. MODE is the mode of this
argument and TYPE is its type (if known). NAMED is true if this
? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]),
tsize,
reg_names[RA_REGNUM],
- current_function_is_leaf ? 1 : 0,
+ crtl->is_leaf ? 1 : 0,
f->var_size,
f->num_gp,
f->args_size,
/* Implement TARGET_ADDRESS_COST macro. */
int
-score_address_cost (rtx addr,
+score_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ addr_space_t as ATTRIBUTE_UNUSED,
bool speed ATTRIBUTE_UNUSED)
{
return score_address_insns (addr, SImode);
REG_NOTES (insn) =
alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -size)),
+ plus_constant (Pmode, stack_pointer_rtx,
+ -size)),
REG_NOTES (insn));
}