summaryrefslogtreecommitdiff
path: root/gcc/config/ip2k/ip2k.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/ip2k/ip2k.c')
-rw-r--r--gcc/config/ip2k/ip2k.c234
1 files changed, 63 insertions, 171 deletions
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index 038b86abafb..b8a9eedef34 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -143,8 +143,7 @@ int ip2k_reorg_merge_qimode = 0;
/* Set up local allocation order. */
void
-ip2k_init_local_alloc (rao)
- int * rao;
+ip2k_init_local_alloc (int *rao)
{
static const int alloc_order[] = REG_ALLOC_ORDER;
@@ -159,10 +158,7 @@ ip2k_init_local_alloc (rao)
SIZE is the number of bytes of arguments passed on the stack. */
int
-ip2k_return_pops_args (fundecl, funtype, size)
- tree fundecl ATTRIBUTE_UNUSED;
- tree funtype;
- int size;
+ip2k_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, tree funtype, int size)
{
if (TREE_CODE (funtype) == IDENTIFIER_NODE)
return size;
@@ -177,8 +173,7 @@ ip2k_return_pops_args (fundecl, funtype, size)
/* Return nonzero if FUNC is a naked function. */
static int
-ip2k_naked_function_p (func)
- tree func;
+ip2k_naked_function_p (tree func)
{
tree a;
@@ -191,9 +186,7 @@ ip2k_naked_function_p (func)
/* Output function prologue. */
void
-function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+function_prologue (FILE *file, HOST_WIDE_INT size)
{
int leaf_func_p;
int main_p;
@@ -314,9 +307,7 @@ function_prologue (file, size)
/* Output function epilogue. */
void
-function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+function_epilogue (FILE *file, HOST_WIDE_INT size)
{
int leaf_func_p;
int reg,savelimit;
@@ -550,9 +541,7 @@ function_epilogue (file, size)
STACK ALLOCATION
<------ SP ($6:$7) */
int
-ip2k_init_elim_offset (from, to)
- int from;
- int to;
+ip2k_init_elim_offset (int from, int to)
{
int leaf_func_p = leaf_function_p ();
int no_saved_pc = leaf_func_p
@@ -597,10 +586,7 @@ ip2k_init_elim_offset (from, to)
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)
{
int off;
@@ -689,8 +675,7 @@ legitimate_address_p (mode, x, strict)
/* Is ADDR mode dependent? */
int
-ip2k_mode_dependent_address (addr)
- rtx addr;
+ip2k_mode_dependent_address (rtx addr)
{
switch (GET_CODE (addr))
{
@@ -712,11 +697,8 @@ ip2k_mode_dependent_address (addr)
memory address for an operand of mode MODE. */
rtx
-legitimize_address (x, oldx, mode, scratch)
- rtx x;
- rtx oldx ATTRIBUTE_UNUSED;
- rtx scratch;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED, rtx scratch)
{
rtx reg;
@@ -747,8 +729,7 @@ legitimize_address (x, oldx, mode, scratch)
data and stack variables reside in data memory. Only code is believed
to be in PRAM or FLASH. */
int
-is_regfile_address (x)
- rtx x;
+is_regfile_address (rtx x)
{
while (1)
switch (GET_CODE (x))
@@ -775,9 +756,7 @@ is_regfile_address (x)
/* 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))
{
@@ -848,10 +827,7 @@ print_operand_address (file, 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;
unsigned long value;
@@ -1101,9 +1077,7 @@ print_operand (file, x, code)
/* Remember the operands for the compare. */
const char *
-ip2k_set_compare (x, y)
- rtx x;
- rtx y;
+ip2k_set_compare (rtx x, rtx y)
{
ip2k_compare_operands[0] = x;
ip2k_compare_operands[1] = y;
@@ -1112,10 +1086,7 @@ ip2k_set_compare (x, y)
/* Emit the code for sCOND instructions. */
const char *
-ip2k_gen_sCOND (insn, code, dest)
- rtx insn ATTRIBUTE_UNUSED;
- enum rtx_code code;
- rtx dest;
+ip2k_gen_sCOND (rtx insn ATTRIBUTE_UNUSED, enum rtx_code code, rtx dest)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -1326,10 +1297,7 @@ ip2k_gen_sCOND (insn, code, dest)
}
const char *
-ip2k_gen_signed_comp_branch (insn, code, label)
- rtx insn;
- enum rtx_code code;
- rtx label;
+ip2k_gen_signed_comp_branch (rtx insn, enum rtx_code code, rtx label)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -1675,10 +1643,7 @@ ip2k_gen_signed_comp_branch (insn, code, label)
}
const char *
-ip2k_gen_unsigned_comp_branch (insn, code, label)
- rtx insn;
- enum rtx_code code;
- rtx label;
+ip2k_gen_unsigned_comp_branch (rtx insn, enum rtx_code code, rtx label)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -3043,9 +3008,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
/* Output rtx VALUE as .byte to file FILE. */
void
-asm_output_char(file, value)
- FILE *file;
- rtx value;
+asm_output_char (FILE *file, rtx value)
{
fprintf (file, "\t.byte ");
output_addr_const (file, value);
@@ -3056,9 +3019,7 @@ asm_output_char(file, value)
/* Output VALUE as .byte to file FILE. */
void
-asm_output_byte (file,value)
- FILE *file;
- int value;
+asm_output_byte (FILE *file, int value)
{
fprintf (file, "\t.byte 0x%x\n",value & 0xff);
}
@@ -3067,9 +3028,7 @@ asm_output_byte (file,value)
/* Output rtx VALUE as .word to file FILE. */
void
-asm_output_short (file, value)
- FILE *file;
- rtx value;
+asm_output_short (FILE *file, rtx value)
{
fprintf (file, "\t.word ");
output_addr_const (file, (value));
@@ -3080,9 +3039,7 @@ asm_output_short (file, value)
/* Output real N to file FILE. */
void
-asm_output_float (file, n)
- FILE *file;
- REAL_VALUE_TYPE n;
+asm_output_float (FILE *file, REAL_VALUE_TYPE n)
{
long val;
char dstr[100];
@@ -3096,9 +3053,7 @@ asm_output_float (file, n)
/* Sets section name for declaration DECL. */
void
-unique_section (decl, reloc)
- tree decl;
- int reloc ATTRIBUTE_UNUSED;
+unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
{
int len;
const char *name;
@@ -3131,11 +3086,8 @@ unique_section (decl, reloc)
/* Output section name to file FILE. */
void
-asm_output_section_name(file, decl, name, reloc)
- FILE *file;
- tree decl ATTRIBUTE_UNUSED;
- const char *name;
- int reloc ATTRIBUTE_UNUSED;
+asm_output_section_name (FILE *file, tree decl ATTRIBUTE_UNUSED,
+ const char *name, int reloc ATTRIBUTE_UNUSED)
{
fprintf (file, ".section %s\n", name);
}
@@ -3145,8 +3097,7 @@ asm_output_section_name(file, decl, name, reloc)
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 == IP_REGS
|| c == IPL_REGS
@@ -3176,12 +3127,10 @@ const struct attribute_spec ip2k_attribute_table[] =
/* Handle a "progmem" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-ip2k_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;
+ip2k_handle_progmem_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (DECL_P (*node))
{
@@ -3220,12 +3169,10 @@ ip2k_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */
static tree
-ip2k_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;
+ip2k_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)
{
@@ -3244,10 +3191,7 @@ ip2k_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-ip2k_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+ip2k_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
int extra_cost = 0;
@@ -3380,8 +3324,7 @@ ip2k_rtx_costs (x, code, outer_code, total)
/* Calculate the cost of a memory address. */
static int
-ip2k_address_cost (x)
- rtx x;
+ip2k_address_cost (rtx x)
{
switch (legitimate_address_p (VOIDmode, x, 0))
{
@@ -4160,9 +4103,7 @@ mdr_try_move_dp_reload (first_insn)
a fixed constant, offset. If it definitely can then returns nonzero. */
static int
-ip2k_check_can_adjust_stack_ref (x, offset)
- rtx x;
- int offset;
+ip2k_check_can_adjust_stack_ref (rtx x, int offset)
{
if (GET_RTX_CLASS (GET_CODE (x)) == '2'
|| GET_RTX_CLASS (GET_CODE (x)) == 'c')
@@ -4208,9 +4149,7 @@ ip2k_check_can_adjust_stack_ref (x, offset)
a fixed offset. */
static void
-ip2k_adjust_stack_ref (x, offset)
- rtx *x;
- int offset;
+ip2k_adjust_stack_ref (rtx *x, int offset)
{
if (GET_RTX_CLASS (GET_CODE (*x)) == '2'
|| GET_RTX_CLASS (GET_CODE (*x)) == 'c')
@@ -4699,9 +4638,7 @@ mdr_try_propagate_clr (first_insn)
nonzero if we definitely don't have such a memory ref. */
static int
-ip2k_xexp_not_uses_reg_for_mem (x, regno)
- rtx x;
- unsigned int regno;
+ip2k_xexp_not_uses_reg_for_mem (rtx x, unsigned int regno)
{
if (regno & 1)
regno &= 0xfffffffe;
@@ -5316,7 +5253,7 @@ mdr_try_wreg_elim (first_insn)
making the subsequent runs continue to win. */
static void
-ip2k_reorg ()
+ip2k_reorg (void)
{
#ifdef IP2K_MD_REORG_PASS
rtx first_insn, insn, set;
@@ -5518,8 +5455,7 @@ ip2k_init_libfuncs (void)
/* Returns a bit position if mask contains only a single bit. Returns -1 if
there were zero or more than one set bits. */
int
-find_one_set_bit_p (mask)
- HOST_WIDE_INT mask;
+find_one_set_bit_p (HOST_WIDE_INT mask)
{
int i;
unsigned HOST_WIDE_INT n = mask;
@@ -5540,8 +5476,7 @@ find_one_set_bit_p (mask)
/* Returns a bit position if mask contains only a single clear bit.
Returns -1 if there were zero or more than one clear bits. */
int
-find_one_clear_bit_p (mask)
- HOST_WIDE_INT mask;
+find_one_clear_bit_p (HOST_WIDE_INT mask)
{
int i;
unsigned HOST_WIDE_INT n = mask;
@@ -5568,10 +5503,8 @@ find_one_clear_bit_p (mask)
and OPERANDS[5]. */
void
-ip2k_split_words (nmode, omode, operands)
- enum machine_mode nmode;
- enum machine_mode omode;
- rtx *operands;
+ip2k_split_words (enum machine_mode nmode, enum machine_mode omode,
+ rtx *operands)
{
rtx dl, dh; /* src/dest pieces. */
rtx sl, sh;
@@ -5759,9 +5692,7 @@ ip2k_split_words (nmode, omode, operands)
/* Get the low half of an operand. */
rtx
-ip2k_get_low_half (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_get_low_half (rtx x, enum machine_mode mode)
{
switch (GET_CODE (x))
{
@@ -5860,9 +5791,7 @@ ip2k_get_low_half (x, mode)
/* Get the high half of an operand. */
rtx
-ip2k_get_high_half (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_get_high_half (rtx x, enum machine_mode mode)
{
switch (GET_CODE (x))
{
@@ -5962,9 +5891,7 @@ ip2k_get_high_half (x, mode)
or REG_FP. */
int
-ip2k_address_uses_reg_p (x, r)
- rtx x;
- unsigned int r;
+ip2k_address_uses_reg_p (rtx x, unsigned int r)
{
if (GET_CODE (x) != MEM)
return 0;
@@ -6011,10 +5938,7 @@ ip2k_address_uses_reg_p (x, r)
that it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_xexp_not_uses_reg_p (x, r, rsz)
- rtx x;
- unsigned int r;
- int rsz;
+ip2k_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
{
switch (GET_CODE (x))
{
@@ -6047,10 +5971,7 @@ ip2k_xexp_not_uses_reg_p (x, r, rsz)
that it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_composite_xexp_not_uses_reg_p (x, r, rsz)
- rtx x;
- unsigned int r;
- int rsz;
+ip2k_composite_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
{
if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
return (ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz)
@@ -6074,8 +5995,7 @@ ip2k_composite_xexp_not_uses_reg_p (x, r, rsz)
it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_composite_xexp_not_uses_cc0_p (x)
- rtx x;
+ip2k_composite_xexp_not_uses_cc0_p (rtx x)
{
if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
return (ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0))
@@ -6096,17 +6016,13 @@ ip2k_composite_xexp_not_uses_cc0_p (x)
}
int
-ip2k_split_dest_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_split_dest_operand (rtx x, enum machine_mode mode)
{
return nonimmediate_operand (x, mode) || push_operand (x, mode);
}
int
-ip2k_nonptr_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_nonptr_operand (rtx x, enum machine_mode mode)
{
return register_operand (x, mode) && !ip2k_ptr_operand (x, mode);
}
@@ -6114,9 +6030,7 @@ ip2k_nonptr_operand (x, mode)
/* Is X a reference to IP or DP or SP? */
int
-ip2k_ptr_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_ptr_operand (rtx x, enum machine_mode mode)
{
if (GET_CODE (x) == SUBREG)
@@ -6130,18 +6044,14 @@ ip2k_ptr_operand (x, mode)
}
int
-ip2k_sp_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_sp_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return REG_P (x) && REGNO (x) == REG_SP;
}
int
-ip2k_ip_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_ip_operand (rtx x, enum machine_mode mode)
{
if (GET_CODE (x) != MEM)
@@ -6163,9 +6073,7 @@ ip2k_ip_operand (x, mode)
/* Is X a memory address suitable for SP or DP relative addressing? */
int
-ip2k_short_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_short_operand (rtx x, enum machine_mode mode)
{
int r;
unsigned int offs = 0;
@@ -6211,9 +6119,7 @@ ip2k_short_operand (x, mode)
}
int
-ip2k_nonsp_reg_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_nonsp_reg_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
@@ -6222,9 +6128,7 @@ ip2k_nonsp_reg_operand (x, mode)
}
int
-ip2k_gen_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_gen_operand (rtx x, enum machine_mode mode)
{
return ip2k_short_operand (x, mode)
|| (GET_CODE (x) == SUBREG
@@ -6233,9 +6137,7 @@ ip2k_gen_operand (x, mode)
}
int
-ip2k_extra_constraint (x, c)
- rtx x;
- int c;
+ip2k_extra_constraint (rtx x, int c)
{
switch (c)
{
@@ -6254,18 +6156,14 @@ ip2k_extra_constraint (x, c)
}
int
-ip2k_unary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_unary_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || GET_MODE (op) == mode)
&& GET_RTX_CLASS (GET_CODE (op)) == '1');
}
int
-ip2k_binary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_binary_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || GET_MODE (op) == mode)
&& (GET_RTX_CLASS (GET_CODE (op)) == 'c'
@@ -6273,9 +6171,7 @@ ip2k_binary_operator (op, mode)
}
int
-ip2k_symbol_ref_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_symbol_ref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* We define an IP2k symbol ref to be either a direct reference or one
with a constant offset. */
@@ -6286,18 +6182,14 @@ ip2k_symbol_ref_operand (op, mode)
}
int
-ip2k_signed_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_signed_comparison_operator (rtx op, enum machine_mode mode)
{
return (comparison_operator (op, mode)
&& signed_condition (GET_CODE (op)) == GET_CODE (op));
}
int
-ip2k_unsigned_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_unsigned_comparison_operator (rtx op, enum machine_mode mode)
{
return (comparison_operator (op, mode)
&& unsigned_condition (GET_CODE (op)) == GET_CODE (op));