i370-protos.h: New file.

* i370-protos.h: New file.

        * i370.c: Include tm_p.h.  Fix compile time warnings.

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

        * i370.md: Likewise.

From-SVN: r31519
This commit is contained in:
Kaveh R. Ghazi 2000-01-19 22:25:21 +00:00 committed by Kaveh Ghazi
parent b42b4d2c33
commit f50ec635fc
5 changed files with 113 additions and 56 deletions

View File

@ -1,3 +1,14 @@
2000-01-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* i370-protos.h: New file.
* i370.c: Include tm_p.h. Fix compile time warnings.
* i370.h: Move prototypes to i370-protos.h. Fix compile time
warnings.
* i370.md: Likewise.
2000-01-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-01-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* real.c (enan, einan, eiisnan, eiisneg, make_nan): Wrap in NANS. * real.c (enan, einan, eiisnan, eiisneg, make_nan): Wrap in NANS.

View File

@ -0,0 +1,48 @@
/* Definitions of target machine for GNU compiler. System/370 version.
Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
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 i370_branch_dest PARAMS ((rtx));
extern int i370_branch_length PARAMS ((rtx));
extern int i370_short_branch PARAMS ((rtx));
extern int s_operand PARAMS ((rtx, enum machine_mode));
extern int r_or_s_operand PARAMS ((rtx, enum machine_mode));
extern int unsigned_jump_follows_p PARAMS ((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern int handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *));
#endif /* TREE_CODE */
extern char mvs_map_char PARAMS ((int));
extern void mvs_add_label PARAMS ((int));
extern int mvs_check_label PARAMS ((int));
extern int mvs_check_page PARAMS ((FILE *, int, int));
extern int mvs_function_check PARAMS ((const char *));
extern void mvs_add_alias PARAMS ((const char *, const char *, int));
extern int mvs_need_alias PARAMS ((const char *));
extern int mvs_get_alias PARAMS ((const char *, char *));
extern int mvs_check_alias PARAMS ((const char *, char *));
extern void i370_function_prolog PARAMS ((FILE *, int));
extern void check_label_emit PARAMS ((void));
extern void mvs_free_label_list PARAMS ((void));

View File

