Commit 13d516d9 by Kaveh R. Ghazi Committed by Kaveh Ghazi

romp-protos.h: New file.

        * romp-protos.h: New file.

        * romp.c: Fix compile time warnings.

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

        * romp.md: Likewise.

From-SVN: r31492
parent 253f1045
2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* romp-protos.h: New file.
* romp.c: Fix compile time warnings.
* romp.h: Move prototypes to romp-protos.h. Fix compile time
warnings.
* romp.md: Likewise.
2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* we32k-protos.h: New file. * we32k-protos.h: New file.
* we32k.c: Fix compile time warnings. * we32k.c: Fix compile time warnings.
......
/* Definitions of target machine for GNU compiler, for ROMP chip.
Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
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. */
#ifdef RTX_CODE
extern int next_insn_tests_no_unsigned PARAMS ((rtx));
extern void update_cc PARAMS ((rtx, rtx));
extern int restore_compare_p PARAMS ((rtx));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern rtx get_symref PARAMS ((const char *));
extern int check_precision PARAMS ((enum machine_mode, rtx, rtx));
extern const char *output_fpop PARAMS ((enum rtx_code, rtx, rtx, rtx, rtx));
extern int constant_pool_address_operand PARAMS ((rtx, enum machine_mode));
extern int romp_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int zero_memory_operand PARAMS ((rtx, enum machine_mode));
extern int short_memory_operand PARAMS ((rtx, enum machine_mode));
extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode));
extern int current_function_operand PARAMS ((rtx, enum machine_mode));
extern int constant_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_any_cint_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_D_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_add_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_and_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode));
extern int romp_operand PARAMS ((rtx, enum machine_mode));
extern int reg_0_operand PARAMS ((rtx, enum machine_mode));
extern int reg_15_operand PARAMS ((rtx, enum machine_mode));
extern int float_binary PARAMS ((rtx, enum machine_mode));
extern int float_unary PARAMS ((rtx, enum machine_mode));
extern int float_conversion PARAMS ((rtx, enum machine_mode));
#endif /* RTX_CODE */
extern int first_reg_to_save PARAMS ((void));
extern int romp_pushes_stack PARAMS ((void));
extern int romp_using_r14 PARAMS ((void));
extern int null_epilogue PARAMS ((void));
extern int romp_sa_size PARAMS ((void));
extern int romp_makes_calls PARAMS ((void));
extern void output_prolog PARAMS ((FILE *, int));
extern void output_encoded_offset PARAMS ((FILE *, unsigned));
extern void output_epilog PARAMS ((FILE *, int));
extern int romp_debugger_auto_correction PARAMS ((int));
extern int romp_debugger_arg_correction PARAMS ((int));
extern const char *output_in_line_mul PARAMS ((void));
/* Subroutines used for code generation on ROMP. /* Subroutines used for code generation on ROMP.
Copyright (C) 1990, 91, 92, 93, 97, 98, 1999 Free Software Foundation, Inc. Copyright (C) 1990, 91, 92, 93, 97-99, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu) Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -37,14 +37,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,14 +37,17 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h" #include "obstack.h"
#include "tree.h" #include "tree.h"
#include "function.h" #include "function.h"
#include "tm_p.h"
#define min(A,B) ((A) < (B) ? (A) : (B)) #define min(A,B) ((A) < (B) ? (A) : (B))
#define max(A,B) ((A) > (B) ? (A) : (B)) #define max(A,B) ((A) > (B) ? (A) : (B))
static int unsigned_comparisons_p (); static int unsigned_comparisons_p PARAMS ((rtx));
static void output_loadsave_fpregs (); static void output_loadsave_fpregs PARAMS ((FILE *, enum rtx_code, rtx));
static void output_fpops (); static void output_fpops PARAMS ((FILE *));
static void init_fpops (); static void init_fpops PARAMS ((void));
static int memory_offset_in_range_p PARAMS ((rtx, enum machine_mode, int, int));
static unsigned int hash_rtx PARAMS ((rtx));
/* Return 1 if the insn using CC0 set by INSN does not contain /* Return 1 if the insn using CC0 set by INSN does not contain
any unsigned tests applied to the condition codes. any unsigned tests applied to the condition codes.
...@@ -96,6 +99,8 @@ unsigned_comparisons_p (x) ...@@ -96,6 +99,8 @@ unsigned_comparisons_p (x)
case LEU: case LEU:
case GEU: case GEU:
return (XEXP (x, 0) == cc0_rtx || XEXP (x, 1) == cc0_rtx); return (XEXP (x, 0) == cc0_rtx || XEXP (x, 1) == cc0_rtx);
default:
break;
} }
len = GET_RTX_LENGTH (code); len = GET_RTX_LENGTH (code);
...@@ -126,8 +131,9 @@ unsigned_comparisons_p (x) ...@@ -126,8 +131,9 @@ unsigned_comparisons_p (x)
cc_state.value[12] refer to two possible values that might correspond cc_state.value[12] refer to two possible values that might correspond
to the CC. We only store register values. */ to the CC. We only store register values. */
void
update_cc (body, insn) update_cc (body, insn)
rtx body; rtx body ATTRIBUTE_UNUSED;
rtx insn; rtx insn;
{ {
switch (get_attr_cc (insn)) switch (get_attr_cc (insn))
...@@ -231,7 +237,7 @@ restore_compare_p (op) ...@@ -231,7 +237,7 @@ restore_compare_p (op)
/* Generate the (long) string corresponding to an inline multiply insn. /* Generate the (long) string corresponding to an inline multiply insn.
Note that `r10' does not refer to the register r10, but rather to the Note that `r10' does not refer to the register r10, but rather to the
SCR used as the MQ. */ SCR used as the MQ. */
char * const char *
output_in_line_mul () output_in_line_mul ()
{ {
static char insns[200]; static char insns[200];
...@@ -356,7 +362,7 @@ symbolic_memory_operand (op, mode) ...@@ -356,7 +362,7 @@ symbolic_memory_operand (op, mode)
int int
current_function_operand (op, mode) current_function_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (op) != MEM || GET_CODE (XEXP (op, 0)) != SYMBOL_REF if (GET_CODE (op) != MEM || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
|| ! CONSTANT_POOL_ADDRESS_P (XEXP (op, 0))) || ! CONSTANT_POOL_ADDRESS_P (XEXP (op, 0)))
...@@ -382,7 +388,7 @@ null_epilogue () ...@@ -382,7 +388,7 @@ null_epilogue ()
int int
constant_pool_address_operand (op, mode) constant_pool_address_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
return ((GET_CODE (op) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (op)) return ((GET_CODE (op) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (op))
|| (GET_CODE (op) == CONST && GET_CODE (XEXP (op, 0)) == PLUS || (GET_CODE (op) == CONST && GET_CODE (XEXP (op, 0)) == PLUS
...@@ -397,7 +403,7 @@ constant_pool_address_operand (op, mode) ...@@ -397,7 +403,7 @@ constant_pool_address_operand (op, mode)
int int
romp_symbolic_operand (op, mode) romp_symbolic_operand (op, mode)
register rtx op; register rtx op;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
switch (GET_CODE (op)) switch (GET_CODE (op))
{ {
...@@ -656,7 +662,7 @@ void ...@@ -656,7 +662,7 @@ void
print_operand (file, x, code) print_operand (file, x, code)
FILE *file; FILE *file;
rtx x; rtx x;
char code; int code;
{ {
int i; int i;
...@@ -1322,10 +1328,10 @@ static struct symref_hashent *symref_hash_table[SYMHASHSIZE]; ...@@ -1322,10 +1328,10 @@ static struct symref_hashent *symref_hash_table[SYMHASHSIZE];
the name string is allocated from the permanent obstack. */ the name string is allocated from the permanent obstack. */
rtx rtx
get_symref (name) get_symref (name)
register char *name; register const char *name;
{ {
extern struct obstack permanent_obstack; extern struct obstack permanent_obstack;
register char *sp = name; register const char *sp = name;
unsigned int hash = 0; unsigned int hash = 0;
struct symref_hashent *p, **last_p; struct symref_hashent *p, **last_p;
...@@ -1459,11 +1465,11 @@ hash_rtx (x) ...@@ -1459,11 +1465,11 @@ hash_rtx (x)
A new floating-point operation block is created if this operation has not A new floating-point operation block is created if this operation has not
been seen before. */ been seen before. */
char * const char *
output_fpop (code, op0, op1, op2, insn) output_fpop (code, op0, op1, op2, insn)
enum rtx_code code; enum rtx_code code;
rtx op0, op1, op2; rtx op0, op1, op2;
rtx insn; rtx insn ATTRIBUTE_UNUSED;
{ {
static char outbuf[40]; static char outbuf[40];
unsigned int hash, hash0, hash1, hash2; unsigned int hash, hash0, hash1, hash2;
...@@ -1832,7 +1838,7 @@ output_fpops (file) ...@@ -1832,7 +1838,7 @@ output_fpops (file)
{ {
register int type; register int type;
register int opbyte; register int opbyte;
register char *desc0; register const char *desc0;
char desc1[50]; char desc1[50];
immed[i] = 0; immed[i] = 0;
......
/* Definitions of target machine for GNU compiler, for ROMP chip. /* Definitions of target machine for GNU compiler, for ROMP chip.
Copyright (C) 1989, 91, 93, 95, 96, 98, 1999 Free Software Foundation, Inc. Copyright (C) 1989, 91, 93, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu) Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -325,8 +325,8 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS, ...@@ -325,8 +325,8 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS,
This is an initializer for a vector of HARD_REG_SET This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */ of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS {0, 0x00001, 0x08000, 0x1fffe, 0x1ffff, \ #define REG_CLASS_CONTENTS {{0}, {0x00001}, {0x08000}, {0x1fffe}, {0x1ffff}, \
0x1fe0000, 0x1ffffff } {0x1fe0000}, {0x1ffffff} }
/* The same information, inverted: /* The same information, inverted:
Return the class number of the smallest class containing Return the class number of the smallest class containing
...@@ -520,7 +520,7 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS, ...@@ -520,7 +520,7 @@ enum reg_class { NO_REGS, R0_REGS, R15_REGS, BASE_REGS, GENERAL_REGS,
#define FUNCTION_VALUE(VALTYPE, FUNC) \ #define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), \ gen_rtx_REG (TYPE_MODE (VALTYPE), \
(TARGET_FP_REG \ (TARGET_FP_REGS \
&& GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT) \ && GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT) \
? 18 : 2) ? 18 : 2)
...@@ -627,7 +627,7 @@ struct rt_cargs {int gregs, fregs; }; ...@@ -627,7 +627,7 @@ struct rt_cargs {int gregs, fregs; };
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
(! (NAMED) ? 0 \ (! (NAMED) ? 0 \
: ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST) ? 0 \ : ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST) ? 0 \
: USE_FP_REG(MODE,CUM) ? gen_rtx_REG ((MODE), (CUM.fregs) + 17) \ : USE_FP_REG(MODE,CUM) ? gen_rtx_REG ((MODE), (CUM).fregs + 17) \
: (CUM).gregs < 4 ? gen_rtx_REG ((MODE), 2 + (CUM).gregs) : 0) : (CUM).gregs < 4 ? gen_rtx_REG ((MODE), 2 + (CUM).gregs) : 0)
/* For an arg passed partly in registers and partly in memory, /* For an arg passed partly in registers and partly in memory,
...@@ -1075,7 +1075,7 @@ struct rt_cargs {int gregs, fregs; }; ...@@ -1075,7 +1075,7 @@ struct rt_cargs {int gregs, fregs; };
high_int += 1, low_int |= 0xffff0000; \ high_int += 1, low_int |= 0xffff0000; \
(X) = gen_rtx_PLUS (SImode, \ (X) = gen_rtx_PLUS (SImode, \
force_operand (plus_constant (XEXP (X, 0), \ force_operand (plus_constant (XEXP (X, 0), \
high_int << 16)), \ high_int << 16), 0), \
GEN_INT (low_int)); \ GEN_INT (low_int)); \
} \ } \
} }
...@@ -1200,7 +1200,6 @@ struct rt_cargs {int gregs, fregs; }; ...@@ -1200,7 +1200,6 @@ struct rt_cargs {int gregs, fregs; };
/* A C expression for the integer offset value of an automatic variable /* A C expression for the integer offset value of an automatic variable
(N_LSYM) having address X (an RTX). This gets used in .stabs entries (N_LSYM) having address X (an RTX). This gets used in .stabs entries
for the local variables. Compare with the default definition. */ for the local variables. Compare with the default definition. */
extern int romp_debugger_auto_correction();
#define DEBUGGER_AUTO_OFFSET(X) \ #define DEBUGGER_AUTO_OFFSET(X) \
(GET_CODE (X) == PLUS \ (GET_CODE (X) == PLUS \
? romp_debugger_auto_correction (INTVAL (XEXP (X, 1)) ) \ ? romp_debugger_auto_correction (INTVAL (XEXP (X, 1)) ) \
...@@ -1208,7 +1207,6 @@ extern int romp_debugger_auto_correction(); ...@@ -1208,7 +1207,6 @@ extern int romp_debugger_auto_correction();
/* A C expression for the integer offset value of an argument (N_PSYM) /* A C expression for the integer offset value of an argument (N_PSYM)
having address X (an RTX). The nominal offset is OFFSET. */ having address X (an RTX). The nominal offset is OFFSET. */
extern int romp_debugger_arg_correction();
#define DEBUGGER_ARG_OFFSET(OFFSET, X) \ #define DEBUGGER_ARG_OFFSET(OFFSET, X) \
romp_debugger_arg_correction (OFFSET); romp_debugger_arg_correction (OFFSET);
...@@ -1261,8 +1259,8 @@ extern int romp_debugger_arg_correction(); ...@@ -1261,8 +1259,8 @@ extern int romp_debugger_arg_correction();
#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
case CONST_INT: \ case CONST_INT: \
if ((OUTER_CODE) == IOR && exact_log2 (INTVAL (RTX)) >= 0 \ if (((OUTER_CODE) == IOR && exact_log2 (INTVAL (RTX)) >= 0) \
|| (OUTER_CODE) == AND && exact_log2 (~INTVAL (RTX)) >= 0 \ || ((OUTER_CODE) == AND && exact_log2 (~INTVAL (RTX)) >= 0) \
|| (((OUTER_CODE) == PLUS || (OUTER_CODE) == MINUS) \ || (((OUTER_CODE) == PLUS || (OUTER_CODE) == MINUS) \
&& (unsigned int) (INTVAL (RTX) + 15) < 31) \ && (unsigned int) (INTVAL (RTX) + 15) < 31) \
|| ((OUTER_CODE) == SET && (unsigned int) INTVAL (RTX) < 16))\ || ((OUTER_CODE) == SET && (unsigned int) INTVAL (RTX) < 16))\
...@@ -1363,7 +1361,7 @@ extern int romp_debugger_arg_correction(); ...@@ -1363,7 +1361,7 @@ extern int romp_debugger_arg_correction();
#define ASM_FILE_START(FILE) \ #define ASM_FILE_START(FILE) \
{ extern char *version_string; \ { extern char *version_string; \
char *p; \ const char *p; \
\ \
fprintf (FILE, "\t.globl .oVncs\n\t.set .oVncs,0\n") ; \ fprintf (FILE, "\t.globl .oVncs\n\t.set .oVncs,0\n") ; \
fprintf (FILE, "\t.globl .oVgcc"); \ fprintf (FILE, "\t.globl .oVgcc"); \
...@@ -1628,7 +1626,3 @@ extern int romp_debugger_arg_correction(); ...@@ -1628,7 +1626,3 @@ extern int romp_debugger_arg_correction();
{"float_unary", {NEG, ABS}}, \ {"float_unary", {NEG, ABS}}, \
{"float_conversion", {FLOAT_TRUNCATE, FLOAT_EXTEND, FLOAT, FIX}}, {"float_conversion", {FLOAT_TRUNCATE, FLOAT_EXTEND, FLOAT, FIX}},
/* Define functions defined in aux-output.c and used in templates. */
extern char *output_in_line_mul ();
extern char *output_fpop ();
;;- Machine description for ROMP chip for GNU C compiler ;;- Machine description for ROMP chip for GNU C compiler
;; Copyright (C) 1988, 91, 93, 94, 95, 98, 1999 Free Software Foundation, Inc. ;; Copyright (C) 1988, 91, 93-95, 98, 99, 2000 Free Software Foundation, Inc.
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -438,6 +438,8 @@ ...@@ -438,6 +438,8 @@
return \"get %O0,$%1\;ls %0,0(%O0)\;ls %O0,4(%O0)\"; return \"get %O0,$%1\;ls %0,0(%O0)\;ls %O0,4(%O0)\";
case 3: case 3:
return \"st%M0 %1,%0\;st%M0 %O1,%O0\"; return \"st%M0 %1,%0\;st%M0 %O1,%O0\";
default:
abort();
} }
}" }"
[(set_attr "type" "multi") [(set_attr "type" "multi")
...@@ -1541,7 +1543,7 @@ ...@@ -1541,7 +1543,7 @@
if (top != 0 && bottom != 0) if (top != 0 && bottom != 0)
{ {
emit_insn (gen_iorsi3 (operands[0], operands[1], emit_insn (gen_iorsi3 (operands[0], operands[1],
GEN_INT (top << 16)))); GEN_INT (top << 16)));
operands[1] = operands[0]; operands[1] = operands[0];
operands[2] = GEN_INT (bottom); operands[2] = GEN_INT (bottom);
} }
......
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