From ab526045918871bdd1f351b9e7ce98946a8403d9 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Fri, 14 Jan 2000 16:00:37 +0000 Subject: [PATCH] elxsi-protos.h: New file. * elxsi-protos.h: New file. * elxsi.c: Include tm_p.h. Add static prototypes. Fix compile time warnings. * elxsi.h: Move prototypes to elxsi-protos.h. Fix compile time warnings. * elxsi.md: Likewise. From-SVN: r31414 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/elxsi/elxsi-protos.h | 31 +++++++++++++++++++++++++++++++ gcc/config/elxsi/elxsi.c | 31 +++++++++++++++++++++---------- gcc/config/elxsi/elxsi.h | 13 ++++--------- gcc/config/elxsi/elxsi.md | 4 +++- 5 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 gcc/config/elxsi/elxsi-protos.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ddfa5edb982..4431b3eae1c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2000-01-14 Kaveh R. Ghazi + + * elxsi-protos.h: New file. + + * elxsi.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * elxsi.h: Move prototypes to elxsi-protos.h. Fix compile time + warnings. + + * elxsi.md: Likewise. + 2000-01-14 Clinton Popetz * config/mips/mips.h (REGISTER_MOVE_COST): Remove redundant diff --git a/gcc/config/elxsi/elxsi-protos.h b/gcc/config/elxsi/elxsi-protos.h new file mode 100644 index 00000000000..9889da03b62 --- /dev/null +++ b/gcc/config/elxsi/elxsi-protos.h @@ -0,0 +1,31 @@ +/* Definitions of target machine for GNU compiler. Elxsi version. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Mike Stump in 1988. This is the first + 64 bit port of GNU CC. + Based upon the VAX port. + +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. */ + +/* Functions used in the md file. */ + +#ifdef RTX_CODE +extern const char *cmp_set PARAMS ((const char *, const char *, rtx)); +extern const char *cmp_jmp PARAMS ((const char *, int, rtx)); +extern void print_operand_address PARAMS ((FILE *, rtx)); +#endif /* RTX_CODE */ + diff --git a/gcc/config/elxsi/elxsi.c b/gcc/config/elxsi/elxsi.c index 77dac67da0b..4242b3855be 100644 --- a/gcc/config/elxsi/elxsi.c +++ b/gcc/config/elxsi/elxsi.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for GNU compiler. Elxsi version. - Copyright (C) 1987, 1992, 1998, 1999 Free Software Foundation, Inc + Copyright (C) 1987, 1992, 1998, 1999, 2000 Free Software Foundation, Inc Contributrd by Mike Stump in 1988 and is the first 64 bit port of GNU CC. Based upon the VAX port. @@ -25,22 +25,29 @@ Boston, MA 02111-1307, USA. */ #include "system.h" #include "rtl.h" #include "function.h" +#include "output.h" +#include "tm_p.h" extern const char *reg_names[]; rtx cmp_op0=0, cmp_op1=0; /* table of relations for compares and branches */ -char *cmp_tab[] = { +static const char *const cmp_tab[] = { "gt", "gt", "eq", "eq", "ge", "ge", "lt", "lt", "ne", "ne", "le", "le" }; /* type is the index into the above table */ /* s is "" for signed, or "u" for unsigned */ -char *cmp_jmp(s, type, where) char *s; rtx where; { +const char * +cmp_jmp (s, type, where) + const char *s; + int type; + rtx where; +{ rtx br_ops[3]; char template[50]; - char *f = ""; - char *bits = "64"; + const char *f = ""; + const char *bits = "64"; if (GET_MODE (cmp_op0) == SFmode) f = "f", bits = "32"; if (GET_MODE (cmp_op0) == DFmode) f = "f"; br_ops[0] = where; @@ -53,18 +60,22 @@ char *cmp_jmp(s, type, where) char *s; rtx where; { sprintf(template, "fcmp.br.%s\t%%1,=0:j%s\t%%l0", bits, cmp_tab[type]); else if (*s) /* can turn the below in to a jmp ... */ - sprintf(template, "cmpu.br.64\t%%1,=0:j%s\t%%l0", s, cmp_tab[type]); + sprintf(template, "cmpu.br.64\t%%1,=0:j%s\t%%l0", s); else sprintf(template, "jmp.%s\t%%1,%%l0", cmp_tab[type+1]); output_asm_insn(template, br_ops); return ""; } -char *cmp_set(s, type, reg) char *s, *type; rtx reg; { +const char * +cmp_set (s, type, reg) + const char *s, *type; + rtx reg; +{ rtx br_ops[3]; char template[50]; - char *f = ""; - char *bits = "64"; + const char *f = ""; + const char *bits = "64"; if (GET_MODE (cmp_op0) == SFmode) f = "f", bits = "32"; else if (GET_MODE (cmp_op0) == DFmode) f = "f"; else if (GET_MODE (cmp_op0) == SImode) bits = "32"; @@ -83,6 +94,7 @@ char *cmp_set(s, type, reg) char *s, *type; rtx reg; { return ""; } +void print_operand_address (file, addr) FILE *file; register rtx addr; @@ -90,7 +102,6 @@ print_operand_address (file, addr) register rtx reg1, reg2, breg, ireg; rtx offset; - retry: switch (GET_CODE (addr)) { diff --git a/gcc/config/elxsi/elxsi.h b/gcc/config/elxsi/elxsi.h index 06e83f89f58..8b3e0061dc7 100644 --- a/gcc/config/elxsi/elxsi.h +++ b/gcc/config/elxsi/elxsi.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Elxsi version. - Copyright (C) 1987, 88, 92, 95, 96, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 92, 95, 96, 98, 99, 2000 Free Software Foundation, Inc. Contributed by Mike Stump in 1988. This is the first 64 bit port of GNU CC. Based upon the VAX port. @@ -234,7 +234,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */ -#define REG_CLASS_CONTENTS {0, 0x07fff, 0xffff} +#define REG_CLASS_CONTENTS {{0}, {0x07fff}, {0xffff}} /* The same information, inverted: Return the class number of the smallest class containing @@ -714,7 +714,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; } while (0) /* Output at beginning of assembler file. */ -#define ASM_FILE_START(FILE) fprintf (FILE, ""); +#define ASM_FILE_START(FILE) fputs ("", (FILE)); /* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */ @@ -882,7 +882,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; to a multiple of 2**LOG bytes. */ #define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); else 0 + do { if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", (LOG)); } while (0) /* This is how to output an assembler line that says to advance the location counter by SIZE bytes. */ @@ -954,11 +954,6 @@ enum reg_class { NO_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES }; #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ print_operand_address (FILE, ADDR) -/* Functions used in the md file. */ - -extern char *cmp_set(); -extern char *cmp_jmp(); - /* These are stubs, and have yet to bee written. */ #define TRAMPOLINE_SIZE 26 diff --git a/gcc/config/elxsi/elxsi.md b/gcc/config/elxsi/elxsi.md index 9611ac22ed7..084ff36fc66 100644 --- a/gcc/config/elxsi/elxsi.md +++ b/gcc/config/elxsi/elxsi.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler, Elxsi Version -;; Copyright (C) 1987, 1988, 1992, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1987, 1988, 1992, 1994, 2000 Free Software Foundation, Inc. ;; Contributed by Mike Stump in 1988, and is the first ;; 64 bit port of GNU CC. ;; Based upon the VAX port. @@ -525,6 +525,8 @@ else return \"stin.64\\t%n1,%0\"; } + else + abort(); ") (define_insn "movsi"