@ -1,5 +1,5 @@
/* Subroutines for insn-output.c for System/370. /* Subroutines for insn-output.c for System/370.
Copyright (C) 1989, 93, 95, 97, 98, 1999 Free Software Foundation, Inc. Copyright (C) 1989, 93, 95, 97-99, 2000 Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se). Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h" #include "flags.h"
#include "recog.h" #include "recog.h"
#include "toplev.h" #include "toplev.h"
#include "tm_p.h"
extern FILE *asm_out_file; extern FILE *asm_out_file;
@ -92,7 +93,8 @@ static label_node_t *free_anchor = 0;
/* Assembler source file descriptor. */ /* Assembler source file descriptor. */
static FILE *assembler_source = 0; static FILE *assembler_source = 0;
label_node_t * mvs_get_label (); static label_node_t * mvs_get_label PARAMS ((int));
static void i370_label_scan PARAMS ((void));
/* ===================================================== */ /* ===================================================== */
/* defines and functions specific to the HLASM assembler */ /* defines and functions specific to the HLASM assembler */
@ -121,14 +123,16 @@ alias_node_t;
static alias_node_t *alias_anchor = 0; static alias_node_t *alias_anchor = 0;
/* Alias number */ /* Alias number */
static alias_number = 0; #ifdef LONGEXTERNAL
static int alias_number = 0;
#endif
/* Define the length of the internal MVS function table. */ /* Define the length of the internal MVS function table. */
#define MVS_FUNCTION_TABLE_LENGTH 32 #define MVS_FUNCTION_TABLE_LENGTH 32
/* C/370 internal function table. These functions use non-standard linkage /* C/370 internal function table. These functions use non-standard linkage
and must handled in a special manner. */ and must handled in a special manner. */
static char *mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] = static const char *const mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] =
{ {
#if defined(HOST_EBCDIC) /* Changed for EBCDIC collating sequence */ #if defined(HOST_EBCDIC) /* Changed for EBCDIC collating sequence */
"ceil", "edc_acos", "edc_asin", "edc_atan", "edc_ata2", "edc_cos", "ceil", "edc_acos", "edc_asin", "edc_atan", "edc_ata2", "edc_cos",
@ -151,7 +155,7 @@ static char *mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] =
/* ===================================================== */ /* ===================================================== */
/* ASCII to EBCDIC conversion table. */ /* ASCII to EBCDIC conversion table. */
static unsigned char ascebc[256] = static const unsigned char ascebc[256] =
{ {
/*00 NL SH SX EX ET NQ AK BL */ /*00 NL SH SX EX ET NQ AK BL */
0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
@ -204,7 +208,7 @@ static unsigned char ascebc[256] =
}; };
/* EBCDIC to ASCII conversion table. */ /* EBCDIC to ASCII conversion table. */
unsigned char ebcasc[256] = static const unsigned char ebcasc[256] =
{ {
/*00 NU SH SX EX PF HT LC DL */ /*00 NU SH SX EX PF HT LC DL */
0x00, 0x01, 0x02, 0x03, 0x00, 0x09, 0x00, 0x7F, 0x00, 0x01, 0x02, 0x03, 0x00, 0x09, 0x00, 0x7F,
@ -277,7 +281,7 @@ unsigned char ebcasc[256] =
char char
mvs_map_char (c) mvs_map_char (c)
char c; int c;
{ {
#if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC) #if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC)
fprintf (stderr, "mvs_map_char: TE & !HE: c = %02x\n", c); fprintf (stderr, "mvs_map_char: TE & !HE: c = %02x\n", c);
@ -389,7 +393,7 @@ i370_short_branch (insn)
} }
void void
i370_label_scan (void) i370_label_scan ()
{ {
rtx insn; rtx insn;
label_node_t *lp; label_node_t *lp;
@ -429,7 +433,6 @@ i370_label_scan (void)
if (JUMP_INSN == code) if (JUMP_INSN == code)
{ {
rtx label = JUMP_LABEL (insn); rtx label = JUMP_LABEL (insn);
int labelno;
/* If there is no label for this jump, then this /* If there is no label for this jump, then this
had better be a ADDR_VEC or an ADDR_DIFF_VEC had better be a ADDR_VEC or an ADDR_DIFF_VEC
@ -442,7 +445,6 @@ i370_label_scan (void)
{ {
for (j=0; j < XVECLEN (body, 0); j++) for (j=0; j < XVECLEN (body, 0); j++)
{ {
int labelno;
rtx lref = XVECEXP (body, 0, j); rtx lref = XVECEXP (body, 0, j);
if (LABEL_REF != GET_CODE (lref)) abort (); if (LABEL_REF != GET_CODE (lref)) abort ();
label = XEXP (lref,0); label = XEXP (lref,0);
@ -476,7 +478,6 @@ i370_label_scan (void)
debug_rtx (insn); debug_rtx (insn);
for (j=0; j < XVECLEN (body, 0); j++) for (j=0; j < XVECLEN (body, 0); j++)
{ {
int labelno;
} }
/* finished with the vector go do next insn */ /* finished with the vector go do next insn */
continue; continue;
@ -551,8 +552,8 @@ i370_label_scan (void)
code, this shouldn't be a problem ... code, this shouldn't be a problem ...
*/ */
int void
check_label_emit (void) check_label_emit ()
{ {
if (mvs_need_base_reload) if (mvs_need_base_reload)
{ {
@ -699,7 +700,7 @@ mvs_get_label_page(int id)
label element chain. */ label element chain. */
void void
mvs_free_label_list (void) mvs_free_label_list ()
{ {
if (label_anchor) if (label_anchor)
@ -806,7 +807,7 @@ mvs_check_page (file, code, lit)
int int
mvs_function_check (name) mvs_function_check (name)
char *name; const char *name;
{ {
int lower, middle, upper; int lower, middle, upper;
int i; int i;
@ -830,11 +831,11 @@ mvs_function_check (name)
/* Add the alias to the current alias list. */ /* Add the alias to the current alias list. */
int void
mvs_add_alias (realname, aliasname, emitted) mvs_add_alias (realname, aliasname, emitted)
char *realname; const char *realname;
char *aliasname; const char *aliasname;
int emitted; int emitted;
{ {
alias_node_t *ap; alias_node_t *ap;
@ -850,7 +851,7 @@ mvs_add_alias (realname, aliasname, emitted)
int int
mvs_need_alias (realname) mvs_need_alias (realname)
char *realname; const char *realname;
{ {
if (mvs_function_check (realname)) if (mvs_function_check (realname))
return 0; return 0;
@ -866,7 +867,7 @@ mvs_need_alias (realname)
int int
mvs_get_alias (realname, aliasname) mvs_get_alias (realname, aliasname)
char *realname; const char *realname;
char *aliasname; char *aliasname;
{ {
#ifdef LONGEXTERNAL #ifdef LONGEXTERNAL
@ -902,7 +903,7 @@ mvs_get_alias (realname, aliasname)
int int
mvs_check_alias (realname, aliasname) mvs_check_alias (realname, aliasname)
char *realname; const char *realname;
char *aliasname; char *aliasname;
{ {
#ifdef LONGEXTERNAL #ifdef LONGEXTERNAL
@ -942,18 +943,13 @@ mvs_check_alias (realname, aliasname)
The result is 1 if the pragma was handled. */ The result is 1 if the pragma was handled. */
int int
handle_pragma (finput, node) handle_pragma (p_getc, p_ungetc, pname)
FILE *finput; int (* p_getc) PARAMS ((void));
tree node; void (* p_ungetc) PARAMS ((int));
const char *pname;
{ {
int retval = 0; int retval = 0;
register int c; register int c;
register char *pname;
if (TREE_CODE (node) != IDENTIFIER_NODE)
return 0;
pname = IDENTIFIER_POINTER (node);
if (strcmp (pname, "map") == 0) if (strcmp (pname, "map") == 0)
{ {
@ -962,20 +958,20 @@ handle_pragma (finput, node)
char *s; char *s;
do { do {
c = getc (finput); c = p_getc ();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');
if (c == '(') if (c == '(')
{ {
s = realname; s = realname;
do { do {
c = getc (finput); c = p_getc ();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');
if (c == '\n') if (c == '\n')
goto PRAGMA_WARNING; goto PRAGMA_WARNING;
do { do {
*s++ = c; *s++ = c;
c = getc (finput); c = p_getc ();
} while (ISALNUM(c) || c == '_'); } while (ISALNUM(c) || c == '_');
if (c == '\n') if (c == '\n')
goto PRAGMA_WARNING; goto PRAGMA_WARNING;
@ -983,28 +979,28 @@ handle_pragma (finput, node)
if (c == ' ' || c == '\t') if (c == ' ' || c == '\t')
do { do {
c = getc (finput); c = p_getc ();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');
if (c == ',') if (c == ',')
{ {
do { do {
c = getc (finput); c = p_getc ();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');
if (c == '"') if (c == '"')
{ {
s = aliasname; s = aliasname;
c = getc(finput); c = p_getc ();
do { do {
if (c == '\\') if (c == '\\')
{ {
int d = 0; int d = 0;
do { do {
c = getc(finput); c = p_getc ();
if (c >= '0' && c <= '7') if (c >= '0' && c <= '7')
d = (d << 3) | c - '0'; d = (d << 3) | (c - '0');
} while (c >= '0' && c <= '7'); } while (c >= '0' && c <= '7');
ungetc (c, finput); p_ungetc (c);
c = d; c = d;
if (d < 1 || d > 255) if (d < 1 || d > 255)
warning ("Escape value out of range"); warning ("Escape value out of range");
@ -1013,7 +1009,7 @@ handle_pragma (finput, node)
#endif #endif
} }
*s++ = c; *s++ = c;
c = getc (finput); c = p_getc ();
if (ISSPACE(c) || c == ')') if (ISSPACE(c) || c == ')')
goto PRAGMA_WARNING; goto PRAGMA_WARNING;
} while (c != '"'); } while (c != '"');
@ -1024,7 +1020,7 @@ handle_pragma (finput, node)
aliasname[MAX_MVS_LABEL_SIZE] = '\0'; aliasname[MAX_MVS_LABEL_SIZE] = '\0';
} }
do { do {
c = getc (finput); c = p_getc ();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');
if (c == ')') if (c == ')')
{ {
@ -1066,7 +1062,7 @@ handle_pragma (finput, node)
int int
mvs_function_check (name) mvs_function_check (name)
char *name; const char *name ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
@ -1165,6 +1161,7 @@ r_or_s_operand (op, mode)
The unsigned_jump_follows_p() routine returns a 1 if the next jump The unsigned_jump_follows_p() routine returns a 1 if the next jump
is unsigned. INSN is the current instruction. */ is unsigned. INSN is the current instruction. */
int
unsigned_jump_follows_p (insn) unsigned_jump_follows_p (insn)
register rtx insn; register rtx insn;
{ {
@ -1213,7 +1210,6 @@ i370_function_prolog (f, l)
static int function_first = 0; static int function_first = 0;
static int function_year, function_month, function_day; static int function_year, function_month, function_day;
static int function_hour, function_minute, function_second; static int function_hour, function_minute, function_second;
int i;
#if defined(LE370) #if defined(LE370)
if (!function_first) if (!function_first)
{ {
@ -1260,7 +1256,7 @@ i370_function_prolog (f, l)
fprintf (f, "FTIM%03d\tDS\t0F\n", function_label_index); fprintf (f, "FTIM%03d\tDS\t0F\n", function_label_index);
fprintf (f, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n", fprintf (f, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n",
function_year, function_month, function_day, function_year, function_month, function_day,
function_hour, function_minute, function_second); function_hour, function_minute);
fprintf (f, "\tDC\tCL2'01',CL4'0100'\n"); fprintf (f, "\tDC\tCL2'01',CL4'0100'\n");
fprintf (f, "FENT%03d\tDS\t0H\n", function_label_index); fprintf (f, "FENT%03d\tDS\t0H\n", function_label_index);
fprintf (f, "\tSTM\t14,12,12(13)\n"); fprintf (f, "\tSTM\t14,12,12(13)\n");
@ -1396,8 +1392,7 @@ i370_function_prolog (f, frame_size)
{ {
static int function_label_index = 1; static int function_label_index = 1;
static int function_first = 0; static int function_first = 0;
int i; int stackframe_size, aligned_size;
int stackframe_size, soffset, aligned_size;
fprintf (f, "# Function prologue\n"); fprintf (f, "# Function prologue\n");
/* define the stack, put it into its own data segment /* define the stack, put it into its own data segment

View File

@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. System/370 version. /* Definitions of target machine for GNU compiler. System/370 version.
Copyright (C) 1989, 93, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1989, 93, 95-99, 2000 Free Software Foundation, Inc.
Contributed by Jan Stein (jan@cd.chalmers.se). Contributed by Jan Stein (jan@cd.chalmers.se).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
@ -61,7 +61,7 @@ extern int mvs_function_name_length;
#define TARGET_SWITCHES \ #define TARGET_SWITCHES \
{ { "char-instructions", 1, "Generate char instructions"}, \ { { "char-instructions", 1, "Generate char instructions"}, \
{ "no-char-instructions", -1, "Do not generate char instructions"}, \ { "no-char-instructions", -1, "Do not generate char instructions"}, \
{ "", TARGET_DEFAULT} } { "", TARGET_DEFAULT, 0} }
/* To use IBM supplied macro function prologue and epilogue, define the /* To use IBM supplied macro function prologue and epilogue, define the
following to 1. Should only be needed if IBM changes the definition following to 1. Should only be needed if IBM changes the definition
@ -152,8 +152,8 @@ extern int mvs_function_name_length;
text can be read. CH is the first character after the #pragma. The text can be read. CH is the first character after the #pragma. The
result of the expression is the terminating character found result of the expression is the terminating character found
(newline or EOF). */ (newline or EOF). */
#define HANDLE_PRAGMA(FILE, ungetc_unused, NODE) \ #define HANDLE_PRAGMA(GETC, UNGETC, NAME) \
handle_pragma ((FILE), (NODE)) handle_pragma ((GETC), (UNGETC), (NAME))
#endif /* TARGET_HLASM */ #endif /* TARGET_HLASM */
/* Define maximum length of page minus page escape overhead. */ /* Define maximum length of page minus page escape overhead. */
@ -392,7 +392,7 @@ enum reg_class
/* Define which registers fit in which classes. This is an initializer for /* Define which registers fit in which classes. This is an initializer for
a vector of HARD_REG_SET of length N_REG_CLASSES. */ a vector of HARD_REG_SET of length N_REG_CLASSES. */
#define REG_CLASS_CONTENTS {0, 0x0fffe, 0x0ffff, 0xf0000, 0xfffff} #define REG_CLASS_CONTENTS {{0}, {0x0fffe}, {0x0ffff}, {0xf0000}, {0xfffff}}
/* 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
@ -1016,6 +1016,8 @@ enum reg_class
/* some shifts set the CC some don't. */ \ /* some shifts set the CC some don't. */ \
case ASHIFT: case ASHIFTRT: \ case ASHIFT: case ASHIFTRT: \
do {} while (0); \ do {} while (0); \
default: \
break; \
} \ } \
} \ } \
} \ } \

View File

@ -1,5 +1,5 @@
;;- Machine description for GNU compiler -- System/370 version. ;;- Machine description for GNU compiler -- System/370 version.
;; Copyright (C) 1989, 93, 94, 95, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1989, 93, 94, 95, 97-99, 2000 Free Software Foundation, Inc.
;; Contributed by Jan Stein (jan@cd.chalmers.se). ;; Contributed by Jan Stein (jan@cd.chalmers.se).
;; Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) ;; Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
;; Lots of Bug Fixes & Enhancements by Linas Vepstas (linas@linas.org) ;; Lots of Bug Fixes & Enhancements by Linas Vepstas (linas@linas.org)
@ -1591,6 +1591,7 @@ check_label_emit ();
if (REG_P (operands[0])) if (REG_P (operands[0]))
{ {
if (REG_P (operands[1])) if (REG_P (operands[1]))
{
if (REGNO (operands[0]) != REGNO (operands[1])) if (REGNO (operands[0]) != REGNO (operands[1]))
{ {
mvs_check_page (0, 10, 0); mvs_check_page (0, 10, 0);
@ -1598,6 +1599,7 @@ check_label_emit ();
} }
else else
return \"\"; /* Should be empty. 16-bits regs are always 32-bits. */ return \"\"; /* Should be empty. 16-bits regs are always 32-bits. */
}
if (operands[1] == const0_rtx) if (operands[1] == const0_rtx)
{ {
CC_STATUS_INIT; CC_STATUS_INIT;
@ -1641,7 +1643,7 @@ check_label_emit ();
mvs_check_page (0, 8, 0); mvs_check_page (0, 8, 0);
return \"SLL %0,24\;SRA %0,24\"; return \"SLL %0,24\;SRA %0,24\";
} }
if (s_operand (operands[1])) if (s_operand (operands[1], GET_MODE (operands[1])))
{ {
mvs_check_page (0, 8, 0); mvs_check_page (0, 8, 0);
return \"ICM %0,8,%1\;SRA %0,24\"; return \"ICM %0,8,%1\;SRA %0,24\";
@ -1669,7 +1671,7 @@ check_label_emit ();
mvs_check_page (0, 8, 0); mvs_check_page (0, 8, 0);
return \"SLL %0,24\;SRA %0,24\"; return \"SLL %0,24\;SRA %0,24\";
} }
if (s_operand (operands[1])) if (s_operand (operands[1], GET_MODE (operands[1])))
{ {
mvs_check_page (0, 8, 0); mvs_check_page (0, 8, 0);
return \"ICM %0,8,%1\;SRA %0,24\"; return \"ICM %0,8,%1\;SRA %0,24\";
@ -2718,7 +2720,6 @@ check_label_emit ();
{ {
rtx dr = gen_reg_rtx (DImode); rtx dr = gen_reg_rtx (DImode);
rtx dr_0 = gen_rtx_SUBREG (SImode, dr, 0); rtx dr_0 = gen_rtx_SUBREG (SImode, dr, 0);
rtx dr_1 = gen_rtx_SUBREG (SImode, dr, 1);
emit_insn (gen_rtx_SET (VOIDmode, dr_0, operands[1])); emit_insn (gen_rtx_SET (VOIDmode, dr_0, operands[1]));