m32r.c: Include toplev.h.

* m32r.c: Include toplev.h.
        (*): Add ATTRIBUTE_UNUSED as needed to arguments.
        (gen_compare): Rename swap_p to must_swap to match uses.
        Add default abort case.
        (m32r_output_function_epilogue): Remove unused variables.
        (m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX.
        * m32r.h (PROTO, STDIO_PROTO): Rename XPROTO; unconditionally
        define to empty parameter list.  Update all uses.
        (predicate decls): Use enum machine_mode not int.
        * m32r.md (movsi): Call abort, not fatal_insn.
        (zero_branch_insn, rev_zero_branch_insn): Add default abort case.

From-SVN: r29459
This commit is contained in:
Richard Henderson 1999-09-16 11:38:52 -07:00 committed by Richard Henderson
parent 033ed3404f
commit 61f3b78faa
4 changed files with 121 additions and 102 deletions

View File

@ -1,3 +1,17 @@
Thu Sep 16 11:37:32 1999 Richard Henderson <rth@cygnus.com>
* m32r.c: Include toplev.h.
(*): Add ATTRIBUTE_UNUSED as needed to arguments.
(gen_compare): Rename swap_p to must_swap to match uses.
Add default abort case.
(m32r_output_function_epilogue): Remove unused variables.
(m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX.
* m32r.h (PROTO, STDIO_PROTO): Rename XPROTO; unconditionally
define to empty parameter list. Update all uses.
(predicate decls): Use enum machine_mode not int.
* m32r.md (movsi): Call abort, not fatal_insn.
(zero_branch_insn, rev_zero_branch_insn): Add default abort case.
1999-09-14 Andrew Haley <aph@cygnus.com>
* config/mips/mips.md (movsi_usw): if operand 1 is const_int 0,

View File

@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "function.h"
#include "recog.h"
#include "toplev.h"
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@ -237,8 +238,8 @@ init_idents PROTO ((void))
int
m32r_valid_machine_decl_attribute (type, attributes, identifier, args)
tree type;
tree attributes;
tree type ATTRIBUTE_UNUSED;
tree attributes ATTRIBUTE_UNUSED;
tree identifier;
tree args;
{
@ -269,7 +270,8 @@ m32r_valid_machine_decl_attribute (type, attributes, identifier, args)
int
m32r_comp_type_attributes (type1, type2)
tree type1, type2;
tree type1 ATTRIBUTE_UNUSED;
tree type2 ATTRIBUTE_UNUSED;
{
return 1;
}
@ -278,7 +280,7 @@ m32r_comp_type_attributes (type1, type2)
void
m32r_set_default_type_attributes (type)
tree type;
tree type ATTRIBUTE_UNUSED;
{
}
@ -477,7 +479,7 @@ call_operand (op, int_mode)
int
symbolic_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
switch (GET_CODE (op))
{
@ -496,7 +498,7 @@ symbolic_operand (op, int_mode)
int
small_data_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (! TARGET_SDATA_USE)
return 0;
@ -519,7 +521,7 @@ small_data_operand (op, int_mode)
int
addr24_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == LABEL_REF)
return TARGET_ADDR24;
@ -577,7 +579,7 @@ addr32_operand (op, int_mode)
int
call26_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SYMBOL_REF)
return ! LARGE_NAME_P (XSTR (op, 0));
@ -590,7 +592,7 @@ call26_operand (op, int_mode)
int
seth_add3_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == SYMBOL_REF
|| GET_CODE (op) == LABEL_REF)
@ -612,7 +614,7 @@ seth_add3_operand (op, int_mode)
int
cmp_int16_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != CONST_INT)
return 0;
@ -624,7 +626,7 @@ cmp_int16_operand (op, int_mode)
int
uint16_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != CONST_INT)
return 0;
@ -684,7 +686,7 @@ reg_or_cmp_int16_operand (op, int_mode)
int
two_insn_const_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != CONST_INT)
return 0;
@ -853,7 +855,7 @@ easy_df_const (op)
int
eqne_comparison_operator (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
@ -867,7 +869,7 @@ eqne_comparison_operator (op, int_mode)
int
signed_comparison_operator (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
enum rtx_code code = GET_CODE (op);
@ -883,7 +885,7 @@ signed_comparison_operator (op, int_mode)
int
memreg_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG;
}
@ -894,7 +896,7 @@ memreg_operand (op, int_mode)
int
small_insn_p (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0)
return 1;
@ -910,7 +912,7 @@ small_insn_p (op, int_mode)
int
large_insn_p (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
if (GET_RTX_CLASS (GET_CODE (op)) != 'i')
return 0;
@ -926,8 +928,9 @@ large_insn_p (op, int_mode)
int
m32r_select_cc_mode (op, x, y)
int op;
rtx x, y;
int op ATTRIBUTE_UNUSED;
rtx x ATTRIBUTE_UNUSED;
rtx y ATTRIBUTE_UNUSED;
{
return (int)SImode;
}
@ -946,7 +949,7 @@ gen_compare (code, x, y, need_compare)
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
enum rtx_code compare_code, branch_code;
rtx cc_reg = gen_rtx_REG (mode, CARRY_REGNUM);
int swap_p = 0;
int must_swap = 0;
switch (code)
{
@ -960,6 +963,9 @@ gen_compare (code, x, y, need_compare)
case LEU: compare_code = LTU; branch_code = EQ; must_swap = 1; break;
case GTU: compare_code = LTU; branch_code = NE; must_swap = 1; break;
case GEU: compare_code = LTU; branch_code = EQ; break;
default:
abort();
}
if (need_compare)
@ -1135,6 +1141,9 @@ gen_compare (code, x, y, need_compare)
case LTU :
emit_insn (gen_cmp_ltusi_insn (must_swap ? y : x, must_swap ? x : y));
break;
default:
abort ();
}
return gen_rtx (branch_code, VOIDmode, cc_reg, CONST0_RTX (mode));
@ -1275,7 +1284,7 @@ function_arg_partial_nregs (cum, int_mode, type, named)
CUMULATIVE_ARGS *cum;
int int_mode;
tree type;
int named;
int named ATTRIBUTE_UNUSED;
{
enum machine_mode mode = (enum machine_mode)int_mode;
int ret;
@ -1416,7 +1425,7 @@ m32r_va_arg (valist, type)
int
m32r_address_cost (addr)
rtx addr;
rtx addr ATTRIBUTE_UNUSED;
{
return 1;
}
@ -1733,7 +1742,7 @@ m32r_output_function_prologue (file, size)
void
m32r_output_function_epilogue (file, size)
FILE * file;
int size;
int size ATTRIBUTE_UNUSED;
{
int regno;
int noepilogue = FALSE;
@ -1761,8 +1770,6 @@ m32r_output_function_epilogue (file, size)
if (!noepilogue)
{
unsigned int pretend_size = current_frame_info.pretend_size;
unsigned int frame_size = total_size - pretend_size;
unsigned int var_size = current_frame_info.var_size;
unsigned int args_size = current_frame_info.args_size;
unsigned int gmask = current_frame_info.gmask;
@ -1860,7 +1867,9 @@ m32r_finalize_pic ()
void
m32r_initialize_trampoline (tramp, fnaddr, cxt)
rtx tramp, fnaddr, cxt;
rtx tramp ATTRIBUTE_UNUSED;
rtx fnaddr ATTRIBUTE_UNUSED;
rtx cxt ATTRIBUTE_UNUSED;
{
}
@ -1945,7 +1954,7 @@ m32r_print_operand (file, x, code)
rtx first, second;
split_double (x, &first, &second);
fprintf (file, "0x%08x",
fprintf (file, HOST_WIDE_INT_PRINT_HEX,
code == 'L' ? INTVAL (first) : INTVAL (second));
}
else
@ -2269,7 +2278,7 @@ conditional_move_operand (operand, int_mode)
int
carry_compare_operand (op, int_mode)
rtx op;
int int_mode;
int int_mode ATTRIBUTE_UNUSED;
{
rtx x;
@ -2299,7 +2308,7 @@ carry_compare_operand (op, int_mode)
char *
emit_cond_move (operands, insn)
rtx * operands;
rtx insn;
rtx insn ATTRIBUTE_UNUSED;
{
static char buffer [100];
char * dest = reg_names [REGNO (operands [0])];
@ -2470,7 +2479,7 @@ m32r_expand_block_move (operands)
char *
m32r_output_block_move (insn, operands)
rtx insn;
rtx insn ATTRIBUTE_UNUSED;
rtx operands[];
{
HOST_WIDE_INT bytes = INTVAL (operands[2]);
@ -2591,7 +2600,7 @@ m32r_output_block_move (insn, operands)
int
m32r_block_immediate_operand (op, mode)
rtx op;
int mode;
int mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) != CONST_INT
|| INTVAL (op) > MAX_MOVE_BYTES

View File

@ -1984,19 +1984,8 @@ enum m32r_function_type
{ "large_insn_p", { INSN, CALL_INSN, JUMP_INSN }},
/* Functions declared in m32r.c */
#ifndef PROTO
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
#define PROTO(ARGS) ARGS
#else
#define PROTO(ARGS) ()
#endif
#endif
#ifdef BUFSIZ /* stdio.h has been included, ok to use FILE * */
#define STDIO_PROTO(ARGS) PROTO(ARGS)
#else
#define STDIO_PROTO(ARGS) ()
#endif
#define XPROTO(ARGS) ()
#define STDIO_XPROTO(ARGS) ()
#ifndef TREE_CODE
union tree_node;
@ -2012,65 +2001,68 @@ struct rtx_def;
#define Rtx rtx
#endif
extern void sbss_section PROTO((void));
extern void sdata_section PROTO((void));
extern void m32r_init PROTO((void));
extern int m32r_valid_machine_decl_attribute PROTO((Tree, Tree, Tree, Tree));
extern int m32r_comp_type_attributes PROTO((Tree, Tree));
extern void m32r_select_section PROTO((Tree, int));
extern void m32r_encode_section_info PROTO((Tree));
extern void m32r_init_expanders PROTO((void));
extern int call_address_operand PROTO((Rtx, int));
extern int call_operand PROTO((Rtx, int));
extern int symbolic_operand PROTO((Rtx, int));
extern int small_data_operand PROTO((Rtx, int));
extern int addr24_operand PROTO((Rtx, int));
extern int addr32_operand PROTO((Rtx, int));
extern int call26_operand PROTO((Rtx, int));
extern int seth_add3_operand PROTO((Rtx, int));
extern int cmp_int16_operand PROTO((Rtx, int));
extern int uint16_operand PROTO((Rtx, int));
extern int reg_or_int16_operand PROTO((Rtx, int));
extern int reg_or_uint16_operand PROTO((Rtx, int));
extern int reg_or_cmp_nt16_operand PROTO((Rtx, int));
extern int two_insn_const_operand PROTO((Rtx, int));
extern int move_src_operand PROTO((Rtx, int));
extern int move_double_src_operand PROTO((Rtx, int));
extern int move_dest_operand PROTO((Rtx, int));
extern int easy_di_const PROTO((Rtx));
extern int easy_df_const PROTO((Rtx));
extern int eqne_comparison_operator PROTO((Rtx, int));
extern int signed_comparison_operator PROTO((Rtx, int));
extern int memreg_operand PROTO((Rtx, int));
extern int small_insn_p PROTO((Rtx, int));
extern int large_insn_p PROTO((Rtx, int));
extern int m32r_select_cc_mode PROTO((int, Rtx, Rtx));
extern Rtx gen_compare PROTO((int, Rtx, Rtx, int));
extern Rtx gen_split_move_double PROTO((Rtx *));
extern int function_arg_partial_nregs PROTO((CUMULATIVE_ARGS *,
extern void sbss_section XPROTO((void));
extern void sdata_section XPROTO((void));
extern void m32r_init XPROTO((void));
extern int m32r_valid_machine_decl_attribute XPROTO((Tree, Tree, Tree, Tree));
extern int m32r_comp_type_attributes XPROTO((Tree, Tree));
extern void m32r_select_section XPROTO((Tree, int));
extern void m32r_encode_section_info XPROTO((Tree));
extern void m32r_init_expanders XPROTO((void));
extern int call_address_operand XPROTO((Rtx, enum machine_mode));
extern int call_operand XPROTO((Rtx, enum machine_mode));
extern int symbolic_operand XPROTO((Rtx, enum machine_mode));
extern int small_data_operand XPROTO((Rtx, enum machine_mode));
extern int addr24_operand XPROTO((Rtx, enum machine_mode));
extern int addr32_operand XPROTO((Rtx, enum machine_mode));
extern int call26_operand XPROTO((Rtx, enum machine_mode));
extern int seth_add3_operand XPROTO((Rtx, enum machine_mode));
extern int cmp_int16_operand XPROTO((Rtx, enum machine_mode));
extern int uint16_operand XPROTO((Rtx, enum machine_mode));
extern int reg_or_int16_operand XPROTO((Rtx, enum machine_mode));
extern int reg_or_uint16_operand XPROTO((Rtx, enum machine_mode));
extern int reg_or_cmp_nt16_operand XPROTO((Rtx, enum machine_mode));
extern int two_insn_const_operand XPROTO((Rtx, enum machine_mode));
extern int move_src_operand XPROTO((Rtx, enum machine_mode));
extern int move_double_src_operand XPROTO((Rtx, enum machine_mode));
extern int move_dest_operand XPROTO((Rtx, enum machine_mode));
extern int easy_di_const XPROTO((Rtx));
extern int easy_df_const XPROTO((Rtx));
extern int eqne_comparison_operator XPROTO((Rtx, enum machine_mode));
extern int signed_comparison_operator XPROTO((Rtx, enum machine_mode));
extern int memreg_operand XPROTO((Rtx, enum machine_mode));
extern int small_insn_p XPROTO((Rtx, enum machine_mode));
extern int large_insn_p XPROTO((Rtx, enum machine_mode));
extern int m32r_select_cc_mode XPROTO((int, Rtx, Rtx));
extern Rtx gen_compare XPROTO((int, Rtx, Rtx, int));
extern Rtx gen_split_move_double XPROTO((Rtx *));
extern int function_arg_partial_nregs XPROTO((CUMULATIVE_ARGS *,
int, Tree, int));
extern void m32r_setup_incoming_varargs PROTO((CUMULATIVE_ARGS *,
extern void m32r_setup_incoming_varargs XPROTO((CUMULATIVE_ARGS *,
int, Tree, int *,
int));
extern struct rtx_def *m32r_va_arg PROTO((Tree, Tree));
extern int m32r_address_code PROTO((Rtx));
extern struct rtx_def *m32r_va_arg XPROTO((Tree, Tree));
extern int m32r_address_code XPROTO((Rtx));
extern enum m32r_function_type m32r_compute_function_type
PROTO((Tree));
extern unsigned m32r_compute_frame_size PROTO((int));
extern int m32r_first_insn_address PROTO((void));
extern void m32r_expand_prologue PROTO((void));
extern void m32r_output_function_prologue STDIO_PROTO((FILE *, int));
extern void m32r_output_function_epilogue STDIO_PROTO((FILE *, int));
extern void m32r_finalize_pic PROTO((void));
extern void m32r_initialize_trampoline PROTO((Rtx, Rtx, Rtx));
extern void m32r_asm_file_start STDIO_PROTO((FILE *));
extern void m32r_print_operand STDIO_PROTO((FILE *, Rtx, int));
extern void m32r_print_operand_address STDIO_PROTO((FILE *, Rtx));
extern int zero_and_one PROTO((Rtx, Rtx));
extern int conditional_move_operand PROTO((Rtx, int));
extern int carry_compare_operand PROTO((Rtx, int));
extern char *emit_cond_move PROTO((Rtx *, Rtx));
XPROTO((Tree));
extern unsigned m32r_compute_frame_size XPROTO((int));
extern int m32r_first_insn_address XPROTO((void));
extern void m32r_expand_prologue XPROTO((void));
extern void m32r_output_function_prologue STDIO_XPROTO((FILE *, int));
extern void m32r_output_function_epilogue STDIO_XPROTO((FILE *, int));
extern void m32r_finalize_pic XPROTO((void));
extern void m32r_initialize_trampoline XPROTO((Rtx, Rtx, Rtx));
extern void m32r_asm_file_start STDIO_XPROTO((FILE *));
extern void m32r_print_operand STDIO_XPROTO((FILE *, Rtx, int));
extern void m32r_print_operand_address STDIO_XPROTO((FILE *, Rtx));
extern int zero_and_one XPROTO((Rtx, Rtx));
extern int conditional_move_operand XPROTO((Rtx, enum machine_mode));
extern int carry_compare_operand XPROTO((Rtx, enum machine_mode));
extern char *emit_cond_move XPROTO((Rtx *, Rtx));
extern char * m32r_output_block_move PROTO((Rtx, Rtx *));
extern int m32r_block_immediate_operand PROTO((Rtx, int));
extern void m32r_expand_block_move PROTO((Rtx *));
extern char * m32r_output_block_move XPROTO((Rtx, Rtx *));
extern int m32r_block_immediate_operand XPROTO((Rtx, enum machine_mode));
extern void m32r_expand_block_move XPROTO((Rtx *));
#undef XPROTO
#undef STDIO_XPROTO

View File

@ -388,7 +388,7 @@
&& (GET_CODE (operands[1]) == REG || GET_CODE (operands[1]) == SUBREG))
return \"st %1,%0\";
fatal_insn (\"bad movsi insn\", insn);
abort ();
}"
[(set_attr "type" "int2,int2,int4,int4,int4,multi,load2,load2,load4,store2,store2,store4")
(set_attr "length" "2,2,4,4,4,8,2,2,4,2,2,4")])
@ -1418,6 +1418,8 @@
case GT : br = \"gt\"; invbr = \"le\"; break;
case LT : br = \"lt\"; invbr = \"ge\"; break;
case GE : br = \"ge\"; invbr = \"lt\"; break;
default: abort();
}
/* Is branch target reachable with bxxz? */
@ -1463,6 +1465,8 @@
case GT : br = \"gt\"; invbr = \"le\"; break;
case LT : br = \"lt\"; invbr = \"ge\"; break;
case GE : br = \"ge\"; invbr = \"lt\"; break;
default: abort();
}
/* Is branch target reachable with bxxz? */