Commit 441d04c6 by Kaveh R. Ghazi Committed by Kaveh Ghazi

h8300-protos.h: New file.

        * h8300-protos.h: New file.

        * h8300.c: Include tm_p.h.  Add static prototypes.  Fix compile
        time warnings.

        * h8300.h: Move prototypes to h8300-protos.h.  Fix compile time
        warnings.

        * h8300.md: Likewise.

From-SVN: r31426
parent 05b13f59
2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* h8300-protos.h: New file.
* h8300.c: Include tm_p.h. Add static prototypes. Fix compile
time warnings.
* h8300.h: Move prototypes to h8300-protos.h. Fix compile time
warnings.
* h8300.md: Likewise.
2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* varasm.c (asm_output_bss): Mark parameters with ATTRIBUTE_UNUSED. * varasm.c (asm_output_bss): Mark parameters with ATTRIBUTE_UNUSED.
(asm_emit_uninitialised): Likewise. (asm_emit_uninitialised): Likewise.
......
/* Definitions of target machine for GNU compiler.
Hitachi H8/300 version generating coff
Copyright (C) 2000 Free SoftwareFoundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Declarations for functions used in insn-output.c. */
#ifdef RTX_CODE
extern const char *emit_a_shift PARAMS ((rtx, rtx *));
extern const char *output_adds_subs PARAMS ((rtx *));
extern const char * output_simode_bld PARAMS ((int, int, rtx[]));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern const char *byte_reg PARAMS ((rtx, int));
extern int const_costs PARAMS ((rtx, enum rtx_code));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void final_prescan_insn PARAMS ((rtx, rtx *, int));
extern int do_movsi PARAMS ((rtx[]));
extern void notice_update_cc PARAMS ((rtx, rtx));
extern int expand_a_shift PARAMS ((enum machine_mode, int, rtx[]));
extern int fix_bit_operand PARAMS ((rtx *, int, enum rtx_code));
extern int h8300_adjust_insn_length PARAMS ((rtx, int));
extern int general_operand_src PARAMS ((rtx, enum machine_mode));
extern int general_operand_dst PARAMS ((rtx, enum machine_mode));
extern int o_operand PARAMS ((rtx, enum machine_mode));
extern int p_operand PARAMS ((rtx, enum machine_mode));
extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
extern int adds_subs_operand PARAMS ((rtx, enum machine_mode));
extern int one_insn_adds_subs_operand PARAMS ((rtx, enum machine_mode));
extern int small_call_insn_operand PARAMS ((rtx, enum machine_mode));
extern int jump_address_operand PARAMS ((rtx, enum machine_mode));
extern int bit_operand PARAMS ((rtx, enum machine_mode));
extern int bit_memory_operand PARAMS ((rtx, enum machine_mode));
extern int eq_operator PARAMS ((rtx, enum machine_mode));
extern int bit_operator PARAMS ((rtx, enum machine_mode));
extern int nshift_operator PARAMS ((rtx, enum machine_mode));
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *,
enum machine_mode, tree, int));
extern int h8300_valid_machine_decl_attribute PARAMS ((tree, tree, tree,
tree));
extern int h8300_funcvec_function_p PARAMS ((tree));
extern int h8300_eightbit_data_p PARAMS ((tree));
extern int h8300_tiny_data_p PARAMS ((tree));
extern void h8300_encode_label PARAMS ((tree));
#endif /* TREE_CODE */
extern int handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *));
extern void h8300_init_once PARAMS ((void));
extern void function_prologue PARAMS ((FILE *, int));
extern void function_epilogue PARAMS ((FILE *, int));
extern void asm_file_start PARAMS ((FILE *));
extern void asm_file_end PARAMS ((FILE *));
extern int ok_for_bclr PARAMS ((int));
extern int small_power_of_two PARAMS ((int));
extern int initial_offset PARAMS ((int, int));
/* Subroutines for insn-output.c for Hitachi H8/300. /* Subroutines for insn-output.c for Hitachi H8/300.
Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Copyright (C) 1992, 93-99, 2000 Free Software
Foundation, Inc. Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com), Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
...@@ -38,13 +38,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -38,13 +38,15 @@ Boston, MA 02111-1307, USA. */
#include "expr.h" #include "expr.h"
#include "function.h" #include "function.h"
#include "obstack.h" #include "obstack.h"
#include "toplev.h"
#include "tm_p.h"
/* Forward declarations. */ /* Forward declarations. */
void print_operand_address ();
static int h8300_interrupt_function_p PROTO ((tree)); static int h8300_interrupt_function_p PROTO ((tree));
static int h8300_monitor_function_p PROTO ((tree)); static int h8300_monitor_function_p PROTO ((tree));
static int h8300_os_task_function_p PROTO ((tree)); static int h8300_os_task_function_p PROTO ((tree));
static void dosize PROTO ((FILE *, const char *, unsigned int));
static const char *cond_string PROTO ((enum rtx_code));
/* CPU_TYPE, says what cpu we're compiling for. */ /* CPU_TYPE, says what cpu we're compiling for. */
int cpu_type; int cpu_type;
...@@ -64,29 +66,26 @@ int monitor; ...@@ -64,29 +66,26 @@ int monitor;
/* True if a #pragma saveall has been seen for the current function. */ /* True if a #pragma saveall has been seen for the current function. */
int pragma_saveall; int pragma_saveall;
static char *names_big[] = static const char *const names_big[] =
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7"}; {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7"};
static char *names_extended[] = static const char *const names_extended[] =
{"er0", "er1", "er2", "er3", "er4", "er5", "er6", "er7"}; {"er0", "er1", "er2", "er3", "er4", "er5", "er6", "er7"};
static char *names_upper_extended[] = static const char *const names_upper_extended[] =
{"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7"}; {"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7"};
/* Points to one of the above. */ /* Points to one of the above. */
/* ??? The above could be put in an array indexed by CPU_TYPE. */ /* ??? The above could be put in an array indexed by CPU_TYPE. */
char **h8_reg_names; const char * const *h8_reg_names;
/* Various operations needed by the following, indexed by CPU_TYPE. */ /* Various operations needed by the following, indexed by CPU_TYPE. */
static char *h8_push_ops[2] = static const char *const h8_push_ops[2] = {"push", "push.l"};
{"push", "push.l"}; static const char *const h8_pop_ops[2] = {"pop", "pop.l"};
static char *h8_pop_ops[2] = static const char *const h8_mov_ops[2] = {"mov.w", "mov.l"};
{"pop", "pop.l"};
static char *h8_mov_ops[2] =
{"mov.w", "mov.l"};
char *h8_push_op, *h8_pop_op, *h8_mov_op; const char *h8_push_op, *h8_pop_op, *h8_mov_op;
/* Initialize various cpu specific globals at start up. */ /* Initialize various cpu specific globals at start up. */
...@@ -109,12 +108,12 @@ h8300_init_once () ...@@ -109,12 +108,12 @@ h8300_init_once ()
h8_mov_op = h8_mov_ops[cpu_type]; h8_mov_op = h8_mov_ops[cpu_type];
} }
char * const char *
byte_reg (x, b) byte_reg (x, b)
rtx x; rtx x;
int b; int b;
{ {
static char *names_small[] = static const char *const names_small[] =
{"r0l", "r0h", "r1l", "r1h", "r2l", "r2h", "r3l", "r3h", {"r0l", "r0h", "r1l", "r1h", "r2l", "r2h", "r3l", "r3h",
"r4l", "r4h", "r5l", "r5h", "r6l", "r6h", "r7l", "r7h"}; "r4l", "r4h", "r5l", "r5h", "r6l", "r6h", "r7l", "r7h"};
...@@ -146,7 +145,7 @@ byte_reg (x, b) ...@@ -146,7 +145,7 @@ byte_reg (x, b)
static void static void
dosize (file, op, size) dosize (file, op, size)
FILE *file; FILE *file;
char *op; const char *op;
unsigned int size; unsigned int size;
{ {
/* On the h8300h and h8300s, for sizes <= 8 bytes it is as good or /* On the h8300h and h8300s, for sizes <= 8 bytes it is as good or
...@@ -238,7 +237,6 @@ function_prologue (file, size) ...@@ -238,7 +237,6 @@ function_prologue (file, size)
FILE *file; FILE *file;
int size; int size;
{ {
register int mask = 0;
int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8; int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8;
int idx; int idx;
...@@ -382,8 +380,6 @@ function_epilogue (file, size) ...@@ -382,8 +380,6 @@ function_epilogue (file, size)
FILE *file; FILE *file;
int size; int size;
{ {
register int regno;
register int mask = 0;
int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8; int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8;
int idx; int idx;
rtx insn = get_last_insn (); rtx insn = get_last_insn ();
...@@ -514,6 +510,7 @@ out: ...@@ -514,6 +510,7 @@ out:
/* Output assembly code for the start of the file. */ /* Output assembly code for the start of the file. */
void
asm_file_start (file) asm_file_start (file)
FILE *file; FILE *file;
{ {
...@@ -612,7 +609,7 @@ general_operand_dst (op, mode) ...@@ -612,7 +609,7 @@ general_operand_dst (op, mode)
int int
o_operand (operand, mode) o_operand (operand, mode)
rtx operand; rtx operand;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (operand) == CONST_INT return (GET_CODE (operand) == CONST_INT
&& CONST_OK_FOR_O (INTVAL (operand))); && CONST_OK_FOR_O (INTVAL (operand)));
...@@ -623,7 +620,7 @@ o_operand (operand, mode) ...@@ -623,7 +620,7 @@ o_operand (operand, mode)
int int
p_operand (operand, mode) p_operand (operand, mode)
rtx operand; rtx operand;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (operand) == CONST_INT return (GET_CODE (operand) == CONST_INT
&& CONST_OK_FOR_P (INTVAL (operand))); && CONST_OK_FOR_P (INTVAL (operand)));
...@@ -634,7 +631,7 @@ p_operand (operand, mode) ...@@ -634,7 +631,7 @@ p_operand (operand, mode)
int int
call_insn_operand (op, mode) call_insn_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (op) == MEM) if (GET_CODE (op) == MEM)
{ {
...@@ -650,7 +647,7 @@ call_insn_operand (op, mode) ...@@ -650,7 +647,7 @@ call_insn_operand (op, mode)
int int
adds_subs_operand (op, mode) adds_subs_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (op) == CONST_INT) if (GET_CODE (op) == CONST_INT)
{ {
...@@ -676,7 +673,7 @@ adds_subs_operand (op, mode) ...@@ -676,7 +673,7 @@ adds_subs_operand (op, mode)
int int
one_insn_adds_subs_operand (op, mode) one_insn_adds_subs_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
int val = INTVAL (op); int val = INTVAL (op);
...@@ -688,7 +685,7 @@ one_insn_adds_subs_operand (op, mode) ...@@ -688,7 +685,7 @@ one_insn_adds_subs_operand (op, mode)
return 0; return 0;
} }
char * const char *
output_adds_subs (operands) output_adds_subs (operands)
rtx *operands; rtx *operands;
{ {
...@@ -760,7 +757,7 @@ output_adds_subs (operands) ...@@ -760,7 +757,7 @@ output_adds_subs (operands)
int int
small_call_insn_operand (op, mode) small_call_insn_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (op) == MEM) if (GET_CODE (op) == MEM)
{ {
...@@ -840,7 +837,7 @@ bit_operand (op, mode) ...@@ -840,7 +837,7 @@ bit_operand (op, mode)
int int
bit_memory_operand (op, mode) bit_memory_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (op) == MEM return (GET_CODE (op) == MEM
&& EXTRA_CONSTRAINT (op, 'U')); && EXTRA_CONSTRAINT (op, 'U'));
...@@ -851,7 +848,7 @@ bit_memory_operand (op, mode) ...@@ -851,7 +848,7 @@ bit_memory_operand (op, mode)
int int
eq_operator (x, mode) eq_operator (x, mode)
rtx x; rtx x;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (x) == EQ || GET_CODE (x) == NE); return (GET_CODE (x) == EQ || GET_CODE (x) == NE);
} }
...@@ -868,9 +865,9 @@ eq_operator (x, mode) ...@@ -868,9 +865,9 @@ eq_operator (x, mode)
int int
handle_pragma (p_getc, p_ungetc, pname) handle_pragma (p_getc, p_ungetc, pname)
int (* p_getc) PROTO ((void)); int (* ATTRIBUTE_UNUSED p_getc) PROTO ((void));
void (* p_ungetc) PROTO ((int)); void (* ATTRIBUTE_UNUSED p_ungetc) PROTO ((int));
char * pname; const char *pname;
{ {
int retval = 0; int retval = 0;
...@@ -886,7 +883,7 @@ handle_pragma (p_getc, p_ungetc, pname) ...@@ -886,7 +883,7 @@ handle_pragma (p_getc, p_ungetc, pname)
the rtx to represent where it is passed. CUM represents the state after the rtx to represent where it is passed. CUM represents the state after
the last argument. NAMED is not used. */ the last argument. NAMED is not used. */
static char *hand_list[] = static const char *const hand_list[] =
{ {
"__main", "__main",
"__cmpsi2", "__cmpsi2",
...@@ -917,7 +914,7 @@ function_arg (cum, mode, type, named) ...@@ -917,7 +914,7 @@ function_arg (cum, mode, type, named)
int named; int named;
{ {
rtx result = 0; rtx result = 0;
char *fname; const char *fname;
int regpass = 0; int regpass = 0;
/* Never pass unnamed arguments in registers. */ /* Never pass unnamed arguments in registers. */
...@@ -932,7 +929,7 @@ function_arg (cum, mode, type, named) ...@@ -932,7 +929,7 @@ function_arg (cum, mode, type, named)
if (cum->libcall) if (cum->libcall)
{ {
char **p; const char * const *p;
fname = XSTR (cum->libcall, 0); fname = XSTR (cum->libcall, 0);
...@@ -1064,7 +1061,7 @@ const_costs (r, c) ...@@ -1064,7 +1061,7 @@ const_costs (r, c)
/* Return assembly language string which identifies a comparison type. */ /* Return assembly language string which identifies a comparison type. */
static char * static const char *
cond_string (code) cond_string (code)
enum rtx_code code; enum rtx_code code;
{ {
...@@ -1105,7 +1102,7 @@ print_operand (file, x, code) ...@@ -1105,7 +1102,7 @@ print_operand (file, x, code)
int code; int code;
{ {
/* This is used for communication between the 'P' and 'U' codes. */ /* This is used for communication between the 'P' and 'U' codes. */
static char *last_p; static const char *last_p;
/* This is used for communication between codes V,W,Z and Y. */ /* This is used for communication between codes V,W,Z and Y. */
static int bitint; static int bitint;
...@@ -1243,6 +1240,8 @@ print_operand (file, x, code) ...@@ -1243,6 +1240,8 @@ print_operand (file, x, code)
case AND: case AND:
fprintf (file, "band"); fprintf (file, "band");
break; break;
default:
break;
} }
break; break;
case 'c': case 'c':
...@@ -1257,6 +1256,8 @@ print_operand (file, x, code) ...@@ -1257,6 +1256,8 @@ print_operand (file, x, code)
case AND: case AND:
fprintf (file, "biand"); fprintf (file, "biand");
break; break;
default:
break;
} }
break; break;
case 'd': case 'd':
...@@ -1294,7 +1295,7 @@ print_operand (file, x, code) ...@@ -1294,7 +1295,7 @@ print_operand (file, x, code)
REAL_VALUE_TYPE rv; REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, x); REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
REAL_VALUE_TO_TARGET_SINGLE (rv, val); REAL_VALUE_TO_TARGET_SINGLE (rv, val);
fprintf (file, "#%d", ((val >> 16) & 0xffff)); fprintf (file, "#%ld", ((val >> 16) & 0xffff));
break; break;
} }
default: default:
...@@ -1324,7 +1325,7 @@ print_operand (file, x, code) ...@@ -1324,7 +1325,7 @@ print_operand (file, x, code)
REAL_VALUE_TYPE rv; REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, x); REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
REAL_VALUE_TO_TARGET_SINGLE (rv, val); REAL_VALUE_TO_TARGET_SINGLE (rv, val);
fprintf (file, "#%d", (val & 0xffff)); fprintf (file, "#%ld", (val & 0xffff));
break; break;
} }
default: default:
...@@ -1449,9 +1450,11 @@ print_operand (file, x, code) ...@@ -1449,9 +1450,11 @@ print_operand (file, x, code)
REAL_VALUE_TYPE rv; REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, x); REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
REAL_VALUE_TO_TARGET_SINGLE (rv, val); REAL_VALUE_TO_TARGET_SINGLE (rv, val);
fprintf (file, "#%d", val); fprintf (file, "#%ld", val);
break; break;
} }
default:
break;
} }
} }
} }
...@@ -1527,8 +1530,8 @@ print_operand_address (file, addr) ...@@ -1527,8 +1530,8 @@ print_operand_address (file, addr)
void void
final_prescan_insn (insn, operand, num_operands) final_prescan_insn (insn, operand, num_operands)
rtx insn, *operand; rtx insn, *operand ATTRIBUTE_UNUSED;
int num_operands; int num_operands ATTRIBUTE_UNUSED;
{ {
/* This holds the last insn address. */ /* This holds the last insn address. */
static int last_insn_address = 0; static int last_insn_address = 0;
...@@ -1576,6 +1579,7 @@ do_movsi (operands) ...@@ -1576,6 +1579,7 @@ do_movsi (operands)
int int
initial_offset (from, to) initial_offset (from, to)
int from, to;
{ {
int offset = 0; int offset = 0;
...@@ -1603,7 +1607,7 @@ initial_offset (from, to) ...@@ -1603,7 +1607,7 @@ initial_offset (from, to)
/* Update the condition code from the insn. */ /* Update the condition code from the insn. */
int void
notice_update_cc (body, insn) notice_update_cc (body, insn)
rtx body; rtx body;
rtx insn; rtx insn;
...@@ -1657,7 +1661,7 @@ notice_update_cc (body, insn) ...@@ -1657,7 +1661,7 @@ notice_update_cc (body, insn)
int int
bit_operator (x, mode) bit_operator (x, mode)
rtx x; rtx x;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
...@@ -1838,7 +1842,7 @@ bit_operator (x, mode) ...@@ -1838,7 +1842,7 @@ bit_operator (x, mode)
int int
nshift_operator (x, mode) nshift_operator (x, mode)
rtx x; rtx x;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
...@@ -1918,7 +1922,7 @@ enum shift_mode ...@@ -1918,7 +1922,7 @@ enum shift_mode
struct shift_insn struct shift_insn
{ {
char *assembler; const char *assembler;
int cc_valid; int cc_valid;
}; };
...@@ -2068,6 +2072,11 @@ static const char *const rotate_two[3][3] = ...@@ -2068,6 +2072,11 @@ static const char *const rotate_two[3][3] =
} }
}; };
static enum shift_alg get_shift_alg PARAMS ((enum attr_cpu, enum shift_type,
enum machine_mode, int,
const char **, const char **,
int *));
/* Given CPU, MODE, SHIFT_TYPE, and shift count COUNT, determine the best /* Given CPU, MODE, SHIFT_TYPE, and shift count COUNT, determine the best
algorithm for doing the shift. The assembler code is stored in ASSEMBLER. algorithm for doing the shift. The assembler code is stored in ASSEMBLER.
We don't achieve maximum efficiency in all cases, but the hooks are here We don't achieve maximum efficiency in all cases, but the hooks are here
...@@ -2332,7 +2341,7 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p, ...@@ -2332,7 +2341,7 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
return SHIFT_SPECIAL; return SHIFT_SPECIAL;
} }
} }
else if (!TARGET_H8300 && (count == 13 || count == 14) else if ((!TARGET_H8300 && (count == 13 || count == 14))
|| count == 15) || count == 15)
{ {
if (count == 15 && shift_type == SHIFT_ASHIFTRT) if (count == 15 && shift_type == SHIFT_ASHIFTRT)
...@@ -2586,16 +2595,15 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p, ...@@ -2586,16 +2595,15 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
/* Emit the assembler code for doing shifts. */ /* Emit the assembler code for doing shifts. */
char * const char *
emit_a_shift (insn, operands) emit_a_shift (insn, operands)
rtx insn; rtx insn ATTRIBUTE_UNUSED;
rtx *operands; rtx *operands;
{ {
static int loopend_lab; static int loopend_lab;
char *assembler; const char *assembler;
char *assembler2; const char *assembler2;
int cc_valid; int cc_valid;
rtx inside = PATTERN (insn);
rtx shift = operands[3]; rtx shift = operands[3];
enum machine_mode mode = GET_MODE (shift); enum machine_mode mode = GET_MODE (shift);
enum rtx_code code = GET_CODE (shift); enum rtx_code code = GET_CODE (shift);
...@@ -2690,8 +2698,8 @@ emit_a_shift (insn, operands) ...@@ -2690,8 +2698,8 @@ emit_a_shift (insn, operands)
{ {
int m = GET_MODE_BITSIZE (mode) - n; int m = GET_MODE_BITSIZE (mode) - n;
int mask = (shift_type == SHIFT_ASHIFT int mask = (shift_type == SHIFT_ASHIFT
? ((1 << GET_MODE_BITSIZE (mode) - n) - 1) << n ? ((1 << (GET_MODE_BITSIZE (mode) - n)) - 1) << n
: (1 << GET_MODE_BITSIZE (mode) - n) - 1); : (1 << (GET_MODE_BITSIZE (mode) - n)) - 1);
char insn_buf[200]; char insn_buf[200];
/* Not all possibilities of rotate are supported. They shouldn't /* Not all possibilities of rotate are supported. They shouldn't
be generated, but let's watch for 'em. */ be generated, but let's watch for 'em. */
...@@ -2718,17 +2726,18 @@ emit_a_shift (insn, operands) ...@@ -2718,17 +2726,18 @@ emit_a_shift (insn, operands)
switch (mode) switch (mode)
{ {
case QImode: case QImode:
sprintf (insn_buf, "and #%d,%%X0", sprintf (insn_buf, "and #%d,%%X0", mask);
mask, n);
cc_status.value1 = operands[0]; cc_status.value1 = operands[0];
cc_status.flags |= CC_NO_CARRY; cc_status.flags |= CC_NO_CARRY;
break; break;
case HImode: case HImode:
sprintf (insn_buf, "and #%d,%%s0\n\tand #%d,%%t0", sprintf (insn_buf, "and #%d,%%s0\n\tand #%d,%%t0",
mask & 255, mask >> 8, n); mask & 255, mask >> 8);
break; break;
case SImode: case SImode:
abort (); abort ();
default:
break;
} }
} }
else else
...@@ -2788,7 +2797,7 @@ emit_a_shift (insn, operands) ...@@ -2788,7 +2797,7 @@ emit_a_shift (insn, operands)
int int
fix_bit_operand (operands, what, type) fix_bit_operand (operands, what, type)
rtx *operands; rtx *operands;
char what; int what;
enum rtx_code type; enum rtx_code type;
{ {
/* The bit_operand predicate accepts any memory during RTL generation, but /* The bit_operand predicate accepts any memory during RTL generation, but
...@@ -2952,7 +2961,7 @@ h8300_tiny_data_p (decl) ...@@ -2952,7 +2961,7 @@ h8300_tiny_data_p (decl)
int int
h8300_valid_machine_decl_attribute (decl, attributes, attr, args) h8300_valid_machine_decl_attribute (decl, attributes, attr, args)
tree decl; tree decl;
tree attributes; tree attributes ATTRIBUTE_UNUSED;
tree attr; tree attr;
tree args; tree args;
{ {
...@@ -2994,10 +3003,11 @@ h8300_valid_machine_decl_attribute (decl, attributes, attr, args) ...@@ -2994,10 +3003,11 @@ h8300_valid_machine_decl_attribute (decl, attributes, attr, args)
extern struct obstack *saveable_obstack; extern struct obstack *saveable_obstack;
void
h8300_encode_label (decl) h8300_encode_label (decl)
tree decl; tree decl;
{ {
char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str); int len = strlen (str);
char *newstr; char *newstr;
...@@ -3008,7 +3018,7 @@ h8300_encode_label (decl) ...@@ -3008,7 +3018,7 @@ h8300_encode_label (decl)
XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr; XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
} }
char * const char *
output_simode_bld (bild, log2, operands) output_simode_bld (bild, log2, operands)
int bild; int bild;
int log2; int log2;
...@@ -3040,9 +3050,10 @@ output_simode_bld (bild, log2, operands) ...@@ -3040,9 +3050,10 @@ output_simode_bld (bild, log2, operands)
We use this to get the lengths of various memory references correct. */ We use this to get the lengths of various memory references correct. */
int
h8300_adjust_insn_length (insn, length) h8300_adjust_insn_length (insn, length)
rtx insn; rtx insn;
int length; int length ATTRIBUTE_UNUSED;
{ {
rtx pat; rtx pat;
......
/* Definitions of target machine for GNU compiler. /* Definitions of target machine for GNU compiler.
Hitachi H8/300 version generating coff Hitachi H8/300 version generating coff
Copyright (C) 1992, 93-98, 1999 Free SoftwareFoundation, Inc. Copyright (C) 1992, 93-99, 2000 Free SoftwareFoundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com), Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
...@@ -30,8 +30,8 @@ extern int cpu_type; ...@@ -30,8 +30,8 @@ extern int cpu_type;
/* Various globals defined in h8300.c. */ /* Various globals defined in h8300.c. */
extern char *h8_push_op,*h8_pop_op,*h8_mov_op; extern const char *h8_push_op,*h8_pop_op,*h8_mov_op;
extern char **h8_reg_names; extern const char * const *h8_reg_names;
/* Names to predefine in the preprocessor for this target machine. */ /* Names to predefine in the preprocessor for this target machine. */
...@@ -367,10 +367,10 @@ enum reg_class { ...@@ -367,10 +367,10 @@ enum reg_class {
of length N_REG_CLASSES. */ of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS \ #define REG_CLASS_CONTENTS \
{ 0, /* No regs */ \ { {0}, /* No regs */ \
0x2ff, /* GENERAL_REGS */ \ {0x2ff}, /* GENERAL_REGS */ \
0x100, /* MAC_REGS */ \ {0x100}, /* MAC_REGS */ \
0x3ff, /* ALL_REGS */ \ {0x3ff}, /* ALL_REGS */ \
} }
/* The same information, inverted: /* The same information, inverted:
...@@ -631,7 +631,6 @@ struct cum_arg { int nbytes; struct rtx_def * libcall; }; ...@@ -631,7 +631,6 @@ struct cum_arg { int nbytes; struct rtx_def * libcall; };
case the first 3 arguments are passed in registers. case the first 3 arguments are passed in registers.
See function `function_arg'. */ See function `function_arg'. */
struct rtx_def *function_arg();
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED) function_arg (&CUM, MODE, TYPE, NAMED)
...@@ -826,11 +825,11 @@ struct rtx_def *function_arg(); ...@@ -826,11 +825,11 @@ struct rtx_def *function_arg();
&& REG_OK_FOR_BASE_P (XEXP (OP, 0))) \ && REG_OK_FOR_BASE_P (XEXP (OP, 0))) \
|| (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \ || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \
&& (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (OP, 0)))) \ && (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (OP, 0)))) \
|| (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == CONST \ || ((GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == CONST \
&& GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \ && GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == SYMBOL_REF \ && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == SYMBOL_REF \
&& GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT) \ && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT) \
&& (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (XEXP (OP, 0), 0)))) && (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (XEXP (OP, 0), 0)))))
#define EXTRA_CONSTRAINT(OP, C) \ #define EXTRA_CONSTRAINT(OP, C) \
((C) == 'U' ? OK_FOR_U (OP) : 0) ((C) == 'U' ? OK_FOR_U (OP) : 0)
...@@ -958,7 +957,6 @@ struct rtx_def *function_arg(); ...@@ -958,7 +957,6 @@ struct rtx_def *function_arg();
/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
is a valid machine specific attribute for DECL. is a valid machine specific attribute for DECL.
The attributes in ATTRIBUTES have previously been assigned to DECL. */ The attributes in ATTRIBUTES have previously been assigned to DECL. */
extern int h8300_valid_machine_decl_attribute ();
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \ #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS) h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
...@@ -1019,7 +1017,7 @@ h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS) ...@@ -1019,7 +1017,7 @@ h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
/* Control the assembler format that we output. */ /* Control the assembler format that we output. */
#define ASM_IDENTIFY_GCC /* nothing */ #define ASM_IDENTIFY_GCC(FILE) /* nothing */
/* Output at beginning/end of assembler file. */ /* Output at beginning/end of assembler file. */
...@@ -1384,7 +1382,6 @@ do { char dstr[30]; \ ...@@ -1384,7 +1382,6 @@ do { char dstr[30]; \
it should be pointing at the last character after the end of the pragma it should be pointing at the last character after the end of the pragma
(newline or end-of-file). */ (newline or end-of-file). */
#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME) #define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
extern int handle_pragma ();
#define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop) #define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)
...@@ -1418,9 +1415,3 @@ extern int handle_pragma (); ...@@ -1418,9 +1415,3 @@ extern int handle_pragma ();
#define MOVE_RATIO 3 #define MOVE_RATIO 3
/* Declarations for functions used in insn-output.c. */
char *emit_a_shift ();
int h8300_funcvec_function_p ();
char *output_adds_subs ();
char * output_simode_bld ();
;; GCC machine description for Hitachi H8/300 ;; GCC machine description for Hitachi H8/300
;; Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc.
;; Contributed by Steve Chamberlain (sac@cygnus.com), ;; Contributed by Steve Chamberlain (sac@cygnus.com),
;; Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). ;; Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
...@@ -335,6 +335,8 @@ ...@@ -335,6 +335,8 @@
return \"mov.w %f1,%T0\;mov.w %e1,%T0\"; return \"mov.w %f1,%T0\;mov.w %e1,%T0\";
case 5: case 5:
return \"mov.w %T1,%e0\;mov.w %T1,%f0\"; return \"mov.w %T1,%e0\;mov.w %T1,%f0\";
default:
abort();
} }
}" }"
[(set_attr "length" "4,4,8,8,4,4") [(set_attr "length" "4,4,8,8,4,4")
...@@ -393,7 +395,8 @@ ...@@ -393,7 +395,8 @@
return \"mov.w %f1,%T0\;mov.w %e1,%T0\"; return \"mov.w %f1,%T0\;mov.w %e1,%T0\";
case 5: case 5:
return \"mov.w %T1,%e0\;mov.w %T1,%f0\"; return \"mov.w %T1,%e0\;mov.w %T1,%f0\";
default:
abort();
} }
}" }"
[(set_attr "length" "4,4,8,8,4,4") [(set_attr "length" "4,4,8,8,4,4")
......
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