Commit 69985118 by Kaveh R. Ghazi Committed by Kaveh Ghazi

dsp16xx-protos.h: New file.

	* dsp16xx-protos.h: New file.

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

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

	* dsp16xx.md: Likewise.

From-SVN: r31416
parent 6b995286
2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* dsp16xx-protos.h: New file.
* dsp16xx.c: Include tm_p.h. Add static prototypes. Fix compile
time warnings.
* dsp16xx.h: Move prototypes to dsp16xx-protos.h. Fix compile time
warnings.
* dsp16xx.md: Likewise.
2000-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* convex-protos.h: New file. * convex-protos.h: New file.
* convex.c: Include tm_p.h. Add static prototypes. Fix compile * convex.c: Include tm_p.h. Add static prototypes. Fix compile
......
/* Definitions of target machine for GNU compiler. AT&T DSP1600.
Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Michael Collison (collison@world.std.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 1, 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. */
#ifdef RTX_CODE
extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx));
extern int call_address_operand PARAMS ((rtx, enum machine_mode));
extern int arith_reg_operand PARAMS ((rtx, enum machine_mode));
extern int symbolic_address_operand PARAMS ((rtx, enum machine_mode));
extern int Y_address_operand PARAMS ((rtx, enum machine_mode));
extern int sp_operand PARAMS ((rtx, enum machine_mode));
extern int sp_operand2 PARAMS ((rtx, enum machine_mode));
extern int nonmemory_arith_operand PARAMS ((rtx, enum machine_mode));
extern int dsp16xx_comparison_operator PARAMS ((rtx, enum machine_mode));
extern void notice_update_cc PARAMS ((rtx));
extern void double_reg_from_memory PARAMS ((rtx[]));
extern void double_reg_to_memory PARAMS ((rtx[]));
extern enum rtx_code next_cc_user_code PARAMS ((rtx));
extern int next_cc_user_unsigned PARAMS ((rtx));
extern struct rtx_def *gen_tst_reg PARAMS ((rtx));
extern const char *output_block_move PARAMS ((rtx[]));
extern enum reg_class preferred_reload_class PARAMS ((rtx, enum reg_class));
extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
enum machine_mode, rtx));
extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern void output_dsp16xx_float_const PARAMS ((rtx *));
extern void emit_1600_core_shift PARAMS ((enum rtx_code, rtx *, int));
extern int dsp16xx_address_cost PARAMS ((rtx));
extern int symbolic_address_p PARAMS ((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern struct rtx_def *dsp16xx_function_arg PARAMS ((CUMULATIVE_ARGS,
enum machine_mode,
tree, int));
extern void dsp16xx_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
enum machine_mode,
tree, int));
#endif /* TREE_CODE */
extern void dsp16xx_invalid_register_for_compare PARAMS ((void));
extern int class_max_nregs PARAMS ((enum reg_class, enum machine_mode));
extern enum reg_class limit_reload_class PARAMS ((enum reg_class, enum machine_mode));
extern int dsp16xx_register_move_cost PARAMS ((enum reg_class, enum reg_class));
extern int dsp16xx_makes_calls PARAMS ((void));
extern long compute_frame_size PARAMS ((int));
extern int dsp16xx_call_saved_register PARAMS ((int));
extern int dsp16xx_call_saved_register PARAMS ((int));
extern void init_emulation_routines PARAMS ((void));
extern int ybase_regs_ever_used PARAMS ((void));
extern void override_options PARAMS ((void));
extern int dsp16xx_starting_frame_offset PARAMS ((void));
extern int initial_frame_pointer_offset PARAMS ((void));
extern void asm_output_common PARAMS ((FILE *, const char *, int, int));
extern void asm_output_local PARAMS ((FILE *, const char *, int, int));
extern void asm_output_float PARAMS ((FILE *, double));
extern void asm_output_long PARAMS ((FILE *, long));
extern void dsp16xx_file_start PARAMS ((void));
extern struct rtx_def *(*dsp16xx_compare_gen) PARAMS (());
extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
extern enum reg_class dsp16xx_reg_class_from_letter PARAMS ((int));
extern int regno_reg_class PARAMS ((int));
extern void function_prologue PARAMS ((FILE *, int));
extern void function_epilogue PARAMS ((FILE *, int));
...@@ -36,18 +36,21 @@ Boston, MA 02111-1307, USA. */ ...@@ -36,18 +36,21 @@ Boston, MA 02111-1307, USA. */
#include "function.h" #include "function.h"
#include "flags.h" #include "flags.h"
#include "ggc.h" #include "ggc.h"
#include "toplev.h"
char *text_seg_name; #include "recog.h"
char *rsect_text; #include "tm_p.h"
char *data_seg_name;
char *rsect_data; const char *text_seg_name;
char *bss_seg_name; const char *rsect_text;
char *rsect_bss; const char *data_seg_name;
char *const_seg_name; const char *rsect_data;
char *rsect_const; const char *bss_seg_name;
const char *rsect_bss;
char *chip_name; const char *const_seg_name;
char *save_chip_name; const char *rsect_const;
const char *chip_name;
const char *save_chip_name;
/* Save the operands of a compare. The 16xx has not lt or gt, so /* Save the operands of a compare. The 16xx has not lt or gt, so
in these cases we swap the operands and reverse the condition */ in these cases we swap the operands and reverse the condition */
...@@ -56,10 +59,10 @@ rtx dsp16xx_compare_op0; ...@@ -56,10 +59,10 @@ rtx dsp16xx_compare_op0;
rtx dsp16xx_compare_op1; rtx dsp16xx_compare_op1;
struct rtx_def *(*dsp16xx_compare_gen)(); struct rtx_def *(*dsp16xx_compare_gen)();
static char *fp; static const char *fp;
static char *sp; static const char *sp;
static char *rr; static const char *rr;
static char *a1h; static const char *a1h;
struct dsp16xx_frame_info current_frame_info; struct dsp16xx_frame_info current_frame_info;
struct dsp16xx_frame_info zero_frame_info; struct dsp16xx_frame_info zero_frame_info;
...@@ -87,14 +90,14 @@ rtx dsp16xx_ashlhi3_libcall = (rtx) 0; ...@@ -87,14 +90,14 @@ rtx dsp16xx_ashlhi3_libcall = (rtx) 0;
rtx dsp16xx_ucmphi2_libcall = (rtx) 0; rtx dsp16xx_ucmphi2_libcall = (rtx) 0;
rtx dsp16xx_lshrhi3_libcall = (rtx) 0; rtx dsp16xx_lshrhi3_libcall = (rtx) 0;
char *himode_reg_name[] = HIMODE_REGISTER_NAMES; static const char *const himode_reg_name[] = HIMODE_REGISTER_NAMES;
#define SHIFT_INDEX_1 0 #define SHIFT_INDEX_1 0
#define SHIFT_INDEX_4 1 #define SHIFT_INDEX_4 1
#define SHIFT_INDEX_8 2 #define SHIFT_INDEX_8 2
#define SHIFT_INDEX_16 3 #define SHIFT_INDEX_16 3
static char *ashift_right_asm[] = static const char *const ashift_right_asm[] =
{ {
"%0=%0>>1", "%0=%0>>1",
"%0=%0>>4", "%0=%0>>4",
...@@ -102,7 +105,7 @@ static char *ashift_right_asm[] = ...@@ -102,7 +105,7 @@ static char *ashift_right_asm[] =
"%0=%0>>16" "%0=%0>>16"
}; };
static char *ashift_right_asm_first[] = static const char *const ashift_right_asm_first[] =
{ {
"%0=%1>>1", "%0=%1>>1",
"%0=%1>>4", "%0=%1>>4",
...@@ -110,7 +113,7 @@ static char *ashift_right_asm_first[] = ...@@ -110,7 +113,7 @@ static char *ashift_right_asm_first[] =
"%0=%1>>16" "%0=%1>>16"
}; };
static char *ashift_left_asm[] = static const char *const ashift_left_asm[] =
{ {
"%0=%0<<1", "%0=%0<<1",
"%0=%0<<4", "%0=%0<<4",
...@@ -118,7 +121,7 @@ static char *ashift_left_asm[] = ...@@ -118,7 +121,7 @@ static char *ashift_left_asm[] =
"%0=%0<<16" "%0=%0<<16"
}; };
static char *ashift_left_asm_first[] = static const char *const ashift_left_asm_first[] =
{ {
"%0=%1<<1", "%0=%1<<1",
"%0=%1<<4", "%0=%1<<4",
...@@ -126,7 +129,7 @@ static char *ashift_left_asm_first[] = ...@@ -126,7 +129,7 @@ static char *ashift_left_asm_first[] =
"%0=%1<<16" "%0=%1<<16"
}; };
static char *lshift_right_asm[] = static const char *const lshift_right_asm[] =
{ {
"%0=%0>>1\n\t%0=%b0&0x7fff", "%0=%0>>1\n\t%0=%b0&0x7fff",
"%0=%0>>4\n\t%0=%b0&0x0fff", "%0=%0>>4\n\t%0=%b0&0x0fff",
...@@ -134,7 +137,7 @@ static char *lshift_right_asm[] = ...@@ -134,7 +137,7 @@ static char *lshift_right_asm[] =
"%0=%0>>16\n\t%0=%b0&0x0000" "%0=%0>>16\n\t%0=%b0&0x0000"
}; };
static char *lshift_right_asm_first[] = static const char *const lshift_right_asm_first[] =
{ {
"%0=%1>>1\n\t%0=%b0&0x7fff", "%0=%1>>1\n\t%0=%b0&0x7fff",
"%0=%1>>4\n\t%0=%b0&0x0fff", "%0=%1>>4\n\t%0=%b0&0x0fff",
...@@ -142,10 +145,12 @@ static char *lshift_right_asm_first[] = ...@@ -142,10 +145,12 @@ static char *lshift_right_asm_first[] =
"%0=%1>>16\n\t%0=%b0&0x0000" "%0=%1>>16\n\t%0=%b0&0x0000"
}; };
static int reg_save_size PARAMS ((void));
int int
hard_regno_mode_ok (regno, mode) hard_regno_mode_ok (regno, mode)
int regno; int regno;
enum machine_mode mode; enum machine_mode mode;
{ {
switch ((int) mode) switch ((int) mode)
{ {
...@@ -186,7 +191,7 @@ enum machine_mode mode; ...@@ -186,7 +191,7 @@ enum machine_mode mode;
enum reg_class enum reg_class
dsp16xx_reg_class_from_letter (c) dsp16xx_reg_class_from_letter (c)
int c; int c;
{ {
switch (c) switch (c)
{ {
...@@ -272,7 +277,7 @@ int c; ...@@ -272,7 +277,7 @@ int c;
int int
regno_reg_class(regno) regno_reg_class(regno)
int regno; int regno;
{ {
switch (regno) switch (regno)
{ {
...@@ -345,16 +350,16 @@ int regno; ...@@ -345,16 +350,16 @@ int regno;
int int
class_max_nregs(class, mode) class_max_nregs(class, mode)
enum reg_class class; enum reg_class class ATTRIBUTE_UNUSED;
enum machine_mode mode; enum machine_mode mode;
{ {
return (GET_MODE_SIZE(mode)); return (GET_MODE_SIZE(mode));
} }
enum reg_class enum reg_class
limit_reload_class (mode, class) limit_reload_class (mode, class)
enum machine_mode mode; enum machine_mode mode;
enum reg_class class; enum reg_class class;
{ {
switch ((int) class) switch ((int) class)
{ {
...@@ -551,7 +556,7 @@ enum reg_class class; ...@@ -551,7 +556,7 @@ enum reg_class class;
int int
dsp16xx_register_move_cost (from, to) dsp16xx_register_move_cost (from, to)
enum reg_class from, to; enum reg_class from, to;
{ {
#if 0 #if 0
if (from == NO_REGS || to == NO_REGS || (from == to)) if (from == NO_REGS || to == NO_REGS || (from == to))
...@@ -870,15 +875,15 @@ secondary_reload_class (class, mode, in) ...@@ -870,15 +875,15 @@ secondary_reload_class (class, mode, in)
int int
symbolic_address_operand (op, mode) symbolic_address_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (symbolic_address_p (op)); return (symbolic_address_p (op));
} }
int symbolic_address_p (op) int
rtx op; symbolic_address_p (op)
rtx op;
{ {
switch (GET_CODE (op)) switch (GET_CODE (op))
{ {
...@@ -904,16 +909,16 @@ rtx op; ...@@ -904,16 +909,16 @@ rtx op;
int int
Y_address_operand (op, mode) Y_address_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
return (memory_address_p (mode, op) && !symbolic_address_p (op)); return (memory_address_p (mode, op) && !symbolic_address_p (op));
} }
int int
sp_operand (op, mode) sp_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return (GET_CODE (op) == PLUS return (GET_CODE (op) == PLUS
&& (XEXP (op, 0) == stack_pointer_rtx && (XEXP (op, 0) == stack_pointer_rtx
...@@ -923,8 +928,8 @@ enum machine_mode mode; ...@@ -923,8 +928,8 @@ enum machine_mode mode;
int int
sp_operand2 (op, mode) sp_operand2 (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if ((GET_CODE (op) == PLUS if ((GET_CODE (op) == PLUS
&& (XEXP (op, 0) == stack_pointer_rtx && (XEXP (op, 0) == stack_pointer_rtx
...@@ -944,16 +949,16 @@ enum machine_mode mode; ...@@ -944,16 +949,16 @@ enum machine_mode mode;
int int
nonmemory_arith_operand (op, mode) nonmemory_arith_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
return (immediate_operand (op, mode) || arith_reg_operand (op, mode)); return (immediate_operand (op, mode) || arith_reg_operand (op, mode));
} }
int int
arith_reg_operand (op, mode) arith_reg_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
return (register_operand (op, mode) return (register_operand (op, mode)
&& (GET_CODE (op) != REG && (GET_CODE (op) != REG
...@@ -964,8 +969,8 @@ enum machine_mode mode; ...@@ -964,8 +969,8 @@ enum machine_mode mode;
int int
call_address_operand (op, mode) call_address_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (symbolic_address_p (op) || REG_P(op)) if (symbolic_address_p (op) || REG_P(op))
{ {
...@@ -988,7 +993,7 @@ dsp16xx_comparison_operator (op, mode) ...@@ -988,7 +993,7 @@ dsp16xx_comparison_operator (op, mode)
void void
notice_update_cc(exp) notice_update_cc(exp)
rtx exp; rtx exp;
{ {
if (GET_CODE (exp) == SET) if (GET_CODE (exp) == SET)
{ {
...@@ -1104,8 +1109,9 @@ dsp16xx_makes_calls () ...@@ -1104,8 +1109,9 @@ dsp16xx_makes_calls ()
return 0; return 0;
} }
long compute_frame_size (size) long
int size; compute_frame_size (size)
int size;
{ {
long total_size; long total_size;
long var_size; long var_size;
...@@ -1144,7 +1150,7 @@ int size; ...@@ -1144,7 +1150,7 @@ int size;
int int
dsp16xx_call_saved_register (regno) dsp16xx_call_saved_register (regno)
int regno; int regno;
{ {
return (regs_ever_live[regno] && !call_used_regs[regno] && return (regs_ever_live[regno] && !call_used_regs[regno] &&
!IS_YBASE_REGISTER_WINDOW(regno)); !IS_YBASE_REGISTER_WINDOW(regno));
...@@ -1169,8 +1175,8 @@ ybase_regs_ever_used () ...@@ -1169,8 +1175,8 @@ ybase_regs_ever_used ()
void void
function_prologue (file, size) function_prologue (file, size)
FILE *file; FILE *file;
int size; int size;
{ {
int regno; int regno;
long total_size; long total_size;
...@@ -1182,14 +1188,14 @@ int size; ...@@ -1182,14 +1188,14 @@ int size;
total_size = compute_frame_size (size); total_size = compute_frame_size (size);
fprintf( file, "\t/* FUNCTION PROLOGUE: */\n" ); fprintf( file, "\t/* FUNCTION PROLOGUE: */\n" );
fprintf (file, "\t/* total=%d, vars= %d, regs= %d, args=%d, extra= %d */\n", fprintf (file, "\t/* total=%ld, vars= %ld, regs= %d, args=%d, extra= %ld */\n",
current_frame_info.total_size, current_frame_info.total_size,
current_frame_info.var_size, current_frame_info.var_size,
current_frame_info.reg_size, current_frame_info.reg_size,
current_function_outgoing_args_size, current_function_outgoing_args_size,
current_frame_info.extra_size); current_frame_info.extra_size);
fprintf (file, "\t/* fp save offset= %d, sp save_offset= %d */\n\n", fprintf (file, "\t/* fp save offset= %ld, sp save_offset= %ld */\n\n",
current_frame_info.fp_save_offset, current_frame_info.fp_save_offset,
current_frame_info.sp_save_offset); current_frame_info.sp_save_offset);
/* Set up the 'ybase' register window. */ /* Set up the 'ybase' register window. */
...@@ -1217,7 +1223,7 @@ int size; ...@@ -1217,7 +1223,7 @@ int size;
else else
{ {
if(SMALL_INTVAL(current_frame_info.var_size) && ((current_frame_info.var_size & 0x8000) == 0)) if(SMALL_INTVAL(current_frame_info.var_size) && ((current_frame_info.var_size & 0x8000) == 0))
fprintf (file, "\t%s=%d\n\t*%s++%s\n", reg_names[REG_J], current_frame_info.var_size, sp, reg_names[REG_J]); fprintf (file, "\t%s=%ld\n\t*%s++%s\n", reg_names[REG_J], current_frame_info.var_size, sp, reg_names[REG_J]);
else else
fatal ("Stack size > 32k"); fatal ("Stack size > 32k");
} }
...@@ -1244,7 +1250,7 @@ int size; ...@@ -1244,7 +1250,7 @@ int size;
else else
{ {
if(SMALL_INTVAL(current_frame_info.args_size) && ((current_frame_info.args_size & 0x8000) == 0)) if(SMALL_INTVAL(current_frame_info.args_size) && ((current_frame_info.args_size & 0x8000) == 0))
fprintf (file, "\t%s=%d\n\t*%s++%s\n", reg_names[REG_J], current_frame_info.args_size, sp, reg_names[REG_J]); fprintf (file, "\t%s=%ld\n\t*%s++%s\n", reg_names[REG_J], current_frame_info.args_size, sp, reg_names[REG_J]);
else else
fatal ("Stack size > 32k"); fatal ("Stack size > 32k");
} }
...@@ -1254,7 +1260,7 @@ int size; ...@@ -1254,7 +1260,7 @@ int size;
{ {
fprintf( file, "\t%s=%s\n", a1h, sp ); fprintf( file, "\t%s=%s\n", a1h, sp );
fprintf( file, "\t%s=%s\n", fp, a1h ); /* Establish new base frame */ fprintf( file, "\t%s=%s\n", fp, a1h ); /* Establish new base frame */
fprintf( file, "\t%s=%d\n", reg_names[REG_J], -total_size); fprintf( file, "\t%s=%ld\n", reg_names[REG_J], -total_size);
fprintf( file, "\t*%s++%s\n", fp, reg_names[REG_J]); fprintf( file, "\t*%s++%s\n", fp, reg_names[REG_J]);
} }
...@@ -1290,11 +1296,13 @@ init_emulation_routines () ...@@ -1290,11 +1296,13 @@ init_emulation_routines ()
} }
void void
function_epilogue (file, size) function_epilogue (file, size)
FILE *file; FILE *file;
int size; int size ATTRIBUTE_UNUSED;
{ {
int regno; int regno;
#if OLD_REGISTER_SAVE
int initial_stack_dec = 0; int initial_stack_dec = 0;
#endif
fp = reg_names[FRAME_POINTER_REGNUM]; fp = reg_names[FRAME_POINTER_REGNUM];
sp = reg_names[STACK_POINTER_REGNUM]; sp = reg_names[STACK_POINTER_REGNUM];
...@@ -1309,7 +1317,7 @@ int size; ...@@ -1309,7 +1317,7 @@ int size;
fprintf (file, "\t*%s--\n", sp); fprintf (file, "\t*%s--\n", sp);
else else
{ {
fprintf (file, "\t%s=%d\n\t*%s++%s\n", fprintf (file, "\t%s=%ld\n\t*%s++%s\n",
reg_names[REG_J], -current_frame_info.args_size, sp, reg_names[REG_J]); reg_names[REG_J], -current_frame_info.args_size, sp, reg_names[REG_J]);
} }
} }
...@@ -1356,7 +1364,7 @@ int size; ...@@ -1356,7 +1364,7 @@ int size;
fprintf (file, "\t*%s--\n", sp); fprintf (file, "\t*%s--\n", sp);
else else
{ {
fprintf (file, "\t%s=%d\n\t*%s++%s\n", fprintf (file, "\t%s=%ld\n\t*%s++%s\n",
reg_names[REG_J], -current_frame_info.var_size, sp, reg_names[REG_J]); reg_names[REG_J], -current_frame_info.var_size, sp, reg_names[REG_J]);
} }
} }
...@@ -1391,7 +1399,7 @@ emit_move_sequence (operands, mode) ...@@ -1391,7 +1399,7 @@ emit_move_sequence (operands, mode)
void void
double_reg_from_memory (operands) double_reg_from_memory (operands)
rtx operands[]; rtx operands[];
{ {
rtx xoperands[4]; rtx xoperands[4];
...@@ -1412,7 +1420,6 @@ rtx operands[]; ...@@ -1412,7 +1420,6 @@ rtx operands[];
else if (GET_CODE(XEXP(operands[1],0)) == PLUS) else if (GET_CODE(XEXP(operands[1],0)) == PLUS)
{ {
rtx addr; rtx addr;
rtx base;
int offset; int offset;
output_asm_insn ("%u0=%1", operands); output_asm_insn ("%u0=%1", operands);
...@@ -1440,7 +1447,7 @@ rtx operands[]; ...@@ -1440,7 +1447,7 @@ rtx operands[];
void void
double_reg_to_memory (operands) double_reg_to_memory (operands)
rtx operands[]; rtx operands[];
{ {
rtx xoperands[4]; rtx xoperands[4];
...@@ -1491,6 +1498,8 @@ rtx operands[]; ...@@ -1491,6 +1498,8 @@ rtx operands[];
void void
override_options () override_options ()
{ {
char *tmp;
if (chip_name == (char *) 0) if (chip_name == (char *) 0)
chip_name = DEFAULT_CHIP_NAME; chip_name = DEFAULT_CHIP_NAME;
...@@ -1508,19 +1517,21 @@ override_options () ...@@ -1508,19 +1517,21 @@ override_options ()
save_chip_name = xstrdup (chip_name); save_chip_name = xstrdup (chip_name);
rsect_text = (char *) xmalloc (strlen(".rsect ") + rsect_text = tmp = (char *) xmalloc (strlen(".rsect ") +
strlen(text_seg_name) + 3); strlen(text_seg_name) + 3);
rsect_data = (char *) xmalloc (strlen(".rsect ") + sprintf (tmp, ".rsect \"%s\"", text_seg_name);
strlen(data_seg_name) + 3);
rsect_bss = (char *) xmalloc (strlen(".rsect ") + rsect_data = tmp = (char *) xmalloc (strlen(".rsect ") +
strlen(bss_seg_name) + 3); strlen(data_seg_name) + 3);
rsect_const = (char *) xmalloc (strlen(".rsect ") + sprintf (tmp, ".rsect \"%s\"", data_seg_name);
strlen(const_seg_name) + 3);
rsect_bss = tmp = (char *) xmalloc (strlen(".rsect ") +
sprintf (rsect_text, ".rsect \"%s\"", text_seg_name); strlen(bss_seg_name) + 3);
sprintf (rsect_data, ".rsect \"%s\"", data_seg_name); sprintf (tmp, ".rsect \"%s\"", bss_seg_name);
sprintf (rsect_bss, ".rsect \"%s\"", bss_seg_name);
sprintf (rsect_const, ".rsect \"%s\"", const_seg_name); rsect_const = tmp = (char *) xmalloc (strlen(".rsect ") +
strlen(const_seg_name) + 3);
sprintf (tmp, ".rsect \"%s\"", const_seg_name);
if (optimize) if (optimize)
{ {
...@@ -1558,7 +1569,7 @@ override_options () ...@@ -1558,7 +1569,7 @@ override_options ()
enum rtx_code enum rtx_code
next_cc_user_code (insn) next_cc_user_code (insn)
rtx insn; rtx insn;
{ {
if ( !(insn = next_cc0_user (insn))) if ( !(insn = next_cc0_user (insn)))
abort (); abort ();
...@@ -1592,9 +1603,9 @@ next_cc_user_unsigned (insn) ...@@ -1592,9 +1603,9 @@ next_cc_user_unsigned (insn)
void void
print_operand(file, op, letter) print_operand(file, op, letter)
FILE *file; FILE *file;
rtx op; rtx op;
int letter; int letter;
{ {
enum rtx_code code; enum rtx_code code;
...@@ -1688,8 +1699,8 @@ int letter; ...@@ -1688,8 +1699,8 @@ int letter;
void void
print_operand_address(file, addr) print_operand_address(file, addr)
FILE *file; FILE *file;
rtx addr; rtx addr;
{ {
rtx base; rtx base;
int offset; int offset;
...@@ -1733,9 +1744,8 @@ rtx addr; ...@@ -1733,9 +1744,8 @@ rtx addr;
void void
output_dsp16xx_float_const(operands) output_dsp16xx_float_const(operands)
rtx *operands; rtx *operands;
{ {
rtx dst = operands[0];
rtx src = operands[1]; rtx src = operands[1];
#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT #if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
...@@ -1752,7 +1762,7 @@ rtx *operands; ...@@ -1752,7 +1762,7 @@ rtx *operands;
#endif #endif
} }
int static int
reg_save_size () reg_save_size ()
{ {
int reg_save_size = 0; int reg_save_size = 0;
...@@ -1785,8 +1795,6 @@ dsp16xx_starting_frame_offset() ...@@ -1785,8 +1795,6 @@ dsp16xx_starting_frame_offset()
int int
initial_frame_pointer_offset() initial_frame_pointer_offset()
{ {
int frame_size;
int regno;
int offset = 0; int offset = 0;
offset = compute_frame_size (get_frame_size()); offset = compute_frame_size (get_frame_size());
...@@ -1804,10 +1812,10 @@ initial_frame_pointer_offset() ...@@ -1804,10 +1812,10 @@ initial_frame_pointer_offset()
#if 0 #if 0
void void
emit_1600_core_shift (shift_op, operands, shift_amount, mode) emit_1600_core_shift (shift_op, operands, shift_amount, mode)
enum rtx_code shift_op; enum rtx_code shift_op;
rtx *operands; rtx *operands;
int shift_amount; int shift_amount;
enum machine_mode mode; enum machine_mode mode;
{ {
int quotient; int quotient;
int i; int i;
...@@ -1868,15 +1876,15 @@ enum machine_mode mode; ...@@ -1868,15 +1876,15 @@ enum machine_mode mode;
#else #else
void void
emit_1600_core_shift (shift_op, operands, shift_amount) emit_1600_core_shift (shift_op, operands, shift_amount)
enum rtx_code shift_op; enum rtx_code shift_op;
rtx *operands; rtx *operands;
int shift_amount; int shift_amount;
{ {
int quotient; int quotient;
int i; int i;
int first_shift_emitted = 0; int first_shift_emitted = 0;
char **shift_asm_ptr; const char * const *shift_asm_ptr;
char **shift_asm_ptr_first; const char * const *shift_asm_ptr_first;
if (shift_op == ASHIFT) if (shift_op == ASHIFT)
{ {
...@@ -1938,11 +1946,11 @@ int shift_amount; ...@@ -1938,11 +1946,11 @@ int shift_amount;
} }
#endif #endif
void void
asm_output_common(file, name, size, rounded) asm_output_common(file, name, size, rounded)
FILE *file; FILE *file;
char *name; const char *name;
int size; int size ATTRIBUTE_UNUSED;
int rounded; int rounded;
{ {
bss_section (); bss_section ();
ASM_GLOBALIZE_LABEL (file, name); ASM_GLOBALIZE_LABEL (file, name);
...@@ -1956,10 +1964,10 @@ int rounded; ...@@ -1956,10 +1964,10 @@ int rounded;
void void
asm_output_local(file, name, size, rounded) asm_output_local(file, name, size, rounded)
FILE *file; FILE *file;
char *name; const char *name;
int size; int size ATTRIBUTE_UNUSED;
int rounded; int rounded;
{ {
bss_section (); bss_section ();
assemble_name (file, name); assemble_name (file, name);
...@@ -1972,8 +1980,8 @@ int rounded; ...@@ -1972,8 +1980,8 @@ int rounded;
void void
asm_output_float (file, fp_const) asm_output_float (file, fp_const)
FILE *file; FILE *file;
double fp_const; double fp_const;
{ {
#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT #if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
REAL_VALUE_TYPE d = fp_const; REAL_VALUE_TYPE d = fp_const;
...@@ -1982,9 +1990,9 @@ double fp_const; ...@@ -1982,9 +1990,9 @@ double fp_const;
REAL_VALUE_TO_TARGET_SINGLE (d, value); REAL_VALUE_TO_TARGET_SINGLE (d, value);
fputs ("\tint ", file); fputs ("\tint ", file);
#ifdef WORDS_BIG_ENDIAN #ifdef WORDS_BIG_ENDIAN
fprintf (file, "0x%-4.4x, 0x%-4.4x", (value >> 16) & 0xffff, (value & 0xffff)); fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value >> 16) & 0xffff, (value & 0xffff));
#else #else
fprintf (file, "0x%-4.4x, 0x%-4.4x", (value & 0xffff), (value >> 16) & 0xffff); fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value & 0xffff), (value >> 16) & 0xffff);
#endif #endif
fputs ("\n", file); fputs ("\n", file);
#else #else
...@@ -1994,21 +2002,21 @@ double fp_const; ...@@ -1994,21 +2002,21 @@ double fp_const;
void void
asm_output_long (file, value) asm_output_long (file, value)
FILE *file; FILE *file;
long value; long value;
{ {
fputs ("\tint ", file); fputs ("\tint ", file);
#ifdef WORDS_BIG_ENDIAN #ifdef WORDS_BIG_ENDIAN
fprintf (file, "0x%-4.4x, 0x%-4.4x", (value >> 16) & 0xffff, (value & 0xffff)); fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value >> 16) & 0xffff, (value & 0xffff));
#else #else
fprintf (file, "0x%-4.4x, 0x%-4.4x", (value & 0xffff), (value >> 16) & 0xffff); fprintf (file, "0x%-4.4lx, 0x%-4.4lx", (value & 0xffff), (value >> 16) & 0xffff);
#endif #endif
fputs ("\n", file); fputs ("\n", file);
} }
int int
dsp16xx_address_cost (addr) dsp16xx_address_cost (addr)
rtx addr; rtx addr;
{ {
switch (GET_CODE (addr)) switch (GET_CODE (addr))
{ {
...@@ -2129,7 +2137,7 @@ dsp16xx_function_arg_advance (cum, mode, type, named) ...@@ -2129,7 +2137,7 @@ dsp16xx_function_arg_advance (cum, mode, type, named)
CUMULATIVE_ARGS *cum; /* current arg information */ CUMULATIVE_ARGS *cum; /* current arg information */
enum machine_mode mode; /* current arg mode */ enum machine_mode mode; /* current arg mode */
tree type; /* type of the argument or 0 if lib support */ tree type; /* type of the argument or 0 if lib support */
int named; /* whether or not the argument was named */ int named ATTRIBUTE_UNUSED;/* whether or not the argument was named */
{ {
if (TARGET_REGPARM) if (TARGET_REGPARM)
{ {
...@@ -2259,7 +2267,7 @@ gen_compare_reg (code, x, y) ...@@ -2259,7 +2267,7 @@ gen_compare_reg (code, x, y)
return cc0_rtx; return cc0_rtx;
} }
char * const char *
output_block_move (operands) output_block_move (operands)
rtx operands[]; rtx operands[];
{ {
......
...@@ -19,20 +19,18 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -19,20 +19,18 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern char *low_reg_names[]; extern const char *low_reg_names[];
extern char *text_seg_name; extern const char *text_seg_name;
extern char *rsect_text; extern const char *rsect_text;
extern char *data_seg_name; extern const char *data_seg_name;
extern char *rsect_data; extern const char *rsect_data;
extern char *bss_seg_name; extern const char *bss_seg_name;
extern char *rsect_bss; extern const char *rsect_bss;
extern char *const_seg_name; extern const char *const_seg_name;
extern char *rsect_const; extern const char *rsect_const;
extern char *chip_name; extern const char *chip_name;
extern char *save_chip_name; extern const char *save_chip_name;
extern struct rtx_def *dsp16xx_compare_op0, *dsp16xx_compare_op1; extern struct rtx_def *dsp16xx_compare_op0, *dsp16xx_compare_op1;
extern struct rtx_def *(*dsp16xx_compare_gen)();
extern struct rtx_def *gen_compare_reg();
extern struct rtx_def *dsp16xx_addhf3_libcall; extern struct rtx_def *dsp16xx_addhf3_libcall;
extern struct rtx_def *dsp16xx_subhf3_libcall; extern struct rtx_def *dsp16xx_subhf3_libcall;
extern struct rtx_def *dsp16xx_mulhf3_libcall; extern struct rtx_def *dsp16xx_mulhf3_libcall;
...@@ -56,29 +54,6 @@ extern struct rtx_def *dsp16xx_ashrhi3_libcall; ...@@ -56,29 +54,6 @@ extern struct rtx_def *dsp16xx_ashrhi3_libcall;
extern struct rtx_def *dsp16xx_ashlhi3_libcall; extern struct rtx_def *dsp16xx_ashlhi3_libcall;
extern struct rtx_def *dsp16xx_lshrhi3_libcall; extern struct rtx_def *dsp16xx_lshrhi3_libcall;
extern int hard_regno_mode_ok ();
extern enum reg_class dsp16xx_reg_class_from_letter ();
extern enum reg_class dsp16xx_limit_reload_class ();
extern int hard_regno_nregs ();
extern int regno_reg_class ();
extern int move_operand ();
extern int symbolic_address_p ();
extern int Y_address ();
extern int call_address_operand ();
extern void notice_update_cc();
extern void function_prologue ();
extern void function_epilogue ();
extern int dsp1600_comparison_reverse ();
extern void double_reg_from_memory ();
extern void double_reg_to_memory ();
extern struct rtx_def *dsp16xx_function_arg ();
extern void dsp16xx_function_arg_advance ();
extern enum rtx_code next_cc_user_code ();
extern int next_cc_user_unsigned ();
extern struct rtx_def *gen_tst_reg ();
extern char *output_block_move();
/* RUN-TIME TARGET SPECIFICATION */ /* RUN-TIME TARGET SPECIFICATION */
#define DSP16XX 1 #define DSP16XX 1
...@@ -1671,11 +1646,11 @@ const_section () \ ...@@ -1671,11 +1646,11 @@ const_section () \
#define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \ #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
do { \ do { \
FILE *_hide_asm_out_file = (MYFILE); \ FILE *_hide_asm_out_file = (MYFILE); \
unsigned char *_hide_p = (unsigned char *) (MYSTRING); \ const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
int _hide_thissize = (MYLENGTH); \ int _hide_thissize = (MYLENGTH); \
{ \ { \
FILE *asm_out_file = _hide_asm_out_file; \ FILE *asm_out_file = _hide_asm_out_file; \
unsigned char *p = _hide_p; \ const unsigned char *p = _hide_p; \
int thissize = _hide_thissize; \ int thissize = _hide_thissize; \
int i; \ int i; \
\ \
...@@ -1970,4 +1945,3 @@ const_section () \ ...@@ -1970,4 +1945,3 @@ const_section () \
are not currently supporting c++. */ are not currently supporting c++. */
#define INIT_SECTION_ASM_OP 1 #define INIT_SECTION_ASM_OP 1
void dsp16xx_invalid_register_for_compare ();
...@@ -117,6 +117,8 @@ ...@@ -117,6 +117,8 @@
case 2: case 2:
return \"%0&%H1\"; return \"%0&%H1\";
default:
abort();
} }
}" }"
[(set_attr "type" "f3_alu,malu,f3_alu_i")]) [(set_attr "type" "f3_alu,malu,f3_alu_i")])
...@@ -405,6 +407,8 @@ ...@@ -405,6 +407,8 @@
case 7: case 7:
return \"%3=%2\;*%0++%3\"; return \"%3=%2\;*%0++%3\";
default:
abort();
} }
}") }")
...@@ -485,6 +489,8 @@ ...@@ -485,6 +489,8 @@
case 3: case 3:
case 4: case 4:
return \"%m0=%m1-%m2\"; return \"%m0=%m1-%m2\";
default:
abort();
} }
}") }")
...@@ -921,6 +927,8 @@ ...@@ -921,6 +927,8 @@
case 8: case 8:
case 9: case 9:
return \"\"; return \"\";
default:
abort();
} }
}" }"
[(set_attr "type" "move,move,load_i,load_i,load,store,load,store,move,move")]) [(set_attr "type" "move,move,load_i,load_i,load,store,load,store,move,move")])
...@@ -986,6 +994,8 @@ ...@@ -986,6 +994,8 @@
case 9: case 10: case 9: case 10:
return \"%0=%1\"; return \"%0=%1\";
default:
abort();
} }
}") }")
...@@ -1032,6 +1042,8 @@ ...@@ -1032,6 +1042,8 @@
case 9: case 10: case 9: case 10:
return \"%0=%1\"; return \"%0=%1\";
default:
abort();
} }
}") }")
...@@ -1187,6 +1199,8 @@ ...@@ -1187,6 +1199,8 @@
case 5: case 5:
case 6: case 6:
return \"%u0=%u1\;%w0=%w1\"; return \"%u0=%u1\;%w0=%w1\";
default:
abort();
} }
}" }"
[(set_attr "type" "move,move,load_i,load,store,load,store")]) [(set_attr "type" "move,move,load_i,load,store,load,store")])
......
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