Commit fabf04b6 by Kaveh R. Ghazi Committed by Kaveh Ghazi

ns32k-protos.h: New file.

        * ns32k-protos.h: New file.

        * ns32k.c: Fix compile time warnings.

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

        * ns32k.md: Likewise.

From-SVN: r31494
parent 2fd58acb
2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ns32k-protos.h: New file.
* ns32k.c: Fix compile time warnings.
* ns32k.h: Move prototypes to ns32k-protos.h. Fix compile time
warnings.
* ns32k.md: Likewise.
2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* vax-protos.h: New file. * vax-protos.h: New file.
* vax.c: Fix compile time warnings. * vax.c: Fix compile time warnings.
......
/* Definitions of target machine for GNU compiler. NS32000 version.
Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@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. */
/* Prototypes for functions in ns32k.c */
#ifdef RTX_CODE
extern int calc_address_cost PARAMS ((rtx));
extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
enum machine_mode, rtx));
extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode));
extern void split_di PARAMS ((rtx[], int, rtx[], rtx[]));
extern void expand_block_move PARAMS ((rtx[]));
extern int global_symbolic_reference_mentioned_p PARAMS ((rtx, int));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern const char *output_move_double PARAMS ((rtx *));
extern const char *output_shift_insn PARAMS ((rtx *));
extern int symbolic_reference_mentioned_p PARAMS ((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern int ns32k_comp_type_attributes PARAMS ((tree, tree));
extern int ns32k_return_pops_args PARAMS ((tree, tree, int));
extern int ns32k_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree));
extern int ns32k_valid_type_attribute_p PARAMS ((tree, tree, tree, tree));
#endif /* TREE_CODE */
extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
extern int register_move_cost PARAMS ((enum reg_class, enum reg_class));
extern const char *output_move_dconst PARAMS ((int, const char *));
/* Subroutines for assembler code output on the NS32000. /* Subroutines for assembler code output on the NS32000.
Copyright (C) 1988, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Copyright (C) 1988, 94-99, 2000 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -33,16 +33,18 @@ Boston, MA 02111-1307, USA. */ ...@@ -33,16 +33,18 @@ Boston, MA 02111-1307, USA. */
#include "function.h" #include "function.h"
#include "expr.h" #include "expr.h"
#include "flags.h" #include "flags.h"
#include "recog.h"
#include "tm_p.h"
#ifdef OSF_OS #ifdef OSF_OS
int ns32k_num_files = 0; int ns32k_num_files = 0;
#endif #endif
/* This duplicates reg_class_contens in reg_class.c, but maybe that isn't /* This duplicates reg_class_contents in reg_class.c, but maybe that isn't
initialized in time. Also this is more convenient as an array of ints. initialized in time. Also this is more convenient as an array of ints.
We know that HARD_REG_SET fits in an unsigned int */ We know that HARD_REG_SET fits in an unsigned int */
unsigned int ns32k_reg_class_contents[N_REG_CLASSES] = REG_CLASS_CONTENTS; unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1] = REG_CLASS_CONTENTS;
enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
{ {
...@@ -55,15 +57,11 @@ enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = ...@@ -55,15 +57,11 @@ enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
FRAME_POINTER_REG, STACK_POINTER_REG FRAME_POINTER_REG, STACK_POINTER_REG
}; };
char *ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES; const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES;
void
trace (s, s1, s2)
char *s, *s1, *s2;
{
fprintf (stderr, s, s1, s2);
}
static rtx gen_indexed_expr PARAMS ((rtx, rtx, rtx));
static const char *singlemove_string PARAMS ((rtx *));
static void move_tail PARAMS ((rtx[], int, int));
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
int int
...@@ -179,7 +177,7 @@ calc_address_cost (operand) ...@@ -179,7 +177,7 @@ calc_address_cost (operand)
enum reg_class enum reg_class
secondary_reload_class (class, mode, in) secondary_reload_class (class, mode, in)
enum reg_class class; enum reg_class class;
enum machine_mode mode; enum machine_mode mode ATTRIBUTE_UNUSED;
rtx in; rtx in;
{ {
int regno = true_regnum (in); int regno = true_regnum (in);
...@@ -265,7 +263,7 @@ split_di (operands, num, lo_half, hi_half) ...@@ -265,7 +263,7 @@ split_di (operands, num, lo_half, hi_half)
/* Return the best assembler insn template /* Return the best assembler insn template
for moving operands[1] into operands[0] as a fullword. */ for moving operands[1] into operands[0] as a fullword. */
static char * static const char *
singlemove_string (operands) singlemove_string (operands)
rtx *operands; rtx *operands;
{ {
...@@ -276,7 +274,7 @@ singlemove_string (operands) ...@@ -276,7 +274,7 @@ singlemove_string (operands)
return "movd %1,%0"; return "movd %1,%0";
} }
char * const char *
output_move_double (operands) output_move_double (operands)
rtx *operands; rtx *operands;
{ {
...@@ -454,7 +452,6 @@ expand_block_move (operands) ...@@ -454,7 +452,6 @@ expand_block_move (operands)
rtx src_reg = gen_rtx(REG, Pmode, 1); rtx src_reg = gen_rtx(REG, Pmode, 1);
rtx dest_reg = gen_rtx(REG, Pmode, 2); rtx dest_reg = gen_rtx(REG, Pmode, 2);
rtx count_reg = gen_rtx(REG, SImode, 0); rtx count_reg = gen_rtx(REG, SImode, 0);
rtx insn;
if (constp && bytes <= 0) if (constp && bytes <= 0)
return; return;
...@@ -463,6 +460,7 @@ expand_block_move (operands) ...@@ -463,6 +460,7 @@ expand_block_move (operands)
{ {
int words = bytes >> 2; int words = bytes >> 2;
if (words) if (words)
{
if (words < 3 || flag_unroll_loops) if (words < 3 || flag_unroll_loops)
{ {
int offset = 0; int offset = 0;
...@@ -488,6 +486,7 @@ expand_block_move (operands) ...@@ -488,6 +486,7 @@ expand_block_move (operands)
emit_insn(gen_movstrsi2(dest, src, GEN_INT(words))); emit_insn(gen_movstrsi2(dest, src, GEN_INT(words)));
} }
}
move_tail(operands, bytes & 3, bytes & ~3); move_tail(operands, bytes & 3, bytes & ~3);
return; return;
} }
...@@ -504,8 +503,6 @@ expand_block_move (operands) ...@@ -504,8 +503,6 @@ expand_block_move (operands)
if (constp && (align == UNITS_PER_WORD || bytes < MAX_UNALIGNED_COPY)) if (constp && (align == UNITS_PER_WORD || bytes < MAX_UNALIGNED_COPY))
{ {
rtx bytes_reg;
/* constant no of bytes and aligned or small enough copy to not bother /* constant no of bytes and aligned or small enough copy to not bother
* aligning. Emit insns to copy by words. * aligning. Emit insns to copy by words.
*/ */
...@@ -640,10 +637,10 @@ symbolic_reference_mentioned_p (op) ...@@ -640,10 +637,10 @@ symbolic_reference_mentioned_p (op)
int int
ns32k_valid_decl_attribute_p (decl, attributes, identifier, args) ns32k_valid_decl_attribute_p (decl, attributes, identifier, args)
tree decl; tree decl ATTRIBUTE_UNUSED;
tree attributes; tree attributes ATTRIBUTE_UNUSED;
tree identifier; tree identifier ATTRIBUTE_UNUSED;
tree args; tree args ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
...@@ -655,7 +652,7 @@ ns32k_valid_decl_attribute_p (decl, attributes, identifier, args) ...@@ -655,7 +652,7 @@ ns32k_valid_decl_attribute_p (decl, attributes, identifier, args)
int int
ns32k_valid_type_attribute_p (type, attributes, identifier, args) ns32k_valid_type_attribute_p (type, attributes, identifier, args)
tree type; tree type;
tree attributes; tree attributes ATTRIBUTE_UNUSED;
tree identifier; tree identifier;
tree args; tree args;
{ {
...@@ -682,8 +679,8 @@ ns32k_valid_type_attribute_p (type, attributes, identifier, args) ...@@ -682,8 +679,8 @@ ns32k_valid_type_attribute_p (type, attributes, identifier, args)
int int
ns32k_comp_type_attributes (type1, type2) ns32k_comp_type_attributes (type1, type2)
tree type1; tree type1 ATTRIBUTE_UNUSED;
tree type2; tree type2 ATTRIBUTE_UNUSED;
{ {
return 1; return 1;
} }
...@@ -708,7 +705,7 @@ ns32k_comp_type_attributes (type1, type2) ...@@ -708,7 +705,7 @@ ns32k_comp_type_attributes (type1, type2)
int int
ns32k_return_pops_args (fundecl, funtype, size) ns32k_return_pops_args (fundecl, funtype, size)
tree fundecl; tree fundecl ATTRIBUTE_UNUSED;
tree funtype; tree funtype;
int size; int size;
{ {
...@@ -744,7 +741,7 @@ void ...@@ -744,7 +741,7 @@ void
print_operand (file, x, code) print_operand (file, x, code)
FILE *file; FILE *file;
rtx x; rtx x;
char code; int code;
{ {
if (code == '$') if (code == '$')
PUT_IMMEDIATE_PREFIX (file); PUT_IMMEDIATE_PREFIX (file);
...@@ -754,7 +751,6 @@ print_operand (file, x, code) ...@@ -754,7 +751,6 @@ print_operand (file, x, code)
fprintf (file, "%s", ns32k_out_reg_names[REGNO (x)]); fprintf (file, "%s", ns32k_out_reg_names[REGNO (x)]);
else if (GET_CODE (x) == MEM) else if (GET_CODE (x) == MEM)
{ {
rtx tmp = XEXP (x, 0);
output_address (XEXP (x, 0)); output_address (XEXP (x, 0));
} }
else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != VOIDmode) else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != VOIDmode)
...@@ -1124,13 +1120,14 @@ print_operand_address (file, addr) ...@@ -1124,13 +1120,14 @@ print_operand_address (file, addr)
/* National 32032 shifting is so bad that we can get /* National 32032 shifting is so bad that we can get
better performance in many common cases by using other better performance in many common cases by using other
techniques. */ techniques. */
char * const char *
output_shift_insn (operands) output_shift_insn (operands)
rtx *operands; rtx *operands;
{ {
if (GET_CODE (operands[2]) == CONST_INT if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) > 0 && INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) <= 3) && INTVAL (operands[2]) <= 3)
{
if (GET_CODE (operands[0]) == REG) if (GET_CODE (operands[0]) == REG)
{ {
if (GET_CODE (operands[1]) == REG) if (GET_CODE (operands[1]) == REG)
...@@ -1169,13 +1166,14 @@ output_shift_insn (operands) ...@@ -1169,13 +1166,14 @@ output_shift_insn (operands)
return "addd %0,%0"; return "addd %0,%0";
} }
else return "ashd %2,%0"; else return "ashd %2,%0";
}
return "ashd %2,%0"; return "ashd %2,%0";
} }
char * const char *
output_move_dconst (n, s) output_move_dconst (n, s)
int n; int n;
char *s; const char *s;
{ {
static char r[32]; static char r[32];
......
/* Definitions of target machine for GNU compiler. NS32000 version. /* Definitions of target machine for GNU compiler. NS32000 version.
Copyright (C) 1988, 93, 94-98, 1999 Free Software Foundation, Inc. Copyright (C) 1988, 93, 94-99, 2000 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -408,12 +408,12 @@ enum reg_class ...@@ -408,12 +408,12 @@ enum reg_class
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, 0x00ff, 0x100, 0x300, 0xff00, \ #define REG_CLASS_CONTENTS {{0}, {0x00ff}, {0x100}, {0x300}, {0xff00}, \
0xffff00, 0xffffff, 0x1000000, 0x2000000, \ {0xffff00}, {0xffffff}, {0x1000000}, {0x2000000}, \
0x30000ff, 0x3ffffff } {0x30000ff}, {0x3ffffff} }
#define SUBSET_P(CLASS1, CLASS2) \ #define SUBSET_P(CLASS1, CLASS2) \
((ns32k_reg_class_contents[CLASS1] & ~ns32k_reg_class_contents[CLASS2]) \ ((ns32k_reg_class_contents[CLASS1][0] & ~ns32k_reg_class_contents[CLASS2][0]) \
== 0) == 0)
/* The same information, inverted: /* The same information, inverted:
...@@ -1145,8 +1145,7 @@ __transfer_from_trampoline () \ ...@@ -1145,8 +1145,7 @@ __transfer_from_trampoline () \
/* Go to ADDR if X is a valid address not using indexing. /* Go to ADDR if X is a valid address not using indexing.
(This much is the easy part.) */ (This much is the easy part.) */
#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \
{ register rtx xfoob = (X); \ { if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \
if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; \
if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR; \ if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR; \
if (GET_CODE (X) == PLUS) \ if (GET_CODE (X) == PLUS) \
if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1))) \ if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1))) \
...@@ -1211,7 +1210,9 @@ __transfer_from_trampoline () \ ...@@ -1211,7 +1210,9 @@ __transfer_from_trampoline () \
else if (INDEX_TERM_P (xfooy, MODE)) \ else if (INDEX_TERM_P (xfooy, MODE)) \
goto ADDR; \ goto ADDR; \
else if (GET_CODE (xfooy) == PRE_DEC) \ else if (GET_CODE (xfooy) == PRE_DEC) \
{ \
if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR; \ if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR; \
} \
else abort (); \ else abort (); \
} }
...@@ -1594,7 +1595,7 @@ do { \ ...@@ -1594,7 +1595,7 @@ do { \
This is suitable for output with `assemble_name'. */ This is suitable for output with `assemble_name'. */
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s%d", PREFIX, NUM) sprintf (LABEL, "*%s%ld", PREFIX, (long) NUM)
/* This is how to align the code that follows an unconditional branch. */ /* This is how to align the code that follows an unconditional branch. */
...@@ -1676,38 +1677,8 @@ do { \ ...@@ -1676,38 +1677,8 @@ do { \
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE, ADDR) #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE, ADDR)
/* Prototypes for functions in ns32k.c */ extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1];
extern const char *const ns32k_out_reg_names[];
/* Prototypes would be nice, but for now it causes too many problems.
This file gets included in places where the types (such as "rtx"
and enum machine_mode) are not defined. */
#define NS32K_PROTO(ARGS) ()
int hard_regno_mode_ok NS32K_PROTO((int regno, enum machine_mode mode));
int register_move_cost NS32K_PROTO((enum reg_class CLASS1, enum reg_class CLASS2));
int calc_address_cost NS32K_PROTO((rtx operand));
enum reg_class secondary_reload_class NS32K_PROTO((enum reg_class class,
enum machine_mode mode, rtx in));
int reg_or_mem_operand NS32K_PROTO((register rtx op, enum machine_mode mode));
void split_di NS32K_PROTO((rtx operands[], int num, rtx lo_half[], hi_half[]));
void expand_block_move NS32K_PROTO((rtx operands[]));
int global_symbolic_reference_mentioned_p NS32K_PROTO((rtx op, int f));
int ns32k_comp_type_attributes NS32K_PROTO((tree type1, tree type2));
int ns32k_return_pops_args NS32K_PROTO((tree fundecl, tree funtype, int size));
int ns32k_valid_decl_attribute_p NS32K_PROTO((tree decl, tree attributes,
tree identifier, tree args));
int ns32k_valid_type_attribute_p NS32K_PROTO((tree decl, tree attributes,
tree identifier, tree args));
void print_operand NS32K_PROTO((FILE *file, rtx x, char code));
void print_operand_address NS32K_PROTO((register FILE *file, register rtx addr));
char *output_move_dconst NS32K_PROTO((int n, char *s));
char *output_move_double NS32K_PROTO((rtx *operands));
char *output_shift_insn NS32K_PROTO((rtx *operands));
extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES];
extern char *ns32k_out_reg_names[];
extern enum reg_class regclass_map[]; /* smalled class containing REGNO */ extern enum reg_class regclass_map[]; /* smalled class containing REGNO */
/* /*
......
...@@ -2245,12 +2245,14 @@ ...@@ -2245,12 +2245,14 @@
"TARGET_BITFIELD" "TARGET_BITFIELD"
"* "*
{ if (GET_CODE (operands[2]) == CONST_INT) { if (GET_CODE (operands[2]) == CONST_INT)
{
if (INTVAL (operands[1]) <= 8) if (INTVAL (operands[1]) <= 8)
return \"inssb %3,%0,%2,%1\"; return \"inssb %3,%0,%2,%1\";
else if (INTVAL (operands[1]) <= 16) else if (INTVAL (operands[1]) <= 16)
return \"inssw %3,%0,%2,%1\"; return \"inssw %3,%0,%2,%1\";
else else
return \"inssd %3,%0,%2,%1\"; return \"inssd %3,%0,%2,%1\";
}
return \"insd %2,%3,%0,%1\"; return \"insd %2,%3,%0,%1\";
}") }")
...@@ -2262,12 +2264,14 @@ ...@@ -2262,12 +2264,14 @@
"TARGET_BITFIELD" "TARGET_BITFIELD"
"* "*
{ if (GET_CODE (operands[2]) == CONST_INT) { if (GET_CODE (operands[2]) == CONST_INT)
{
if (INTVAL (operands[1]) <= 8) if (INTVAL (operands[1]) <= 8)
return \"inssb %3,%0,%2,%1\"; return \"inssb %3,%0,%2,%1\";
else if (INTVAL (operands[1]) <= 16) else if (INTVAL (operands[1]) <= 16)
return \"inssw %3,%0,%2,%1\"; return \"inssw %3,%0,%2,%1\";
else else
return \"inssd %3,%0,%2,%1\"; return \"inssd %3,%0,%2,%1\";
}
return \"insd %2,%3,%0,%1\"; return \"insd %2,%3,%0,%1\";
}") }")
......
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