/* 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)
This file is part of GCC.
Boston, MA 02111-1307, USA. */
-extern int function_arg_regno_p PARAMS ((int r));
-extern void avr_init_once PARAMS ((void));
-extern void avr_override_options PARAMS ((void));
-extern void avr_optimization_options PARAMS ((int level, int size));
-extern char * avr_change_section PARAMS ((char *sect_name));
-extern int avr_ret_register PARAMS ((void));
-extern enum reg_class class_likely_spilled_p PARAMS ((int c));
-extern enum reg_class avr_regno_reg_class PARAMS ((int r));
-extern enum reg_class avr_reg_class_from_letter PARAMS ((int c));
-extern int frame_pointer_required_p PARAMS ((void));
-extern void asm_globalize_label PARAMS ((FILE *file, const char *name));
-extern void order_regs_for_local_alloc PARAMS ((void));
-extern int initial_elimination_offset PARAMS ((int from, int to));
-extern int avr_simple_epilogue PARAMS ((void));
-extern void progmem_section PARAMS ((void));
-extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask));
-extern void gas_output_limited_string PARAMS ((FILE *file, const char *str));
-extern void gas_output_ascii PARAMS ((FILE *file, const char *str,
- 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));
+extern int function_arg_regno_p (int r);
+extern void avr_init_once (void);
+extern void avr_override_options (void);
+extern void avr_optimization_options (int level, int size);
+extern char *avr_change_section (char *sect_name);
+extern int avr_ret_register (void);
+extern enum reg_class class_likely_spilled_p (int c);
+extern enum reg_class avr_regno_reg_class (int r);
+extern enum reg_class avr_reg_class_from_letter (int c);
+extern int frame_pointer_required_p (void);
+extern void asm_globalize_label (FILE *file, const char *name);
+extern void order_regs_for_local_alloc (void);
+extern int initial_elimination_offset (int from, int to);
+extern int avr_simple_epilogue (void);
+extern void progmem_section (void);
+extern int mask_one_bit_p (HOST_WIDE_INT mask);
+extern void gas_output_limited_string (FILE *file, const char *str);
+extern void gas_output_ascii (FILE *file, const char *str, size_t length);
+#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 */
-extern rtx avr_function_value PARAMS ((tree type, tree func));
-extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *cum,
- tree fntype, rtx libname,
- tree fndecl));
-extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *cum,
- enum machine_mode mode,
- tree type, int named));
-
-
+extern rtx avr_function_value (tree type, tree func);
+extern void init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
+ rtx libname, tree fndecl);
+extern rtx function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named);
#endif /* RTX_CODE inside TREE_CODE */
#ifdef HAVE_MACHINE_MODES /* inside TREE_CODE */
-extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *cum,
- enum machine_mode mode, tree type,
- int named));
+extern void function_arg_advance (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode, tree type,
+ int named);
#endif /* HAVE_MACHINE_MODES inside TREE_CODE*/
#endif /* TREE_CODE */
#ifdef RTX_CODE
-extern void asm_output_external_libcall PARAMS ((FILE *file, rtx symref));
-extern int legitimate_address_p PARAMS ((enum machine_mode mode, rtx x,
- int strict));
-extern int compare_diff_p PARAMS ((rtx insn));
-extern const char * output_movqi PARAMS ((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 PARAMS ((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 PARAMS ((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 PARAMS ((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 PARAMS ((rtx insn, rtx operands[], int *l));
-extern const char * out_tstsi PARAMS ((rtx insn, int *l));
-extern const char * out_tsthi PARAMS ((rtx insn, int *l));
-extern const char * ret_cond_branch PARAMS ((rtx x, int len, int reverse));
-
-extern const char * ashlqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * ashlhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * ashlsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-
-extern const char * ashrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * ashrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * ashrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-
-extern const char * lshrqi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * lshrhi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-extern const char * lshrsi3_out PARAMS ((rtx insn, rtx operands[], int *len));
-
-extern void avr_output_bld PARAMS ((rtx operands[], int bit_nr));
-extern void avr_output_addr_vec_elt PARAMS ((FILE *stream, int value));
-extern const char *avr_out_sbxx_branch PARAMS ((rtx insn, rtx operands[]));
-
-extern enum reg_class preferred_reload_class PARAMS ((rtx x,
- enum reg_class class));
-extern int extra_constraint PARAMS ((rtx x, int c));
-extern rtx legitimize_address PARAMS ((rtx x, rtx oldx,
- enum machine_mode mode));
-extern int adjust_insn_length PARAMS ((rtx insn, int len));
-extern rtx avr_libcall_value PARAMS ((enum machine_mode mode));
-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,
- rtx));
-extern void notice_update_cc PARAMS ((rtx body, rtx insn));
-extern void print_operand PARAMS ((FILE *file, rtx x, int code));
-extern void print_operand_address PARAMS ((FILE *file, rtx addr));
-extern int reg_unused_after PARAMS ((rtx insn, rtx reg));
-extern int _reg_unused_after PARAMS ((rtx insn, rtx reg));
-extern int avr_jump_mode PARAMS ((rtx x, rtx insn));
-extern int byte_immediate_operand PARAMS ((register rtx op,
- enum machine_mode mode));
-extern int test_hard_reg_class PARAMS ((enum reg_class class, rtx x));
-extern int jump_over_one_insn_p PARAMS ((rtx insn, rtx dest));
-
-extern int avr_hard_regno_mode_ok PARAMS ((int regno,
- enum machine_mode mode));
-extern int call_insn_operand PARAMS ((rtx op, enum machine_mode mode));
-extern void final_prescan_insn PARAMS ((rtx insn, rtx *operand,
- int num_operands));
-extern int avr_simplify_comparison_p PARAMS ((enum machine_mode mode,
- RTX_CODE operator, rtx x));
-extern RTX_CODE avr_normalize_condition PARAMS ((RTX_CODE condition));
-extern int compare_eq_p PARAMS ((rtx insn));
-extern void out_shift_with_cnt PARAMS ((const char *template, rtx insn,
- rtx operands[], int *len,
- 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));
+extern void asm_output_external_libcall (FILE *file, rtx symref);
+extern int legitimate_address_p (enum machine_mode mode, rtx x, int strict);
+extern int compare_diff_p (rtx insn);
+extern const char *output_movqi (rtx insn, rtx operands[], int *l);
+extern const char *output_movhi (rtx insn, rtx operands[], int *l);
+extern const char *out_movqi_r_mr (rtx insn, rtx op[], int *l);
+extern const char *out_movqi_mr_r (rtx insn, rtx op[], int *l);
+extern const char *out_movhi_r_mr (rtx insn, rtx op[], int *l);
+extern const char *out_movhi_mr_r (rtx insn, rtx op[], int *l);
+extern const char *out_movsi_r_mr (rtx insn, rtx op[], int *l);
+extern const char *out_movsi_mr_r (rtx insn, rtx op[], int *l);
+extern const char *output_movsisf (rtx insn, rtx operands[], int *l);
+extern const char *out_tstsi (rtx insn, int *l);
+extern const char *out_tsthi (rtx insn, int *l);
+extern const char *ret_cond_branch (rtx x, int len, int reverse);
+
+extern const char *ashlqi3_out (rtx insn, rtx operands[], int *len);
+extern const char *ashlhi3_out (rtx insn, rtx operands[], int *len);
+extern const char *ashlsi3_out (rtx insn, rtx operands[], int *len);
+
+extern const char *ashrqi3_out (rtx insn, rtx operands[], int *len);
+extern const char *ashrhi3_out (rtx insn, rtx operands[], int *len);
+extern const char *ashrsi3_out (rtx insn, rtx operands[], int *len);
+
+extern const char *lshrqi3_out (rtx insn, rtx operands[], int *len);
+extern const char *lshrhi3_out (rtx insn, rtx operands[], int *len);
+extern const char *lshrsi3_out (rtx insn, rtx operands[], int *len);
+
+extern void avr_output_bld (rtx operands[], int bit_nr);
+extern void avr_output_addr_vec_elt (FILE *stream, int value);
+extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
+
+extern enum reg_class preferred_reload_class (rtx x, enum reg_class class);
+extern int extra_constraint (rtx x, int c);
+extern rtx legitimize_address (rtx x, rtx oldx, enum machine_mode mode);
+extern int adjust_insn_length (rtx insn, int len);
+extern rtx avr_libcall_value (enum machine_mode mode);
+extern const char *output_reload_inhi (rtx insn, rtx *operands, int *len);
+extern const char *output_reload_insisf (rtx insn, rtx *operands, int *len);
+extern enum reg_class secondary_input_reload_class (enum reg_class,
+ enum machine_mode,
+ rtx);
+extern void notice_update_cc (rtx body, rtx insn);
+extern void print_operand (FILE *file, rtx x, int code);
+extern void print_operand_address (FILE *file, rtx addr);
+extern int reg_unused_after (rtx insn, rtx reg);
+extern int _reg_unused_after (rtx insn, rtx reg);
+extern int avr_jump_mode (rtx x, rtx insn);
+extern int byte_immediate_operand (rtx op, enum machine_mode mode);
+extern int test_hard_reg_class (enum reg_class class, rtx x);
+extern int jump_over_one_insn_p (rtx insn, rtx dest);
+
+extern int avr_hard_regno_mode_ok (int regno, enum machine_mode mode);
+extern int call_insn_operand (rtx op, enum machine_mode mode);
+extern void final_prescan_insn (rtx insn, rtx *operand, int num_operands);
+extern int avr_simplify_comparison_p (enum machine_mode mode,
+ RTX_CODE operator, rtx x);
+extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
+extern int compare_eq_p (rtx insn);
+extern void out_shift_with_cnt (const char *template, rtx insn,
+ rtx operands[], int *len, int t_len);
+extern int avr_io_address_p (rtx x, int size);
+extern int const_int_pow2_p (rtx x);
+extern int avr_peep2_scratch_safe (rtx reg_rtx);
#endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES
-extern int class_max_nregs PARAMS ((enum reg_class class,
- enum machine_mode mode));
+extern int class_max_nregs (enum reg_class class, enum machine_mode mode);
#endif /* HAVE_MACHINE_MODES */
#ifdef REAL_VALUE_TYPE
-
-extern void asm_output_float PARAMS ((FILE *file, REAL_VALUE_TYPE n));
-
+extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
#endif
/* Maximal allowed offset for an address in the LD command */
#define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
-static int avr_naked_function_p PARAMS ((tree));
-static int interrupt_function_p PARAMS ((tree));
-static int signal_function_p PARAMS ((tree));
-static int avr_regs_to_save PARAMS ((HARD_REG_SET *));
-static int sequent_regs_live PARAMS ((void));
-static const char * ptrreg_to_str PARAMS ((int));
-static const char * cond_string PARAMS ((enum rtx_code));
-static int avr_num_arg_regs PARAMS ((enum machine_mode, tree));
-static int out_adj_frame_ptr PARAMS ((FILE *, int));
-static int out_set_stack_ptr PARAMS ((FILE *, int, int));
-static RTX_CODE compare_condition PARAMS ((rtx insn));
-static int compare_sign_p PARAMS ((rtx insn));
-static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static int avr_naked_function_p (tree);
+static int interrupt_function_p (tree);
+static int signal_function_p (tree);
+static int avr_regs_to_save (HARD_REG_SET *);
+static int sequent_regs_live (void);
+static const char *ptrreg_to_str (int);
+static const char *cond_string (enum rtx_code);
+static int avr_num_arg_regs (enum machine_mode, tree);
+static int out_adj_frame_ptr (FILE *, int);
+static int out_set_stack_ptr (FILE *, int, int);
+static RTX_CODE compare_condition (rtx insn);
+static int compare_sign_p (rtx insn);
+static tree avr_handle_progmem_attribute (tree *, tree, tree, int, bool *);
+static tree avr_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
const struct attribute_spec avr_attribute_table[];
-static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void avr_file_start PARAMS ((void));
-static void avr_file_end PARAMS ((void));
-static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void avr_unique_section PARAMS ((tree, int));
-static void avr_insert_attributes PARAMS ((tree, tree *));
-static unsigned int avr_section_type_flags PARAMS ((tree, const char *, int));
-
-static void avr_reorg PARAMS ((void));
-static void avr_asm_out_ctor PARAMS ((rtx, int));
-static void avr_asm_out_dtor PARAMS ((rtx, int));
-static int default_rtx_costs PARAMS ((rtx, enum rtx_code, enum rtx_code));
-static bool avr_rtx_costs PARAMS ((rtx, int, int, int *));
-static int avr_address_cost PARAMS ((rtx));
+static bool avr_assemble_integer (rtx, unsigned int, int);
+static void avr_file_start (void);
+static void avr_file_end (void);
+static void avr_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void avr_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void avr_unique_section (tree, int);
+static void avr_insert_attributes (tree, tree *);
+static unsigned int avr_section_type_flags (tree, const char *, int);
+
+static void avr_reorg (void);
+static void avr_asm_out_ctor (rtx, int);
+static void avr_asm_out_dtor (rtx, int);
+static int default_rtx_costs (rtx, enum rtx_code, enum rtx_code);
+static bool avr_rtx_costs (rtx, int, int, int *);
+static int avr_address_cost (rtx);
/* Allocate registers from r25 to r8 for parameters for function calls */
#define FIRST_CUM_REG 26
struct gcc_target targetm = TARGET_INITIALIZER;
\f
void
-avr_override_options ()
+avr_override_options (void)
{
const struct mcu_type_s *t;
const struct base_arch_s *base;
#if 0 /* Does not play nice with GC. FIXME. */
/* Initialize TMP_REG_RTX and ZERO_REG_RTX */
void
-avr_init_once ()
+avr_init_once (void)
{
tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
PUT_CODE (tmp_reg_rtx, REG);
/* Return register class for register R */
enum reg_class
-avr_regno_reg_class (r)
- int r;
+avr_regno_reg_class (int r)
{
if (r <= 33)
return reg_class_tab[r];
passed to this macro; you do not need to handle it. */
enum reg_class
-avr_reg_class_from_letter (c)
- int c;
+avr_reg_class_from_letter (int c)
{
switch (c)
{
/* Return nonzero if FUNC is a naked function. */
static int
-avr_naked_function_p (func)
- tree func;
+avr_naked_function_p (tree func)
{
tree a;
by the "interrupt" attribute. */
static int
-interrupt_function_p (func)
- tree func;
+interrupt_function_p (tree func)
{
tree a;
by the "signal" attribute. */
static int
-signal_function_p (func)
- tree func;
+signal_function_p (tree func)
{
tree a;
of the current function, and optionally store these registers in SET. */
static int
-avr_regs_to_save (set)
- HARD_REG_SET *set;
+avr_regs_to_save (HARD_REG_SET *set)
{
int reg, count;
int int_or_sig_p = (interrupt_function_p (current_function_decl)
/* Compute offset between arg_pointer and frame_pointer */
int
-initial_elimination_offset (from, to)
- int from;
- int to;
+initial_elimination_offset (int from, int to)
{
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return 0;
/* Return 1 if the function epilogue is just a single "ret". */
int
-avr_simple_epilogue ()
+avr_simple_epilogue (void)
{
return (! frame_pointer_needed
&& get_frame_size () == 0
/* This function checks sequence of live registers */
static int
-sequent_regs_live ()
+sequent_regs_live (void)
{
int reg;
int live_seq=0;
(epilogue). Returns the number of instructions generated. */
static int
-out_adj_frame_ptr (file, adj)
- FILE *file;
- int adj;
+out_adj_frame_ptr (FILE *file, int adj)
{
int size = 0;
Returns the number of instructions generated. */
static int
-out_set_stack_ptr (file, before, after)
- FILE *file;
- int before;
- int after;
+out_set_stack_ptr (FILE *file, int before, int after)
{
int do_sph, do_cli, do_save, do_sei, lock_sph, size;
/* Output function prologue */
static void
-avr_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+avr_output_function_prologue (FILE *file, HOST_WIDE_INT size)
{
int reg;
int interrupt_func_p;
/* Output function epilogue */
static void
-avr_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+avr_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
{
int reg;
int interrupt_func_p;
machine for a memory operand of mode MODE. */
int
-legitimate_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+legitimate_address_p (enum machine_mode mode, rtx x, int strict)
{
enum reg_class r = NO_REGS;
memory address for an operand of mode MODE */
rtx
-legitimize_address (x, oldx, mode)
- rtx x;
- rtx oldx;
- enum machine_mode mode;
+legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
{
x = oldx;
if (TARGET_ALL_DEBUG)
/* Return a pointer register name as a string */
static const char *
-ptrreg_to_str (regno)
- int regno;
+ptrreg_to_str (int regno)
{
switch (regno)
{
Used in conditional jump constructing */
static const char *
-cond_string (code)
- enum rtx_code code;
+cond_string (enum rtx_code code)
{
switch (code)
{
/* Output ADDR to FILE as address */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
switch (GET_CODE (addr))
{
/* Output X as assembler operand to file FILE */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
int abcd = 0;
/* Recognize operand OP of mode MODE used in call instructions */
int
-call_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == MEM)
{
/* Update the condition code in the INSN. */
void
-notice_update_cc (body, insn)
- rtx body ATTRIBUTE_UNUSED;
- rtx insn;
+notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
{
rtx set;
class CLASS needed to hold a value of mode MODE. */
int
-class_max_nregs (class, mode)
- enum reg_class class ATTRIBUTE_UNUSED;
- enum machine_mode mode;
+class_max_nregs (enum reg_class class ATTRIBUTE_UNUSED,enum machine_mode mode)
{
return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
}
3 - absolute jump (only for ATmega[16]03). */
int
-avr_jump_mode (x, insn)
- rtx x; /* jump operand */
- rtx insn; /* jump insn */
+avr_jump_mode (rtx x, rtx insn)
{
int dest_addr = INSN_ADDRESSES (INSN_UID (GET_MODE (x) == LABEL_REF
? XEXP (x, 0) : x));
if REVERSE nonzero then condition code in X must be reversed. */
const char *
-ret_cond_branch (x, len, reverse)
- rtx x;
- int len;
- int reverse;
+ret_cond_branch (rtx x, int len, int reverse)
{
RTX_CODE cond = reverse ? reverse_condition (GET_CODE (x)) : GET_CODE (x);
/* Predicate function for immediate operand which fits to byte (8bit) */
int
-byte_immediate_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+byte_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) <= 0xff && INTVAL (op) >= 0);
Output insn cost for next insn. */
void
-final_prescan_insn (insn, operand, num_operands)
- rtx insn, *operand ATTRIBUTE_UNUSED;
- int num_operands ATTRIBUTE_UNUSED;
+final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
+ int num_operands ATTRIBUTE_UNUSED)
{
int uid = INSN_UID (insn);
/* Return 0 if undefined, 1 if always true or always false. */
int
-avr_simplify_comparison_p (mode, operator, x)
- enum machine_mode mode;
- RTX_CODE operator;
- rtx x;
+avr_simplify_comparison_p (enum machine_mode mode, RTX_CODE operator, rtx x)
{
unsigned int max = (mode == QImode ? 0xff :
mode == HImode ? 0xffff :
register in which function arguments are sometimes passed. */
int
-function_arg_regno_p(r)
- int r;
+function_arg_regno_p(int r)
{
return (r >= 8 && r <= 25);
}
of the argument list. */
void
-init_cumulative_args (cum, fntype, libname, fndecl)
- CUMULATIVE_ARGS *cum;
- tree fntype;
- rtx libname;
- tree fndecl ATTRIBUTE_UNUSED;
+init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname,
+ tree fndecl ATTRIBUTE_UNUSED)
{
cum->nregs = 18;
cum->regno = FIRST_CUM_REG;
/* Returns the number of registers to allocate for a function argument. */
static int
-avr_num_arg_regs (mode, type)
- enum machine_mode mode;
- tree type;
+avr_num_arg_regs (enum machine_mode mode, tree type)
{
int size;
in a register, and which register. */
rtx
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
int bytes = avr_num_arg_regs (mode, type);
in the argument list. */
void
-function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum; /* current arg information */
- 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 */
+function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
int bytes = avr_num_arg_regs (mode, type);
Functions for outputting various mov's for a various modes
************************************************************************/
const char *
-output_movqi (insn, operands, l)
- rtx insn;
- rtx operands[];
- int *l;
+output_movqi (rtx insn, rtx operands[], int *l)
{
int dummy;
rtx dest = operands[0];
const char *
-output_movhi (insn, operands, l)
- rtx insn;
- rtx operands[];
- int *l;
+output_movhi (rtx insn, rtx operands[], int *l)
{
int dummy;
rtx dest = operands[0];
}
const char *
-out_movqi_r_mr (insn, op, l)
- rtx insn;
- rtx op[];
- int *l; /* instruction length */
+out_movqi_r_mr (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
}
const char *
-out_movhi_r_mr (insn, op, l)
- rtx insn;
- rtx op[];
- int *l; /* instruction length */
+out_movhi_r_mr (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
}
const char *
-out_movsi_r_mr (insn, op, l)
- rtx insn;
- rtx op[];
- int *l; /* instruction length */
+out_movsi_r_mr (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
}
const char *
-out_movsi_mr_r (insn, op, l)
- rtx insn;
- rtx op[];
- int *l;
+out_movsi_mr_r (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
}
const char *
-output_movsisf(insn, operands, l)
- rtx insn;
- rtx operands[];
- int *l;
+output_movsisf(rtx insn, rtx operands[], int *l)
{
int dummy;
rtx dest = operands[0];
}
const char *
-out_movqi_mr_r (insn, op, l)
- rtx insn;
- rtx op[];
- int *l; /* instruction length */
+out_movqi_mr_r (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
}
const char *
-out_movhi_mr_r (insn, op, l)
- rtx insn;
- rtx op[];
- int *l;
+out_movhi_mr_r (rtx insn, rtx op[], int *l)
{
rtx dest = op[0];
rtx src = op[1];
/* Return 1 if frame pointer for current function required */
int
-frame_pointer_required_p ()
+frame_pointer_required_p (void)
{
return (current_function_calls_alloca
|| current_function_args_info.nregs == 0
/* Returns the condition of compare insn INSN, or UNKNOWN. */
static RTX_CODE
-compare_condition (insn)
- rtx insn;
+compare_condition (rtx insn)
{
rtx next = next_real_insn (insn);
RTX_CODE cond = UNKNOWN;
/* Returns nonzero if INSN is a tst insn that only tests the sign. */
static int
-compare_sign_p (insn)
- rtx insn;
+compare_sign_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
return (cond == GE || cond == LT);
that needs to be swapped (GT, GTU, LE, LEU). */
int
-compare_diff_p (insn)
- rtx insn;
+compare_diff_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
return (cond == GT || cond == GTU || cond == LE || cond == LEU) ? cond : 0;
/* Returns nonzero if INSN is a compare insn with the EQ or NE condition. */
int
-compare_eq_p (insn)
- rtx insn;
+compare_eq_p (rtx insn)
{
RTX_CODE cond = compare_condition (insn);
return (cond == EQ || cond == NE);
/* Output test instruction for HImode */
const char *
-out_tsthi (insn, l)
- rtx insn;
- int *l;
+out_tsthi (rtx insn, int *l)
{
if (compare_sign_p (insn))
{
/* Output test instruction for SImode */
const char *
-out_tstsi (insn, l)
- rtx insn;
- int *l;
+out_tstsi (rtx insn, int *l)
{
if (compare_sign_p (insn))
{
carefully hand-optimized in ?sh??i3_out. */
void
-out_shift_with_cnt (template, insn, operands, len, t_len)
- const char *template;
- rtx insn;
- rtx operands[];
- int *len;
- int t_len; /* Length of template. */
+out_shift_with_cnt (const char *template, rtx insn, rtx operands[],
+ int *len, int t_len)
{
rtx op[10];
char str[500];
/* 8bit shift left ((char)x << i) */
const char *
-ashlqi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len; /* insn length (may be NULL) */
+ashlqi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 16bit shift left ((short)x << i) */
const char *
-ashlhi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+ashlhi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 32bit shift left ((long)x << i) */
const char *
-ashlsi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+ashlsi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 8bit arithmetic shift right ((signed char)x >> i) */
const char *
-ashrqi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len; /* insn length */
+ashrqi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 16bit arithmetic shift right ((signed short)x >> i) */
const char *
-ashrhi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+ashrhi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 32bit arithmetic shift right ((signed long)x >> i) */
const char *
-ashrsi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+ashrsi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 8bit logic shift right ((unsigned char)x >> i) */
const char *
-lshrqi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+lshrqi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 16bit logic shift right ((unsigned short)x >> i) */
const char *
-lshrhi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+lshrhi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
/* 32bit logic shift right ((unsigned int)x >> i) */
const char *
-lshrsi3_out (insn, operands, len)
- rtx insn;
- rtx operands[];
- int *len;
+lshrsi3_out (rtx insn, rtx operands[], int *len)
{
if (GET_CODE (operands[2]) == CONST_INT)
{
LEN is the initially computed length of the insn. */
int
-adjust_insn_length (insn, len)
- rtx insn;
- int len;
+adjust_insn_length (rtx insn, int len)
{
rtx patt = PATTERN (insn);
rtx set;
/* Return nonzero if register REG dead after INSN */
int
-reg_unused_after (insn, reg)
- rtx insn;
- rtx reg;
+reg_unused_after (rtx insn, rtx reg)
{
return (dead_or_set_p (insn, reg)
|| (REG_P(reg) && _reg_unused_after (insn, reg)));
not live past labels. It may live past calls or jumps though. */
int
-_reg_unused_after (insn, reg)
- rtx insn;
- rtx reg;
+_reg_unused_after (rtx insn, rtx reg)
{
enum rtx_code code;
rtx set;
special handling for references to certain labels. */
static bool
-avr_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p
&& ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x))
/* Sets section name for declaration DECL */
static void
-avr_unique_section (decl, reloc)
- tree decl;
- int reloc ATTRIBUTE_UNUSED;
+avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
{
int len;
const char *name, *prefix;
comma separated lists of numbers). */
void
-gas_output_limited_string(file, str)
- FILE *file;
- const char * str;
+gas_output_limited_string(FILE *file, const char *str)
{
const unsigned char *_limited_str = (unsigned char *) str;
unsigned ch;
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
void
-gas_output_ascii(file, str, length)
- FILE * file;
- const char * str;
- size_t length;
+gas_output_ascii(FILE *file, const char *str, size_t length)
{
const unsigned char *_ascii_bytes = (const unsigned char *) str;
const unsigned char *limit = _ascii_bytes + length;
because registers of CLASS are needed for spill registers. */
enum reg_class
-class_likely_spilled_p (c)
- int c;
+class_likely_spilled_p (int c)
{
return (c != ALL_REGS && c != ADDW_REGS);
}
/* Handle a "progmem" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+avr_handle_progmem_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (DECL_P (*node))
{
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */
+
static tree
-avr_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+avr_handle_fndecl_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
if found return 1, otherwise 0. */
int
-avr_progmem_p (decl)
- tree decl;
+avr_progmem_p (tree decl)
{
tree a;
/* Add the section attribute if the variable is in progmem. */
static void
-avr_insert_attributes (node, attributes)
- tree node;
- tree *attributes;
+avr_insert_attributes (tree node, tree *attributes)
{
if (TREE_CODE (node) == VAR_DECL
&& (TREE_STATIC (node) || DECL_EXTERNAL (node))
}
static unsigned int
-avr_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+avr_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
file. */
static void
-avr_file_start ()
+avr_file_start (void)
{
if (avr_asm_only_p)
error ("MCU `%s' supported for assembler only", avr_mcu_name);
appropriate text to go at the end of an assembler file. */
static void
-avr_file_end ()
+avr_file_end (void)
{
fputs ("/* File ", asm_out_file);
output_quoted_string (asm_out_file, main_input_filename);
next register; and so on. */
void
-order_regs_for_local_alloc ()
+order_regs_for_local_alloc (void)
{
unsigned int i;
static const int order_0[] = {
found in OUTER_CODE */
static int
-default_rtx_costs (X, code, outer_code)
- rtx X;
- enum rtx_code code;
- enum rtx_code outer_code;
+default_rtx_costs (rtx X, enum rtx_code code, enum rtx_code outer_code)
{
int cost=0;
switch (code)
}
static bool
-avr_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+avr_rtx_costs (rtx x, int code, int outer_code, int *total)
{
int cst;
/* Calculate the cost of a memory address */
static int
-avr_address_cost (x)
- rtx x;
+avr_address_cost (rtx x)
{
if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x,1)) == CONST_INT
/* EXTRA_CONSTRAINT helper */
int
-extra_constraint (x, c)
- rtx x;
- int c;
+extra_constraint (rtx x, int c)
{
if (c == 'Q'
&& GET_CODE (x) == MEM
/* Convert condition code CONDITION to the valid AVR condition code */
RTX_CODE
-avr_normalize_condition (condition)
- RTX_CODE condition;
+avr_normalize_condition (RTX_CODE condition)
{
switch (condition)
{
/* This function optimizes conditional jumps. */
static void
-avr_reorg ()
+avr_reorg (void)
{
rtx insn, pattern;
/* Returns register number for function return value.*/
int
-avr_ret_register ()
+avr_ret_register (void)
{
return 24;
}
library function returns a value of mode MODE. */
rtx
-avr_libcall_value (mode)
- enum machine_mode mode;
+avr_libcall_value (enum machine_mode mode)
{
int offs = GET_MODE_SIZE (mode);
if (offs < 2)
function returns a value of data type VALTYPE. */
rtx
-avr_function_value (type, func)
- tree type;
- tree func ATTRIBUTE_UNUSED;
+avr_function_value (tree type, tree func ATTRIBUTE_UNUSED)
{
unsigned int offs;
/* Returns nonzero if the number MASK has only one bit set. */
int
-mask_one_bit_p (mask)
- HOST_WIDE_INT mask;
+mask_one_bit_p (HOST_WIDE_INT mask)
{
int i;
unsigned HOST_WIDE_INT n=mask;
in class CLASS. */
enum reg_class
-preferred_reload_class (x, class)
- rtx x ATTRIBUTE_UNUSED;
- enum reg_class class;
+preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
{
return class;
}
int
-test_hard_reg_class (class, x)
- enum reg_class class;
- rtx x;
+test_hard_reg_class (enum reg_class class, rtx x)
{
int regno = true_regnum (x);
if (regno < 0)
int
-jump_over_one_insn_p (insn, dest)
- rtx insn;
- rtx dest;
+jump_over_one_insn_p (rtx insn, rtx dest)
{
int uid = INSN_UID (GET_CODE (dest) == LABEL_REF
? XEXP (dest, 0)
(this way we don't have to check for odd registers everywhere). */
int
-avr_hard_regno_mode_ok (regno, mode)
- int regno;
- enum machine_mode mode;
+avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* Bug workaround: recog.c (peep2_find_free_register) and probably
a few other places assume that the frame pointer is a single hard
to check for the lower half of I/O space (for cbi/sbi/sbic/sbis). */
int
-avr_io_address_p (x, size)
- rtx x;
- int size;
+avr_io_address_p (rtx x, int size)
{
return (optimize > 0 && GET_CODE (x) == CONST_INT
&& INTVAL (x) >= 0x20 && INTVAL (x) <= 0x60 - size);
/* Returns nonzero (bit number + 1) if X, or -X, is a constant power of 2. */
int
-const_int_pow2_p (x)
- rtx x;
+const_int_pow2_p (rtx x)
{
if (GET_CODE (x) == CONST_INT)
{
}
const char *
-output_reload_inhi (insn, operands, len)
- rtx insn ATTRIBUTE_UNUSED;
- rtx *operands;
- int *len;
+output_reload_inhi (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
{
int tmp;
if (!len)
const char *
-output_reload_insisf (insn, operands, len)
- rtx insn ATTRIBUTE_UNUSED;
- rtx *operands;
- int *len;
+output_reload_insisf (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
{
rtx src = operands[1];
int cnst = (GET_CODE (src) == CONST_INT);
}
void
-avr_output_bld (operands, bit_nr)
- rtx operands[];
- int bit_nr;
+avr_output_bld (rtx operands[], int bit_nr)
{
static char s[] = "bld %A0,0";
}
void
-avr_output_addr_vec_elt (stream, value)
- FILE *stream;
- int value;
+avr_output_addr_vec_elt (FILE *stream, int value)
{
if (AVR_MEGA)
fprintf (stream, "\t.word pm(.L%d)\n", value);
registers (for a define_peephole2) in the current function. */
int
-avr_peep2_scratch_safe (scratch)
- rtx scratch;
+avr_peep2_scratch_safe (rtx scratch)
{
if ((interrupt_function_p (current_function_decl)
|| signal_function_p (current_function_decl))
Operand 3: label to jump to if the test is true. */
const char *
-avr_out_sbxx_branch (insn, operands)
- rtx insn;
- rtx operands[];
+avr_out_sbxx_branch (rtx insn, rtx operands[])
{
enum rtx_code comp = GET_CODE (operands[0]);
int long_jump = (get_attr_length (insn) >= 4);
}
static void
-avr_asm_out_ctor (symbol, priority)
- rtx symbol;
- int priority;
+avr_asm_out_ctor (rtx symbol, int priority)
{
fputs ("\t.global __do_global_ctors\n", asm_out_file);
default_ctor_section_asm_out_constructor (symbol, priority);
}
static void
-avr_asm_out_dtor (symbol, priority)
- rtx symbol;
- int priority;
+avr_asm_out_dtor (rtx symbol, int priority)
{
fputs ("\t.global __do_global_dtors\n", asm_out_file);
default_dtor_section_asm_out_destructor (symbol, priority);