Commit 269e3795 by Steven Bosscher

avr.c, [...]: Convert to ISO C90 function declarations and definitions.

	* config/avr/avr.c, config/avr/avr-protos.h: Convert to
	ISO C90 function declarations and definitions.

From-SVN: r72423
parent 3c94ac35
2003-10-12 Steven Bosscher <steven@gcc.gnu.org>
* config/avr/avr.c, config/avr/avr-protos.h: Convert to
ISO C90 function declarations and definitions.
2003-10-12 Nathanael Nerode <neroden@gcc.gnu.org> 2003-10-12 Nathanael Nerode <neroden@gcc.gnu.org>
* config.gcc (*-*-freebsd*): Use tm_defines instead of tiny * config.gcc (*-*-freebsd*): Use tm_defines instead of tiny
......
/* Prototypes for exported functions defined in avr.c /* Prototypes for exported functions defined in avr.c
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Denis Chertykov (denisc@overta.ru) Contributed by Denis Chertykov (denisc@overta.ru)
This file is part of GCC. This file is part of GCC.
...@@ -21,133 +21,115 @@ ...@@ -21,133 +21,115 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern int function_arg_regno_p PARAMS ((int r)); extern int function_arg_regno_p (int r);
extern void avr_init_once PARAMS ((void)); extern void avr_init_once (void);
extern void avr_override_options PARAMS ((void)); extern void avr_override_options (void);
extern void avr_optimization_options PARAMS ((int level, int size)); extern void avr_optimization_options (int level, int size);
extern char * avr_change_section PARAMS ((char *sect_name)); extern char *avr_change_section (char *sect_name);
extern int avr_ret_register PARAMS ((void)); extern int avr_ret_register (void);
extern enum reg_class class_likely_spilled_p PARAMS ((int c)); extern enum reg_class class_likely_spilled_p (int c);
extern enum reg_class avr_regno_reg_class PARAMS ((int r)); extern enum reg_class avr_regno_reg_class (int r);
extern enum reg_class avr_reg_class_from_letter PARAMS ((int c)); extern enum reg_class avr_reg_class_from_letter (int c);
extern int frame_pointer_required_p PARAMS ((void)); extern int frame_pointer_required_p (void);
extern void asm_globalize_label PARAMS ((FILE *file, const char *name)); extern void asm_globalize_label (FILE *file, const char *name);
extern void order_regs_for_local_alloc PARAMS ((void)); extern void order_regs_for_local_alloc (void);
extern int initial_elimination_offset PARAMS ((int from, int to)); extern int initial_elimination_offset (int from, int to);
extern int avr_simple_epilogue PARAMS ((void)); extern int avr_simple_epilogue (void);
extern void progmem_section PARAMS ((void)); extern void progmem_section (void);
extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask)); extern int mask_one_bit_p (HOST_WIDE_INT mask);
extern void gas_output_limited_string PARAMS ((FILE *file, const char *str)); extern void gas_output_limited_string (FILE *file, const char *str);
extern void gas_output_ascii PARAMS ((FILE *file, const char *str, extern void gas_output_ascii (FILE *file, const char *str, size_t length);
size_t length));
#ifdef TREE_CODE
extern void asm_output_external PARAMS ((FILE *file, tree decl,
char *name));
extern int avr_progmem_p PARAMS ((tree decl));
#ifdef TREE_CODE
extern void asm_output_external (FILE *file, tree decl, char *name);
extern int avr_progmem_p (tree decl);
#ifdef RTX_CODE /* inside TREE_CODE */ #ifdef RTX_CODE /* inside TREE_CODE */
extern rtx avr_function_value PARAMS ((tree type, tree func)); extern rtx avr_function_value (tree type, tree func);
extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *cum, extern void init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
tree fntype, rtx libname, rtx libname, tree fndecl);
tree fndecl)); extern rtx function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *cum, tree type, int named);
enum machine_mode mode,
tree type, int named));
#endif /* RTX_CODE inside TREE_CODE */ #endif /* RTX_CODE inside TREE_CODE */
#ifdef HAVE_MACHINE_MODES /* inside TREE_CODE */ #ifdef HAVE_MACHINE_MODES /* inside TREE_CODE */
extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *cum, extern void function_arg_advance (CUMULATIVE_ARGS *cum,
enum machine_mode mode, tree type, enum machine_mode mode, tree type,
int named)); int named);
#endif /* HAVE_MACHINE_MODES inside TREE_CODE*/ #endif /* HAVE_MACHINE_MODES inside TREE_CODE*/
#endif /* TREE_CODE */ #endif /* TREE_CODE */
#ifdef RTX_CODE #ifdef RTX_CODE
extern void asm_output_external_libcall PARAMS ((FILE *file, rtx symref)); extern void asm_output_external_libcall (FILE *file, rtx symref);
extern int legitimate_address_p PARAMS ((enum machine_mode mode, rtx x, extern int legitimate_address_p (enum machine_mode mode, rtx x, int strict);
int strict)); extern int compare_diff_p (rtx insn);
extern int compare_diff_p PARAMS ((rtx insn)); extern const char *output_movqi (rtx insn, rtx operands[], int *l);
extern const char * output_movqi PARAMS ((rtx insn, rtx operands[], int *l)); extern const char *output_movhi (rtx insn, rtx operands[], int *l);
extern const char * output_movhi PARAMS ((rtx insn, rtx operands[], int *l)); extern const char *out_movqi_r_mr (rtx insn, rtx op[], int *l);
extern const char * out_movqi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern const char *out_movqi_mr_r (rtx insn, rtx op[], int *l);
extern const char * out_movqi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern const char *out_movhi_r_mr (rtx insn, rtx op[], int *l);
extern const char * out_movhi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern const char *out_movhi_mr_r (rtx insn, rtx op[], int *l);
extern const char * out_movhi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern const char *out_movsi_r_mr (rtx insn, rtx op[], int *l);
extern const char * out_movsi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern const char *out_movsi_mr_r (rtx insn, rtx op[], int *l);
extern const char * out_movsi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern const char *output_movsisf (rtx insn, rtx operands[], int *l);
extern const char * output_movsisf PARAMS ((rtx insn, rtx operands[], int *l)); extern const char *out_tstsi (rtx insn, int *l);
extern const char * out_tstsi PARAMS ((rtx insn, int *l)); extern const char *out_tsthi (rtx insn, int *l);
extern const char * out_tsthi PARAMS ((rtx insn, int *l)); extern const char *ret_cond_branch (rtx x, int len, int reverse);
extern const char * ret_cond_branch PARAMS ((rtx x, int len, int reverse));
extern const char *ashlqi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashlqi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *ashlhi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashlhi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *ashlsi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashlsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char *ashrqi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashrqi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *ashrhi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashrhi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *ashrsi3_out (rtx insn, rtx operands[], int *len);
extern const char * ashrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern const char *lshrqi3_out (rtx insn, rtx operands[], int *len);
extern const char * lshrqi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *lshrhi3_out (rtx insn, rtx operands[], int *len);
extern const char * lshrhi3_out PARAMS ((rtx insn, rtx operands[], int *len)); extern const char *lshrsi3_out (rtx insn, rtx operands[], int *len);
extern const char * lshrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
extern void avr_output_bld (rtx operands[], int bit_nr);
extern void avr_output_bld PARAMS ((rtx operands[], int bit_nr)); extern void avr_output_addr_vec_elt (FILE *stream, int value);
extern void avr_output_addr_vec_elt PARAMS ((FILE *stream, int value)); extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
extern const char *avr_out_sbxx_branch PARAMS ((rtx insn, rtx operands[]));
extern enum reg_class preferred_reload_class (rtx x, enum reg_class class);
extern enum reg_class preferred_reload_class PARAMS ((rtx x, extern int extra_constraint (rtx x, int c);
enum reg_class class)); extern rtx legitimize_address (rtx x, rtx oldx, enum machine_mode mode);
extern int extra_constraint PARAMS ((rtx x, int c)); extern int adjust_insn_length (rtx insn, int len);
extern rtx legitimize_address PARAMS ((rtx x, rtx oldx, extern rtx avr_libcall_value (enum machine_mode mode);
enum machine_mode mode)); extern const char *output_reload_inhi (rtx insn, rtx *operands, int *len);
extern int adjust_insn_length PARAMS ((rtx insn, int len)); extern const char *output_reload_insisf (rtx insn, rtx *operands, int *len);
extern rtx avr_libcall_value PARAMS ((enum machine_mode mode)); extern enum reg_class secondary_input_reload_class (enum reg_class,
extern const char * output_reload_inhi PARAMS ((rtx insn, rtx *operands,
int *len));
extern const char * output_reload_insisf PARAMS ((rtx insn, rtx *operands,
int *len));
extern enum reg_class secondary_input_reload_class PARAMS ((enum reg_class,
enum machine_mode, enum machine_mode,
rtx)); rtx);
extern void notice_update_cc PARAMS ((rtx body, rtx insn)); extern void notice_update_cc (rtx body, rtx insn);
extern void print_operand PARAMS ((FILE *file, rtx x, int code)); extern void print_operand (FILE *file, rtx x, int code);
extern void print_operand_address PARAMS ((FILE *file, rtx addr)); extern void print_operand_address (FILE *file, rtx addr);
extern int reg_unused_after PARAMS ((rtx insn, rtx reg)); extern int reg_unused_after (rtx insn, rtx reg);
extern int _reg_unused_after PARAMS ((rtx insn, rtx reg)); extern int _reg_unused_after (rtx insn, rtx reg);
extern int avr_jump_mode PARAMS ((rtx x, rtx insn)); extern int avr_jump_mode (rtx x, rtx insn);
extern int byte_immediate_operand PARAMS ((register rtx op, extern int byte_immediate_operand (rtx op, enum machine_mode mode);
enum machine_mode mode)); extern int test_hard_reg_class (enum reg_class class, rtx x);
extern int test_hard_reg_class PARAMS ((enum reg_class class, rtx x)); extern int jump_over_one_insn_p (rtx insn, rtx dest);
extern int jump_over_one_insn_p PARAMS ((rtx insn, rtx dest));
extern int avr_hard_regno_mode_ok (int regno, enum machine_mode mode);
extern int avr_hard_regno_mode_ok PARAMS ((int regno, extern int call_insn_operand (rtx op, enum machine_mode mode);
enum machine_mode mode)); extern void final_prescan_insn (rtx insn, rtx *operand, int num_operands);
extern int call_insn_operand PARAMS ((rtx op, enum machine_mode mode)); extern int avr_simplify_comparison_p (enum machine_mode mode,
extern void final_prescan_insn PARAMS ((rtx insn, rtx *operand, RTX_CODE operator, rtx x);
int num_operands)); extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
extern int avr_simplify_comparison_p PARAMS ((enum machine_mode mode, extern int compare_eq_p (rtx insn);
RTX_CODE operator, rtx x)); extern void out_shift_with_cnt (const char *template, rtx insn,
extern RTX_CODE avr_normalize_condition PARAMS ((RTX_CODE condition)); rtx operands[], int *len, int t_len);
extern int compare_eq_p PARAMS ((rtx insn)); extern int avr_io_address_p (rtx x, int size);
extern void out_shift_with_cnt PARAMS ((const char *template, rtx insn, extern int const_int_pow2_p (rtx x);
rtx operands[], int *len, extern int avr_peep2_scratch_safe (rtx reg_rtx);
int t_len));
extern int avr_io_address_p PARAMS ((rtx x, int size));
extern int const_int_pow2_p PARAMS ((rtx x));
extern int avr_peep2_scratch_safe PARAMS ((rtx reg_rtx));
#endif /* RTX_CODE */ #endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
extern int class_max_nregs PARAMS ((enum reg_class class, extern int class_max_nregs (enum reg_class class, enum machine_mode mode);
enum machine_mode mode));
#endif /* HAVE_MACHINE_MODES */ #endif /* HAVE_MACHINE_MODES */
#ifdef REAL_VALUE_TYPE #ifdef REAL_VALUE_TYPE
extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
extern void asm_output_float PARAMS ((FILE *file, REAL_VALUE_TYPE n));
#endif #endif
...@@ -46,36 +46,36 @@ ...@@ -46,36 +46,36 @@
/* Maximal allowed offset for an address in the LD command */ /* Maximal allowed offset for an address in the LD command */
#define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE)) #define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
static int avr_naked_function_p PARAMS ((tree)); static int avr_naked_function_p (tree);
static int interrupt_function_p PARAMS ((tree)); static int interrupt_function_p (tree);
static int signal_function_p PARAMS ((tree)); static int signal_function_p (tree);
static int avr_regs_to_save PARAMS ((HARD_REG_SET *)); static int avr_regs_to_save (HARD_REG_SET *);
static int sequent_regs_live PARAMS ((void)); static int sequent_regs_live (void);
static const char * ptrreg_to_str PARAMS ((int)); static const char *ptrreg_to_str (int);
static const char * cond_string PARAMS ((enum rtx_code)); static const char *cond_string (enum rtx_code);
static int avr_num_arg_regs PARAMS ((enum machine_mode, tree)); static int avr_num_arg_regs (enum machine_mode, tree);
static int out_adj_frame_ptr PARAMS ((FILE *, int)); static int out_adj_frame_ptr (FILE *, int);
static int out_set_stack_ptr PARAMS ((FILE *, int, int)); static int out_set_stack_ptr (FILE *, int, int);
static RTX_CODE compare_condition PARAMS ((rtx insn)); static RTX_CODE compare_condition (rtx insn);
static int compare_sign_p PARAMS ((rtx insn)); static int compare_sign_p (rtx insn);
static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree avr_handle_progmem_attribute (tree *, tree, tree, int, bool *);
static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree avr_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
const struct attribute_spec avr_attribute_table[]; const struct attribute_spec avr_attribute_table[];
static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int)); static bool avr_assemble_integer (rtx, unsigned int, int);
static void avr_file_start PARAMS ((void)); static void avr_file_start (void);
static void avr_file_end PARAMS ((void)); static void avr_file_end (void);
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_output_function_prologue (FILE *, HOST_WIDE_INT);
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static void avr_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void avr_unique_section PARAMS ((tree, int)); static void avr_unique_section (tree, int);
static void avr_insert_attributes PARAMS ((tree, tree *)); static void avr_insert_attributes (tree, tree *);
static unsigned int avr_section_type_flags PARAMS ((tree, const char *, int)); static unsigned int avr_section_type_flags (tree, const char *, int);
static void avr_reorg PARAMS ((void)); static void avr_reorg (void);
static void avr_asm_out_ctor PARAMS ((rtx, int)); static void avr_asm_out_ctor (rtx, int);
static void avr_asm_out_dtor PARAMS ((rtx, int)); static void avr_asm_out_dtor (rtx, int);
static int default_rtx_costs PARAMS ((rtx, enum rtx_code, enum rtx_code)); static int default_rtx_costs (rtx, enum rtx_code, enum rtx_code);
static bool avr_rtx_costs PARAMS ((rtx, int, int, int *)); static bool avr_rtx_costs (rtx, int, int, int *);
static int avr_address_cost PARAMS ((rtx)); static int avr_address_cost (rtx);
/* Allocate registers from r25 to r8 for parameters for function calls */ /* Allocate registers from r25 to r8 for parameters for function calls */
#define FIRST_CUM_REG 26 #define FIRST_CUM_REG 26
...@@ -248,7 +248,7 @@ int avr_case_values_threshold = 30000; ...@@ -248,7 +248,7 @@ int avr_case_values_threshold = 30000;
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
void void
avr_override_options () avr_override_options (void)
{ {
const struct mcu_type_s *t; const struct mcu_type_s *t;
const struct base_arch_s *base; const struct base_arch_s *base;
...@@ -279,7 +279,7 @@ avr_override_options () ...@@ -279,7 +279,7 @@ avr_override_options ()
#if 0 /* Does not play nice with GC. FIXME. */ #if 0 /* Does not play nice with GC. FIXME. */
/* Initialize TMP_REG_RTX and ZERO_REG_RTX */ /* Initialize TMP_REG_RTX and ZERO_REG_RTX */
void void
avr_init_once () avr_init_once (void)
{ {
tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion)); tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
PUT_CODE (tmp_reg_rtx, REG); PUT_CODE (tmp_reg_rtx, REG);
...@@ -317,8 +317,7 @@ static const int reg_class_tab[]={ ...@@ -317,8 +317,7 @@ static const int reg_class_tab[]={
/* Return register class for register R */ /* Return register class for register R */
enum reg_class enum reg_class
avr_regno_reg_class (r) avr_regno_reg_class (int r)
int r;
{ {
if (r <= 33) if (r <= 33)
return reg_class_tab[r]; return reg_class_tab[r];
...@@ -334,8 +333,7 @@ avr_regno_reg_class (r) ...@@ -334,8 +333,7 @@ avr_regno_reg_class (r)
passed to this macro; you do not need to handle it. */ passed to this macro; you do not need to handle it. */
enum reg_class enum reg_class
avr_reg_class_from_letter (c) avr_reg_class_from_letter (int c)
int c;
{ {
switch (c) switch (c)
{ {
...@@ -358,8 +356,7 @@ avr_reg_class_from_letter (c) ...@@ -358,8 +356,7 @@ avr_reg_class_from_letter (c)
/* Return nonzero if FUNC is a naked function. */ /* Return nonzero if FUNC is a naked function. */
static int static int
avr_naked_function_p (func) avr_naked_function_p (tree func)
tree func;
{ {
tree a; tree a;
...@@ -374,8 +371,7 @@ avr_naked_function_p (func) ...@@ -374,8 +371,7 @@ avr_naked_function_p (func)
by the "interrupt" attribute. */ by the "interrupt" attribute. */
static int static int
interrupt_function_p (func) interrupt_function_p (tree func)
tree func;
{ {
tree a; tree a;
...@@ -390,8 +386,7 @@ interrupt_function_p (func) ...@@ -390,8 +386,7 @@ interrupt_function_p (func)
by the "signal" attribute. */ by the "signal" attribute. */
static int static int
signal_function_p (func) signal_function_p (tree func)
tree func;
{ {
tree a; tree a;
...@@ -406,8 +401,7 @@ signal_function_p (func) ...@@ -406,8 +401,7 @@ signal_function_p (func)
of the current function, and optionally store these registers in SET. */ of the current function, and optionally store these registers in SET. */
static int static int
avr_regs_to_save (set) avr_regs_to_save (HARD_REG_SET *set)
HARD_REG_SET *set;
{ {
int reg, count; int reg, count;
int int_or_sig_p = (interrupt_function_p (current_function_decl) int int_or_sig_p = (interrupt_function_p (current_function_decl)
...@@ -446,9 +440,7 @@ avr_regs_to_save (set) ...@@ -446,9 +440,7 @@ avr_regs_to_save (set)
/* Compute offset between arg_pointer and frame_pointer */ /* Compute offset between arg_pointer and frame_pointer */
int int
initial_elimination_offset (from, to) initial_elimination_offset (int from, int to)
int from;
int to;
{ {
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return 0; return 0;
...@@ -464,7 +456,7 @@ initial_elimination_offset (from, to) ...@@ -464,7 +456,7 @@ initial_elimination_offset (from, to)
/* Return 1 if the function epilogue is just a single "ret". */ /* Return 1 if the function epilogue is just a single "ret". */
int int
avr_simple_epilogue () avr_simple_epilogue (void)
{ {
return (! frame_pointer_needed return (! frame_pointer_needed
&& get_frame_size () == 0 && get_frame_size () == 0
...@@ -479,7 +471,7 @@ avr_simple_epilogue () ...@@ -479,7 +471,7 @@ avr_simple_epilogue ()
/* This function checks sequence of live registers */ /* This function checks sequence of live registers */
static int static int
sequent_regs_live () sequent_regs_live (void)
{ {
int reg; int reg;
int live_seq=0; int live_seq=0;
...@@ -531,9 +523,7 @@ sequent_regs_live () ...@@ -531,9 +523,7 @@ sequent_regs_live ()
(epilogue). Returns the number of instructions generated. */ (epilogue). Returns the number of instructions generated. */
static int static int
out_adj_frame_ptr (file, adj) out_adj_frame_ptr (FILE *file, int adj)
FILE *file;
int adj;
{ {
int size = 0; int size = 0;
...@@ -578,10 +568,7 @@ out_adj_frame_ptr (file, adj) ...@@ -578,10 +568,7 @@ out_adj_frame_ptr (file, adj)
Returns the number of instructions generated. */ Returns the number of instructions generated. */
static int static int
out_set_stack_ptr (file, before, after) out_set_stack_ptr (FILE *file, int before, int after)
FILE *file;
int before;
int after;
{ {
int do_sph, do_cli, do_save, do_sei, lock_sph, size; int do_sph, do_cli, do_save, do_sei, lock_sph, size;
...@@ -641,9 +628,7 @@ out_set_stack_ptr (file, before, after) ...@@ -641,9 +628,7 @@ out_set_stack_ptr (file, before, after)
/* Output function prologue */ /* Output function prologue */
static void static void
avr_output_function_prologue (file, size) avr_output_function_prologue (FILE *file, HOST_WIDE_INT size)
FILE *file;
HOST_WIDE_INT size;
{ {
int reg; int reg;
int interrupt_func_p; int interrupt_func_p;
...@@ -773,9 +758,7 @@ avr_output_function_prologue (file, size) ...@@ -773,9 +758,7 @@ avr_output_function_prologue (file, size)
/* Output function epilogue */ /* Output function epilogue */
static void static void
avr_output_function_epilogue (file, size) avr_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
FILE *file;
HOST_WIDE_INT size;
{ {
int reg; int reg;
int interrupt_func_p; int interrupt_func_p;
...@@ -924,10 +907,7 @@ avr_output_function_epilogue (file, size) ...@@ -924,10 +907,7 @@ avr_output_function_epilogue (file, size)
machine for a memory operand of mode MODE. */ machine for a memory operand of mode MODE. */
int int
legitimate_address_p (mode, x, strict) legitimate_address_p (enum machine_mode mode, rtx x, int strict)
enum machine_mode mode;
rtx x;
int strict;
{ {
enum reg_class r = NO_REGS; enum reg_class r = NO_REGS;
...@@ -992,10 +972,7 @@ legitimate_address_p (mode, x, strict) ...@@ -992,10 +972,7 @@ legitimate_address_p (mode, x, strict)
memory address for an operand of mode MODE */ memory address for an operand of mode MODE */
rtx rtx
legitimize_address (x, oldx, mode) legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
rtx x;
rtx oldx;
enum machine_mode mode;
{ {
x = oldx; x = oldx;
if (TARGET_ALL_DEBUG) if (TARGET_ALL_DEBUG)
...@@ -1028,8 +1005,7 @@ legitimize_address (x, oldx, mode) ...@@ -1028,8 +1005,7 @@ legitimize_address (x, oldx, mode)
/* Return a pointer register name as a string */ /* Return a pointer register name as a string */
static const char * static const char *
ptrreg_to_str (regno) ptrreg_to_str (int regno)
int regno;
{ {
switch (regno) switch (regno)
{ {
...@@ -1046,8 +1022,7 @@ ptrreg_to_str (regno) ...@@ -1046,8 +1022,7 @@ ptrreg_to_str (regno)
Used in conditional jump constructing */ Used in conditional jump constructing */
static const char * static const char *
cond_string (code) cond_string (enum rtx_code code)
enum rtx_code code;
{ {
switch (code) switch (code)
{ {
...@@ -1077,9 +1052,7 @@ cond_string (code) ...@@ -1077,9 +1052,7 @@ cond_string (code)
/* Output ADDR to FILE as address */ /* Output ADDR to FILE as address */
void void
print_operand_address (file, addr) print_operand_address (FILE *file, rtx addr)
FILE *file;
rtx addr;
{ {
switch (GET_CODE (addr)) switch (GET_CODE (addr))
{ {
...@@ -1113,10 +1086,7 @@ print_operand_address (file, addr) ...@@ -1113,10 +1086,7 @@ print_operand_address (file, addr)
/* Output X as assembler operand to file FILE */ /* Output X as assembler operand to file FILE */
void void
print_operand (file, x, code) print_operand (FILE *file, rtx x, int code)
FILE *file;
rtx x;
int code;
{ {
int abcd = 0; int abcd = 0;
...@@ -1187,9 +1157,7 @@ print_operand (file, x, code) ...@@ -1187,9 +1157,7 @@ print_operand (file, x, code)
/* Recognize operand OP of mode MODE used in call instructions */ /* Recognize operand OP of mode MODE used in call instructions */
int int
call_insn_operand (op, mode) call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (op) == MEM) if (GET_CODE (op) == MEM)
{ {
...@@ -1205,9 +1173,7 @@ call_insn_operand (op, mode) ...@@ -1205,9 +1173,7 @@ call_insn_operand (op, mode)
/* Update the condition code in the INSN. */ /* Update the condition code in the INSN. */
void void
notice_update_cc (body, insn) notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
rtx body ATTRIBUTE_UNUSED;
rtx insn;
{ {
rtx set; rtx set;
...@@ -1282,9 +1248,7 @@ notice_update_cc (body, insn) ...@@ -1282,9 +1248,7 @@ notice_update_cc (body, insn)
class CLASS needed to hold a value of mode MODE. */ class CLASS needed to hold a value of mode MODE. */
int int
class_max_nregs (class, mode) class_max_nregs (enum reg_class class ATTRIBUTE_UNUSED,enum machine_mode mode)
enum reg_class class ATTRIBUTE_UNUSED;
enum machine_mode mode;
{ {
return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
} }
...@@ -1295,9 +1259,7 @@ class_max_nregs (class, mode) ...@@ -1295,9 +1259,7 @@ class_max_nregs (class, mode)
3 - absolute jump (only for ATmega[16]03). */ 3 - absolute jump (only for ATmega[16]03). */
int int
avr_jump_mode (x, insn) avr_jump_mode (rtx x, rtx insn)
rtx x; /* jump operand */
rtx insn; /* jump insn */
{ {
int dest_addr = INSN_ADDRESSES (INSN_UID (GET_MODE (x) == LABEL_REF int dest_addr = INSN_ADDRESSES (INSN_UID (GET_MODE (x) == LABEL_REF
? XEXP (x, 0) : x)); ? XEXP (x, 0) : x));
...@@ -1320,10 +1282,7 @@ avr_jump_mode (x, insn) ...@@ -1320,10 +1282,7 @@ avr_jump_mode (x, insn)
if REVERSE nonzero then condition code in X must be reversed. */ if REVERSE nonzero then condition code in X must be reversed. */
const char * const char *
ret_cond_branch (x, len, reverse) ret_cond_branch (rtx x, int len, int reverse)
rtx x;
int len;
int reverse;
{ {
RTX_CODE cond = reverse ? reverse_condition (GET_CODE (x)) : GET_CODE (x); RTX_CODE cond = reverse ? reverse_condition (GET_CODE (x)) : GET_CODE (x);
...@@ -1422,9 +1381,7 @@ ret_cond_branch (x, len, reverse) ...@@ -1422,9 +1381,7 @@ ret_cond_branch (x, len, reverse)
/* Predicate function for immediate operand which fits to byte (8bit) */ /* Predicate function for immediate operand which fits to byte (8bit) */
int int
byte_immediate_operand (op, mode) byte_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (op) == CONST_INT return (GET_CODE (op) == CONST_INT
&& INTVAL (op) <= 0xff && INTVAL (op) >= 0); && INTVAL (op) <= 0xff && INTVAL (op) >= 0);
...@@ -1436,9 +1393,8 @@ byte_immediate_operand (op, mode) ...@@ -1436,9 +1393,8 @@ byte_immediate_operand (op, mode)
Output insn cost for next insn. */ Output insn cost for next insn. */
void void
final_prescan_insn (insn, operand, num_operands) final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
rtx insn, *operand ATTRIBUTE_UNUSED; int num_operands ATTRIBUTE_UNUSED)
int num_operands ATTRIBUTE_UNUSED;
{ {
int uid = INSN_UID (insn); int uid = INSN_UID (insn);
...@@ -1455,10 +1411,7 @@ final_prescan_insn (insn, operand, num_operands) ...@@ -1455,10 +1411,7 @@ final_prescan_insn (insn, operand, num_operands)
/* Return 0 if undefined, 1 if always true or always false. */ /* Return 0 if undefined, 1 if always true or always false. */
int int
avr_simplify_comparison_p (mode, operator, x) avr_simplify_comparison_p (enum machine_mode mode, RTX_CODE operator, rtx x)
enum machine_mode mode;
RTX_CODE operator;
rtx x;
{ {
unsigned int max = (mode == QImode ? 0xff : unsigned int max = (mode == QImode ? 0xff :
mode == HImode ? 0xffff : mode == HImode ? 0xffff :
...@@ -1480,8 +1433,7 @@ avr_simplify_comparison_p (mode, operator, x) ...@@ -1480,8 +1433,7 @@ avr_simplify_comparison_p (mode, operator, x)
register in which function arguments are sometimes passed. */ register in which function arguments are sometimes passed. */
int int
function_arg_regno_p(r) function_arg_regno_p(int r)
int r;
{ {
return (r >= 8 && r <= 25); return (r >= 8 && r <= 25);
} }
...@@ -1490,11 +1442,8 @@ function_arg_regno_p(r) ...@@ -1490,11 +1442,8 @@ function_arg_regno_p(r)
of the argument list. */ of the argument list. */
void void
init_cumulative_args (cum, fntype, libname, fndecl) init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname,
CUMULATIVE_ARGS *cum; tree fndecl ATTRIBUTE_UNUSED)
tree fntype;
rtx libname;
tree fndecl ATTRIBUTE_UNUSED;
{ {
cum->nregs = 18; cum->nregs = 18;
cum->regno = FIRST_CUM_REG; cum->regno = FIRST_CUM_REG;
...@@ -1511,9 +1460,7 @@ init_cumulative_args (cum, fntype, libname, fndecl) ...@@ -1511,9 +1460,7 @@ init_cumulative_args (cum, fntype, libname, fndecl)
/* Returns the number of registers to allocate for a function argument. */ /* Returns the number of registers to allocate for a function argument. */
static int static int
avr_num_arg_regs (mode, type) avr_num_arg_regs (enum machine_mode mode, tree type)
enum machine_mode mode;
tree type;
{ {
int size; int size;
...@@ -1532,11 +1479,8 @@ avr_num_arg_regs (mode, type) ...@@ -1532,11 +1479,8 @@ avr_num_arg_regs (mode, type)
in a register, and which register. */ in a register, and which register. */
rtx rtx
function_arg (cum, mode, type, named) function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
CUMULATIVE_ARGS *cum; int named ATTRIBUTE_UNUSED)
enum machine_mode mode;
tree type;
int named ATTRIBUTE_UNUSED;
{ {
int bytes = avr_num_arg_regs (mode, type); int bytes = avr_num_arg_regs (mode, type);
...@@ -1550,11 +1494,8 @@ function_arg (cum, mode, type, named) ...@@ -1550,11 +1494,8 @@ function_arg (cum, mode, type, named)
in the argument list. */ in the argument list. */
void void
function_arg_advance (cum, mode, type, named) function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
CUMULATIVE_ARGS *cum; /* current arg information */ int named ATTRIBUTE_UNUSED)
enum machine_mode mode; /* current arg mode */
tree type; /* type of the argument or 0 if lib support */
int named ATTRIBUTE_UNUSED; /* whether or not the argument was named */
{ {
int bytes = avr_num_arg_regs (mode, type); int bytes = avr_num_arg_regs (mode, type);
...@@ -1572,10 +1513,7 @@ function_arg_advance (cum, mode, type, named) ...@@ -1572,10 +1513,7 @@ function_arg_advance (cum, mode, type, named)
Functions for outputting various mov's for a various modes Functions for outputting various mov's for a various modes
************************************************************************/ ************************************************************************/
const char * const char *
output_movqi (insn, operands, l) output_movqi (rtx insn, rtx operands[], int *l)
rtx insn;
rtx operands[];
int *l;
{ {
int dummy; int dummy;
rtx dest = operands[0]; rtx dest = operands[0];
...@@ -1667,10 +1605,7 @@ output_movqi (insn, operands, l) ...@@ -1667,10 +1605,7 @@ output_movqi (insn, operands, l)
const char * const char *
output_movhi (insn, operands, l) output_movhi (rtx insn, rtx operands[], int *l)
rtx insn;
rtx operands[];
int *l;
{ {
int dummy; int dummy;
rtx dest = operands[0]; rtx dest = operands[0];
...@@ -1833,10 +1768,7 @@ output_movhi (insn, operands, l) ...@@ -1833,10 +1768,7 @@ output_movhi (insn, operands, l)
} }
const char * const char *
out_movqi_r_mr (insn, op, l) out_movqi_r_mr (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l; /* instruction length */
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -1899,10 +1831,7 @@ out_movqi_r_mr (insn, op, l) ...@@ -1899,10 +1831,7 @@ out_movqi_r_mr (insn, op, l)
} }
const char * const char *
out_movhi_r_mr (insn, op, l) out_movhi_r_mr (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l; /* instruction length */
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -2033,10 +1962,7 @@ out_movhi_r_mr (insn, op, l) ...@@ -2033,10 +1962,7 @@ out_movhi_r_mr (insn, op, l)
} }
const char * const char *
out_movsi_r_mr (insn, op, l) out_movsi_r_mr (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l; /* instruction length */
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -2197,10 +2123,7 @@ out_movsi_r_mr (insn, op, l) ...@@ -2197,10 +2123,7 @@ out_movsi_r_mr (insn, op, l)
} }
const char * const char *
out_movsi_mr_r (insn, op, l) out_movsi_mr_r (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l;
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -2355,10 +2278,7 @@ out_movsi_mr_r (insn, op, l) ...@@ -2355,10 +2278,7 @@ out_movsi_mr_r (insn, op, l)
} }
const char * const char *
output_movsisf(insn, operands, l) output_movsisf(rtx insn, rtx operands[], int *l)
rtx insn;
rtx operands[];
int *l;
{ {
int dummy; int dummy;
rtx dest = operands[0]; rtx dest = operands[0];
...@@ -2509,10 +2429,7 @@ output_movsisf(insn, operands, l) ...@@ -2509,10 +2429,7 @@ output_movsisf(insn, operands, l)
} }
const char * const char *
out_movqi_mr_r (insn, op, l) out_movqi_mr_r (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l; /* instruction length */
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -2587,10 +2504,7 @@ out_movqi_mr_r (insn, op, l) ...@@ -2587,10 +2504,7 @@ out_movqi_mr_r (insn, op, l)
} }
const char * const char *
out_movhi_mr_r (insn, op, l) out_movhi_mr_r (rtx insn, rtx op[], int *l)
rtx insn;
rtx op[];
int *l;
{ {
rtx dest = op[0]; rtx dest = op[0];
rtx src = op[1]; rtx src = op[1];
...@@ -2703,7 +2617,7 @@ out_movhi_mr_r (insn, op, l) ...@@ -2703,7 +2617,7 @@ out_movhi_mr_r (insn, op, l)
/* Return 1 if frame pointer for current function required */ /* Return 1 if frame pointer for current function required */
int int
frame_pointer_required_p () frame_pointer_required_p (void)
{ {
return (current_function_calls_alloca return (current_function_calls_alloca
|| current_function_args_info.nregs == 0 || current_function_args_info.nregs == 0
...@@ -2713,8 +2627,7 @@ frame_pointer_required_p () ...@@ -2713,8 +2627,7 @@ frame_pointer_required_p ()
/* Returns the condition of compare insn INSN, or UNKNOWN. */ /* Returns the condition of compare insn INSN, or UNKNOWN. */
static RTX_CODE static RTX_CODE
compare_condition (insn) compare_condition (rtx insn)
rtx insn;
{ {
rtx next = next_real_insn (insn); rtx next = next_real_insn (insn);
RTX_CODE cond = UNKNOWN; RTX_CODE cond = UNKNOWN;
...@@ -2731,8 +2644,7 @@ compare_condition (insn) ...@@ -2731,8 +2644,7 @@ compare_condition (insn)
/* Returns nonzero if INSN is a tst insn that only tests the sign. */ /* Returns nonzero if INSN is a tst insn that only tests the sign. */
static int static int
compare_sign_p (insn) compare_sign_p (rtx insn)
rtx insn;
{ {
RTX_CODE cond = compare_condition (insn); RTX_CODE cond = compare_condition (insn);
return (cond == GE || cond == LT); return (cond == GE || cond == LT);
...@@ -2742,8 +2654,7 @@ compare_sign_p (insn) ...@@ -2742,8 +2654,7 @@ compare_sign_p (insn)
that needs to be swapped (GT, GTU, LE, LEU). */ that needs to be swapped (GT, GTU, LE, LEU). */
int int
compare_diff_p (insn) compare_diff_p (rtx insn)
rtx insn;
{ {
RTX_CODE cond = compare_condition (insn); RTX_CODE cond = compare_condition (insn);
return (cond == GT || cond == GTU || cond == LE || cond == LEU) ? cond : 0; return (cond == GT || cond == GTU || cond == LE || cond == LEU) ? cond : 0;
...@@ -2752,8 +2663,7 @@ compare_diff_p (insn) ...@@ -2752,8 +2663,7 @@ compare_diff_p (insn)
/* Returns nonzero if INSN is a compare insn with the EQ or NE condition. */ /* Returns nonzero if INSN is a compare insn with the EQ or NE condition. */
int int
compare_eq_p (insn) compare_eq_p (rtx insn)
rtx insn;
{ {
RTX_CODE cond = compare_condition (insn); RTX_CODE cond = compare_condition (insn);
return (cond == EQ || cond == NE); return (cond == EQ || cond == NE);
...@@ -2763,9 +2673,7 @@ compare_eq_p (insn) ...@@ -2763,9 +2673,7 @@ compare_eq_p (insn)
/* Output test instruction for HImode */ /* Output test instruction for HImode */
const char * const char *
out_tsthi (insn, l) out_tsthi (rtx insn, int *l)
rtx insn;
int *l;
{ {
if (compare_sign_p (insn)) if (compare_sign_p (insn))
{ {
...@@ -2793,9 +2701,7 @@ out_tsthi (insn, l) ...@@ -2793,9 +2701,7 @@ out_tsthi (insn, l)
/* Output test instruction for SImode */ /* Output test instruction for SImode */
const char * const char *
out_tstsi (insn, l) out_tstsi (rtx insn, int *l)
rtx insn;
int *l;
{ {
if (compare_sign_p (insn)) if (compare_sign_p (insn))
{ {
...@@ -2823,12 +2729,8 @@ out_tstsi (insn, l) ...@@ -2823,12 +2729,8 @@ out_tstsi (insn, l)
carefully hand-optimized in ?sh??i3_out. */ carefully hand-optimized in ?sh??i3_out. */
void void
out_shift_with_cnt (template, insn, operands, len, t_len) out_shift_with_cnt (const char *template, rtx insn, rtx operands[],
const char *template; int *len, int t_len)
rtx insn;
rtx operands[];
int *len;
int t_len; /* Length of template. */
{ {
rtx op[10]; rtx op[10];
char str[500]; char str[500];
...@@ -2961,10 +2863,7 @@ out_shift_with_cnt (template, insn, operands, len, t_len) ...@@ -2961,10 +2863,7 @@ out_shift_with_cnt (template, insn, operands, len, t_len)
/* 8bit shift left ((char)x << i) */ /* 8bit shift left ((char)x << i) */
const char * const char *
ashlqi3_out (insn, operands, len) ashlqi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len; /* insn length (may be NULL) */
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3058,10 +2957,7 @@ ashlqi3_out (insn, operands, len) ...@@ -3058,10 +2957,7 @@ ashlqi3_out (insn, operands, len)
/* 16bit shift left ((short)x << i) */ /* 16bit shift left ((short)x << i) */
const char * const char *
ashlhi3_out (insn, operands, len) ashlhi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3314,10 +3210,7 @@ ashlhi3_out (insn, operands, len) ...@@ -3314,10 +3210,7 @@ ashlhi3_out (insn, operands, len)
/* 32bit shift left ((long)x << i) */ /* 32bit shift left ((long)x << i) */
const char * const char *
ashlsi3_out (insn, operands, len) ashlsi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3418,10 +3311,7 @@ ashlsi3_out (insn, operands, len) ...@@ -3418,10 +3311,7 @@ ashlsi3_out (insn, operands, len)
/* 8bit arithmetic shift right ((signed char)x >> i) */ /* 8bit arithmetic shift right ((signed char)x >> i) */
const char * const char *
ashrqi3_out (insn, operands, len) ashrqi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len; /* insn length */
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3488,10 +3378,7 @@ ashrqi3_out (insn, operands, len) ...@@ -3488,10 +3378,7 @@ ashrqi3_out (insn, operands, len)
/* 16bit arithmetic shift right ((signed short)x >> i) */ /* 16bit arithmetic shift right ((signed short)x >> i) */
const char * const char *
ashrhi3_out (insn, operands, len) ashrhi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3653,10 +3540,7 @@ ashrhi3_out (insn, operands, len) ...@@ -3653,10 +3540,7 @@ ashrhi3_out (insn, operands, len)
/* 32bit arithmetic shift right ((signed long)x >> i) */ /* 32bit arithmetic shift right ((signed long)x >> i) */
const char * const char *
ashrsi3_out (insn, operands, len) ashrsi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3772,10 +3656,7 @@ ashrsi3_out (insn, operands, len) ...@@ -3772,10 +3656,7 @@ ashrsi3_out (insn, operands, len)
/* 8bit logic shift right ((unsigned char)x >> i) */ /* 8bit logic shift right ((unsigned char)x >> i) */
const char * const char *
lshrqi3_out (insn, operands, len) lshrqi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -3867,10 +3748,7 @@ lshrqi3_out (insn, operands, len) ...@@ -3867,10 +3748,7 @@ lshrqi3_out (insn, operands, len)
/* 16bit logic shift right ((unsigned short)x >> i) */ /* 16bit logic shift right ((unsigned short)x >> i) */
const char * const char *
lshrhi3_out (insn, operands, len) lshrhi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -4122,10 +4000,7 @@ lshrhi3_out (insn, operands, len) ...@@ -4122,10 +4000,7 @@ lshrhi3_out (insn, operands, len)
/* 32bit logic shift right ((unsigned int)x >> i) */ /* 32bit logic shift right ((unsigned int)x >> i) */
const char * const char *
lshrsi3_out (insn, operands, len) lshrsi3_out (rtx insn, rtx operands[], int *len)
rtx insn;
rtx operands[];
int *len;
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
...@@ -4217,9 +4092,7 @@ lshrsi3_out (insn, operands, len) ...@@ -4217,9 +4092,7 @@ lshrsi3_out (insn, operands, len)
LEN is the initially computed length of the insn. */ LEN is the initially computed length of the insn. */
int int
adjust_insn_length (insn, len) adjust_insn_length (rtx insn, int len)
rtx insn;
int len;
{ {
rtx patt = PATTERN (insn); rtx patt = PATTERN (insn);
rtx set; rtx set;
...@@ -4367,9 +4240,7 @@ adjust_insn_length (insn, len) ...@@ -4367,9 +4240,7 @@ adjust_insn_length (insn, len)
/* Return nonzero if register REG dead after INSN */ /* Return nonzero if register REG dead after INSN */
int int
reg_unused_after (insn, reg) reg_unused_after (rtx insn, rtx reg)
rtx insn;
rtx reg;
{ {
return (dead_or_set_p (insn, reg) return (dead_or_set_p (insn, reg)
|| (REG_P(reg) && _reg_unused_after (insn, reg))); || (REG_P(reg) && _reg_unused_after (insn, reg)));
...@@ -4380,9 +4251,7 @@ reg_unused_after (insn, reg) ...@@ -4380,9 +4251,7 @@ reg_unused_after (insn, reg)
not live past labels. It may live past calls or jumps though. */ not live past labels. It may live past calls or jumps though. */
int int
_reg_unused_after (insn, reg) _reg_unused_after (rtx insn, rtx reg)
rtx insn;
rtx reg;
{ {
enum rtx_code code; enum rtx_code code;
rtx set; rtx set;
...@@ -4485,10 +4354,7 @@ _reg_unused_after (insn, reg) ...@@ -4485,10 +4354,7 @@ _reg_unused_after (insn, reg)
special handling for references to certain labels. */ special handling for references to certain labels. */
static bool static bool
avr_assemble_integer (x, size, aligned_p) avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
rtx x;
unsigned int size;
int aligned_p;
{ {
if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p
&& ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x)) && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x))
...@@ -4505,9 +4371,7 @@ avr_assemble_integer (x, size, aligned_p) ...@@ -4505,9 +4371,7 @@ avr_assemble_integer (x, size, aligned_p)
/* Sets section name for declaration DECL */ /* Sets section name for declaration DECL */
static void static void
avr_unique_section (decl, reloc) avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
tree decl;
int reloc ATTRIBUTE_UNUSED;
{ {
int len; int len;
const char *name, *prefix; const char *name, *prefix;
...@@ -4544,9 +4408,7 @@ avr_unique_section (decl, reloc) ...@@ -4544,9 +4408,7 @@ avr_unique_section (decl, reloc)
comma separated lists of numbers). */ comma separated lists of numbers). */
void void
gas_output_limited_string(file, str) gas_output_limited_string(FILE *file, const char *str)
FILE *file;
const char * str;
{ {
const unsigned char *_limited_str = (unsigned char *) str; const unsigned char *_limited_str = (unsigned char *) str;
unsigned ch; unsigned ch;
...@@ -4579,10 +4441,7 @@ gas_output_limited_string(file, str) ...@@ -4579,10 +4441,7 @@ gas_output_limited_string(file, str)
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */ STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
void void
gas_output_ascii(file, str, length) gas_output_ascii(FILE *file, const char *str, size_t length)
FILE * file;
const char * str;
size_t length;
{ {
const unsigned char *_ascii_bytes = (const unsigned char *) str; const unsigned char *_ascii_bytes = (const unsigned char *) str;
const unsigned char *limit = _ascii_bytes + length; const unsigned char *limit = _ascii_bytes + length;
...@@ -4640,8 +4499,7 @@ gas_output_ascii(file, str, length) ...@@ -4640,8 +4499,7 @@ gas_output_ascii(file, str, length)
because registers of CLASS are needed for spill registers. */ because registers of CLASS are needed for spill registers. */
enum reg_class enum reg_class
class_likely_spilled_p (c) class_likely_spilled_p (int c)
int c;
{ {
return (c != ALL_REGS && c != ADDW_REGS); return (c != ALL_REGS && c != ADDW_REGS);
} }
...@@ -4669,12 +4527,10 @@ const struct attribute_spec avr_attribute_table[] = ...@@ -4669,12 +4527,10 @@ const struct attribute_spec avr_attribute_table[] =
/* Handle a "progmem" attribute; arguments as in /* Handle a "progmem" attribute; arguments as in
struct attribute_spec.handler. */ struct attribute_spec.handler. */
static tree static tree
avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs) avr_handle_progmem_attribute (tree *node, tree name,
tree *node; tree args ATTRIBUTE_UNUSED,
tree name; int flags ATTRIBUTE_UNUSED,
tree args ATTRIBUTE_UNUSED; bool *no_add_attrs)
int flags ATTRIBUTE_UNUSED;
bool *no_add_attrs;
{ {
if (DECL_P (*node)) if (DECL_P (*node))
{ {
...@@ -4712,13 +4568,12 @@ avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs) ...@@ -4712,13 +4568,12 @@ avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in /* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */ struct attribute_spec.handler. */
static tree static tree
avr_handle_fndecl_attribute (node, name, args, flags, no_add_attrs) avr_handle_fndecl_attribute (tree *node, tree name,
tree *node; tree args ATTRIBUTE_UNUSED,
tree name; int flags ATTRIBUTE_UNUSED,
tree args ATTRIBUTE_UNUSED; bool *no_add_attrs)
int flags ATTRIBUTE_UNUSED;
bool *no_add_attrs;
{ {
if (TREE_CODE (*node) != FUNCTION_DECL) if (TREE_CODE (*node) != FUNCTION_DECL)
{ {
...@@ -4734,8 +4589,7 @@ avr_handle_fndecl_attribute (node, name, args, flags, no_add_attrs) ...@@ -4734,8 +4589,7 @@ avr_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
if found return 1, otherwise 0. */ if found return 1, otherwise 0. */
int int
avr_progmem_p (decl) avr_progmem_p (tree decl)
tree decl;
{ {
tree a; tree a;
...@@ -4763,9 +4617,7 @@ avr_progmem_p (decl) ...@@ -4763,9 +4617,7 @@ avr_progmem_p (decl)
/* Add the section attribute if the variable is in progmem. */ /* Add the section attribute if the variable is in progmem. */
static void static void
avr_insert_attributes (node, attributes) avr_insert_attributes (tree node, tree *attributes)
tree node;
tree *attributes;
{ {
if (TREE_CODE (node) == VAR_DECL if (TREE_CODE (node) == VAR_DECL
&& (TREE_STATIC (node) || DECL_EXTERNAL (node)) && (TREE_STATIC (node) || DECL_EXTERNAL (node))
...@@ -4783,10 +4635,7 @@ avr_insert_attributes (node, attributes) ...@@ -4783,10 +4635,7 @@ avr_insert_attributes (node, attributes)
} }
static unsigned int static unsigned int
avr_section_type_flags (decl, name, reloc) avr_section_type_flags (tree decl, const char *name, int reloc)
tree decl;
const char *name;
int reloc;
{ {
unsigned int flags = default_section_type_flags (decl, name, reloc); unsigned int flags = default_section_type_flags (decl, name, reloc);
...@@ -4807,7 +4656,7 @@ avr_section_type_flags (decl, name, reloc) ...@@ -4807,7 +4656,7 @@ avr_section_type_flags (decl, name, reloc)
file. */ file. */
static void static void
avr_file_start () avr_file_start (void)
{ {
if (avr_asm_only_p) if (avr_asm_only_p)
error ("MCU `%s' supported for assembler only", avr_mcu_name); error ("MCU `%s' supported for assembler only", avr_mcu_name);
...@@ -4837,7 +4686,7 @@ avr_file_start () ...@@ -4837,7 +4686,7 @@ avr_file_start ()
appropriate text to go at the end of an assembler file. */ appropriate text to go at the end of an assembler file. */
static void static void
avr_file_end () avr_file_end (void)
{ {
fputs ("/* File ", asm_out_file); fputs ("/* File ", asm_out_file);
output_quoted_string (asm_out_file, main_input_filename); output_quoted_string (asm_out_file, main_input_filename);
...@@ -4857,7 +4706,7 @@ avr_file_end () ...@@ -4857,7 +4706,7 @@ avr_file_end ()
next register; and so on. */ next register; and so on. */
void void
order_regs_for_local_alloc () order_regs_for_local_alloc (void)
{ {
unsigned int i; unsigned int i;
static const int order_0[] = { static const int order_0[] = {
...@@ -4909,10 +4758,7 @@ order_regs_for_local_alloc () ...@@ -4909,10 +4758,7 @@ order_regs_for_local_alloc ()
found in OUTER_CODE */ found in OUTER_CODE */
static int static int
default_rtx_costs (X, code, outer_code) default_rtx_costs (rtx X, enum rtx_code code, enum rtx_code outer_code)
rtx X;
enum rtx_code code;
enum rtx_code outer_code;
{ {
int cost=0; int cost=0;
switch (code) switch (code)
...@@ -4968,10 +4814,7 @@ default_rtx_costs (X, code, outer_code) ...@@ -4968,10 +4814,7 @@ default_rtx_costs (X, code, outer_code)
} }
static bool static bool
avr_rtx_costs (x, code, outer_code, total) avr_rtx_costs (rtx x, int code, int outer_code, int *total)
rtx x;
int code, outer_code;
int *total;
{ {
int cst; int cst;
...@@ -5020,8 +4863,7 @@ avr_rtx_costs (x, code, outer_code, total) ...@@ -5020,8 +4863,7 @@ avr_rtx_costs (x, code, outer_code, total)
/* Calculate the cost of a memory address */ /* Calculate the cost of a memory address */
static int static int
avr_address_cost (x) avr_address_cost (rtx x)
rtx x;
{ {
if (GET_CODE (x) == PLUS if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x,1)) == CONST_INT && GET_CODE (XEXP (x,1)) == CONST_INT
...@@ -5040,9 +4882,7 @@ avr_address_cost (x) ...@@ -5040,9 +4882,7 @@ avr_address_cost (x)
/* EXTRA_CONSTRAINT helper */ /* EXTRA_CONSTRAINT helper */
int int
extra_constraint (x, c) extra_constraint (rtx x, int c)
rtx x;
int c;
{ {
if (c == 'Q' if (c == 'Q'
&& GET_CODE (x) == MEM && GET_CODE (x) == MEM
...@@ -5088,8 +4928,7 @@ extra_constraint (x, c) ...@@ -5088,8 +4928,7 @@ extra_constraint (x, c)
/* Convert condition code CONDITION to the valid AVR condition code */ /* Convert condition code CONDITION to the valid AVR condition code */
RTX_CODE RTX_CODE
avr_normalize_condition (condition) avr_normalize_condition (RTX_CODE condition)
RTX_CODE condition;
{ {
switch (condition) switch (condition)
{ {
...@@ -5109,7 +4948,7 @@ avr_normalize_condition (condition) ...@@ -5109,7 +4948,7 @@ avr_normalize_condition (condition)
/* This function optimizes conditional jumps. */ /* This function optimizes conditional jumps. */
static void static void
avr_reorg () avr_reorg (void)
{ {
rtx insn, pattern; rtx insn, pattern;
...@@ -5188,7 +5027,7 @@ avr_reorg () ...@@ -5188,7 +5027,7 @@ avr_reorg ()
/* Returns register number for function return value.*/ /* Returns register number for function return value.*/
int int
avr_ret_register () avr_ret_register (void)
{ {
return 24; return 24;
} }
...@@ -5197,8 +5036,7 @@ avr_ret_register () ...@@ -5197,8 +5036,7 @@ avr_ret_register ()
library function returns a value of mode MODE. */ library function returns a value of mode MODE. */
rtx rtx
avr_libcall_value (mode) avr_libcall_value (enum machine_mode mode)
enum machine_mode mode;
{ {
int offs = GET_MODE_SIZE (mode); int offs = GET_MODE_SIZE (mode);
if (offs < 2) if (offs < 2)
...@@ -5210,9 +5048,7 @@ avr_libcall_value (mode) ...@@ -5210,9 +5048,7 @@ avr_libcall_value (mode)
function returns a value of data type VALTYPE. */ function returns a value of data type VALTYPE. */
rtx rtx
avr_function_value (type, func) avr_function_value (tree type, tree func ATTRIBUTE_UNUSED)
tree type;
tree func ATTRIBUTE_UNUSED;
{ {
unsigned int offs; unsigned int offs;
...@@ -5233,8 +5069,7 @@ avr_function_value (type, func) ...@@ -5233,8 +5069,7 @@ avr_function_value (type, func)
/* Returns nonzero if the number MASK has only one bit set. */ /* Returns nonzero if the number MASK has only one bit set. */
int int
mask_one_bit_p (mask) mask_one_bit_p (HOST_WIDE_INT mask)
HOST_WIDE_INT mask;
{ {
int i; int i;
unsigned HOST_WIDE_INT n=mask; unsigned HOST_WIDE_INT n=mask;
...@@ -5258,17 +5093,13 @@ mask_one_bit_p (mask) ...@@ -5258,17 +5093,13 @@ mask_one_bit_p (mask)
in class CLASS. */ in class CLASS. */
enum reg_class enum reg_class
preferred_reload_class (x, class) preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
rtx x ATTRIBUTE_UNUSED;
enum reg_class class;
{ {
return class; return class;
} }
int int
test_hard_reg_class (class, x) test_hard_reg_class (enum reg_class class, rtx x)
enum reg_class class;
rtx x;
{ {
int regno = true_regnum (x); int regno = true_regnum (x);
if (regno < 0) if (regno < 0)
...@@ -5282,9 +5113,7 @@ test_hard_reg_class (class, x) ...@@ -5282,9 +5113,7 @@ test_hard_reg_class (class, x)
int int
jump_over_one_insn_p (insn, dest) jump_over_one_insn_p (rtx insn, rtx dest)
rtx insn;
rtx dest;
{ {
int uid = INSN_UID (GET_CODE (dest) == LABEL_REF int uid = INSN_UID (GET_CODE (dest) == LABEL_REF
? XEXP (dest, 0) ? XEXP (dest, 0)
...@@ -5300,9 +5129,7 @@ jump_over_one_insn_p (insn, dest) ...@@ -5300,9 +5129,7 @@ jump_over_one_insn_p (insn, dest)
(this way we don't have to check for odd registers everywhere). */ (this way we don't have to check for odd registers everywhere). */
int int
avr_hard_regno_mode_ok (regno, mode) avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
int regno;
enum machine_mode mode;
{ {
/* Bug workaround: recog.c (peep2_find_free_register) and probably /* Bug workaround: recog.c (peep2_find_free_register) and probably
a few other places assume that the frame pointer is a single hard a few other places assume that the frame pointer is a single hard
...@@ -5323,9 +5150,7 @@ avr_hard_regno_mode_ok (regno, mode) ...@@ -5323,9 +5150,7 @@ avr_hard_regno_mode_ok (regno, mode)
to check for the lower half of I/O space (for cbi/sbi/sbic/sbis). */ to check for the lower half of I/O space (for cbi/sbi/sbic/sbis). */
int int
avr_io_address_p (x, size) avr_io_address_p (rtx x, int size)
rtx x;
int size;
{ {
return (optimize > 0 && GET_CODE (x) == CONST_INT return (optimize > 0 && GET_CODE (x) == CONST_INT
&& INTVAL (x) >= 0x20 && INTVAL (x) <= 0x60 - size); && INTVAL (x) >= 0x20 && INTVAL (x) <= 0x60 - size);
...@@ -5334,8 +5159,7 @@ avr_io_address_p (x, size) ...@@ -5334,8 +5159,7 @@ avr_io_address_p (x, size)
/* Returns nonzero (bit number + 1) if X, or -X, is a constant power of 2. */ /* Returns nonzero (bit number + 1) if X, or -X, is a constant power of 2. */
int int
const_int_pow2_p (x) const_int_pow2_p (rtx x)
rtx x;
{ {
if (GET_CODE (x) == CONST_INT) if (GET_CODE (x) == CONST_INT)
{ {
...@@ -5347,10 +5171,7 @@ const_int_pow2_p (x) ...@@ -5347,10 +5171,7 @@ const_int_pow2_p (x)
} }
const char * const char *
output_reload_inhi (insn, operands, len) output_reload_inhi (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
rtx insn ATTRIBUTE_UNUSED;
rtx *operands;
int *len;
{ {
int tmp; int tmp;
if (!len) if (!len)
...@@ -5390,10 +5211,7 @@ output_reload_inhi (insn, operands, len) ...@@ -5390,10 +5211,7 @@ output_reload_inhi (insn, operands, len)
const char * const char *
output_reload_insisf (insn, operands, len) output_reload_insisf (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
rtx insn ATTRIBUTE_UNUSED;
rtx *operands;
int *len;
{ {
rtx src = operands[1]; rtx src = operands[1];
int cnst = (GET_CODE (src) == CONST_INT); int cnst = (GET_CODE (src) == CONST_INT);
...@@ -5443,9 +5261,7 @@ output_reload_insisf (insn, operands, len) ...@@ -5443,9 +5261,7 @@ output_reload_insisf (insn, operands, len)
} }
void void
avr_output_bld (operands, bit_nr) avr_output_bld (rtx operands[], int bit_nr)
rtx operands[];
int bit_nr;
{ {
static char s[] = "bld %A0,0"; static char s[] = "bld %A0,0";
...@@ -5455,9 +5271,7 @@ avr_output_bld (operands, bit_nr) ...@@ -5455,9 +5271,7 @@ avr_output_bld (operands, bit_nr)
} }
void void
avr_output_addr_vec_elt (stream, value) avr_output_addr_vec_elt (FILE *stream, int value)
FILE *stream;
int value;
{ {
if (AVR_MEGA) if (AVR_MEGA)
fprintf (stream, "\t.word pm(.L%d)\n", value); fprintf (stream, "\t.word pm(.L%d)\n", value);
...@@ -5471,8 +5285,7 @@ avr_output_addr_vec_elt (stream, value) ...@@ -5471,8 +5285,7 @@ avr_output_addr_vec_elt (stream, value)
registers (for a define_peephole2) in the current function. */ registers (for a define_peephole2) in the current function. */
int int
avr_peep2_scratch_safe (scratch) avr_peep2_scratch_safe (rtx scratch)
rtx scratch;
{ {
if ((interrupt_function_p (current_function_decl) if ((interrupt_function_p (current_function_decl)
|| signal_function_p (current_function_decl)) || signal_function_p (current_function_decl))
...@@ -5500,9 +5313,7 @@ avr_peep2_scratch_safe (scratch) ...@@ -5500,9 +5313,7 @@ avr_peep2_scratch_safe (scratch)
Operand 3: label to jump to if the test is true. */ Operand 3: label to jump to if the test is true. */
const char * const char *
avr_out_sbxx_branch (insn, operands) avr_out_sbxx_branch (rtx insn, rtx operands[])
rtx insn;
rtx operands[];
{ {
enum rtx_code comp = GET_CODE (operands[0]); enum rtx_code comp = GET_CODE (operands[0]);
int long_jump = (get_attr_length (insn) >= 4); int long_jump = (get_attr_length (insn) >= 4);
...@@ -5565,18 +5376,14 @@ avr_out_sbxx_branch (insn, operands) ...@@ -5565,18 +5376,14 @@ avr_out_sbxx_branch (insn, operands)
} }
static void static void
avr_asm_out_ctor (symbol, priority) avr_asm_out_ctor (rtx symbol, int priority)
rtx symbol;
int priority;
{ {
fputs ("\t.global __do_global_ctors\n", asm_out_file); fputs ("\t.global __do_global_ctors\n", asm_out_file);
default_ctor_section_asm_out_constructor (symbol, priority); default_ctor_section_asm_out_constructor (symbol, priority);
} }
static void static void
avr_asm_out_dtor (symbol, priority) avr_asm_out_dtor (rtx symbol, int priority)
rtx symbol;
int priority;
{ {
fputs ("\t.global __do_global_dtors\n", asm_out_file); fputs ("\t.global __do_global_dtors\n", asm_out_file);
default_dtor_section_asm_out_destructor (symbol, priority); default_dtor_section_asm_out_destructor (symbol, priority);
......
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