* 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
+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>
* real.c (enan, einan, eiisnan, eiisneg, make_nan): Wrap in NANS.
--- /dev/null
+/* 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));
/* 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).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
#include "flags.h"
#include "recog.h"
#include "toplev.h"
+#include "tm_p.h"
extern FILE *asm_out_file;
/* Assembler source file descriptor. */
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 */
static alias_node_t *alias_anchor = 0;
/* Alias number */
-static alias_number = 0;
+#ifdef LONGEXTERNAL
+static int alias_number = 0;
+#endif
/* Define the length of the internal MVS function table. */
#define MVS_FUNCTION_TABLE_LENGTH 32
/* C/370 internal function table. These functions use non-standard linkage
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 */
"ceil", "edc_acos", "edc_asin", "edc_atan", "edc_ata2", "edc_cos",
/* ===================================================== */
/* 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 */
0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
};
/* EBCDIC to ASCII conversion table. */
-unsigned char ebcasc[256] =
+static const unsigned char ebcasc[256] =
{
/*00 NU SH SX EX PF HT LC DL */
0x00, 0x01, 0x02, 0x03, 0x00, 0x09, 0x00, 0x7F,
char
mvs_map_char (c)
- char c;
+ int c;
{
#if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC)
fprintf (stderr, "mvs_map_char: TE & !HE: c = %02x\n", c);
}
void
-i370_label_scan (void)
+i370_label_scan ()
{
rtx insn;
label_node_t *lp;
if (JUMP_INSN == code)
{
rtx label = JUMP_LABEL (insn);
- int labelno;
/* If there is no label for this jump, then this
had better be a ADDR_VEC or an ADDR_DIFF_VEC
{
for (j=0; j < XVECLEN (body, 0); j++)
{
- int labelno;
rtx lref = XVECEXP (body, 0, j);
if (LABEL_REF != GET_CODE (lref)) abort ();
label = XEXP (lref,0);
debug_rtx (insn);
for (j=0; j < XVECLEN (body, 0); j++)
{
- int labelno;
}
/* finished with the vector go do next insn */
continue;
code, this shouldn't be a problem ...
*/
-int
-check_label_emit (void)
+void
+check_label_emit ()
{
if (mvs_need_base_reload)
{
label element chain. */
void
-mvs_free_label_list (void)
+mvs_free_label_list ()
{
if (label_anchor)
int
mvs_function_check (name)
- char *name;
+ const char *name;
{
int lower, middle, upper;
int i;
/* Add the alias to the current alias list. */
-int
+void
mvs_add_alias (realname, aliasname, emitted)
- char *realname;
- char *aliasname;
- int emitted;
+ const char *realname;
+ const char *aliasname;
+ int emitted;
{
alias_node_t *ap;
int
mvs_need_alias (realname)
- char *realname;
+ const char *realname;
{
if (mvs_function_check (realname))
return 0;
int
mvs_get_alias (realname, aliasname)
- char *realname;
+ const char *realname;
char *aliasname;
{
#ifdef LONGEXTERNAL
int
mvs_check_alias (realname, aliasname)
- char *realname;
+ const char *realname;
char *aliasname;
{
#ifdef LONGEXTERNAL
The result is 1 if the pragma was handled. */
int
-handle_pragma (finput, node)
- FILE *finput;
- tree node;
+handle_pragma (p_getc, p_ungetc, pname)
+ int (* p_getc) PARAMS ((void));
+ void (* p_ungetc) PARAMS ((int));
+ const char *pname;
{
int retval = 0;
register int c;
- register char *pname;
-
- if (TREE_CODE (node) != IDENTIFIER_NODE)
- return 0;
-
- pname = IDENTIFIER_POINTER (node);
if (strcmp (pname, "map") == 0)
{
char *s;
do {
- c = getc (finput);
+ c = p_getc ();
} while (c == ' ' || c == '\t');
if (c == '(')
{
s = realname;
do {
- c = getc (finput);
+ c = p_getc ();
} while (c == ' ' || c == '\t');
if (c == '\n')
goto PRAGMA_WARNING;
do {
*s++ = c;
- c = getc (finput);
+ c = p_getc ();
} while (ISALNUM(c) || c == '_');
if (c == '\n')
goto PRAGMA_WARNING;
if (c == ' ' || c == '\t')
do {
- c = getc (finput);
+ c = p_getc ();
} while (c == ' ' || c == '\t');
if (c == ',')
{
do {
- c = getc (finput);
+ c = p_getc ();
} while (c == ' ' || c == '\t');
if (c == '"')
{
s = aliasname;
- c = getc(finput);
+ c = p_getc ();
do {
if (c == '\\')
{
int d = 0;
do {
- c = getc(finput);
+ c = p_getc ();
if (c >= '0' && c <= '7')
- d = (d << 3) | c - '0';
+ d = (d << 3) | (c - '0');
} while (c >= '0' && c <= '7');
- ungetc (c, finput);
+ p_ungetc (c);
c = d;
if (d < 1 || d > 255)
warning ("Escape value out of range");
#endif
}
*s++ = c;
- c = getc (finput);
+ c = p_getc ();
if (ISSPACE(c) || c == ')')
goto PRAGMA_WARNING;
} while (c != '"');
aliasname[MAX_MVS_LABEL_SIZE] = '\0';
}
do {
- c = getc (finput);
+ c = p_getc ();
} while (c == ' ' || c == '\t');
if (c == ')')
{
int
mvs_function_check (name)
- char *name;
+ const char *name ATTRIBUTE_UNUSED;
{
return 0;
}
The unsigned_jump_follows_p() routine returns a 1 if the next jump
is unsigned. INSN is the current instruction. */
+int
unsigned_jump_follows_p (insn)
register rtx insn;
{
static int function_first = 0;
static int function_year, function_month, function_day;
static int function_hour, function_minute, function_second;
- int i;
#if defined(LE370)
if (!function_first)
{
fprintf (f, "FTIM%03d\tDS\t0F\n", function_label_index);
fprintf (f, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n",
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, "FENT%03d\tDS\t0H\n", function_label_index);
fprintf (f, "\tSTM\t14,12,12(13)\n");
{
static int function_label_index = 1;
static int function_first = 0;
- int i;
- int stackframe_size, soffset, aligned_size;
+ int stackframe_size, aligned_size;
fprintf (f, "# Function prologue\n");
/* define the stack, put it into its own data segment
/* 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).
Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org)
#define TARGET_SWITCHES \
{ { "char-instructions", 1, "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
following to 1. Should only be needed if IBM changes the definition
text can be read. CH is the first character after the #pragma. The
result of the expression is the terminating character found
(newline or EOF). */
-#define HANDLE_PRAGMA(FILE, ungetc_unused, NODE) \
- handle_pragma ((FILE), (NODE))
+#define HANDLE_PRAGMA(GETC, UNGETC, NAME) \
+ handle_pragma ((GETC), (UNGETC), (NAME))
#endif /* TARGET_HLASM */
/* Define maximum length of page minus page escape overhead. */
/* Define which registers fit in which classes. This is an initializer for
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:
Return the class number of the smallest class containing
/* some shifts set the CC some don't. */ \
case ASHIFT: case ASHIFTRT: \
do {} while (0); \
+ default: \
+ break; \
} \
} \
} \
;;- 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).
;; Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com)
;; Lots of Bug Fixes & Enhancements by Linas Vepstas (linas@linas.org)
if (REG_P (operands[0]))
{
if (REG_P (operands[1]))
+ {
if (REGNO (operands[0]) != REGNO (operands[1]))
{
mvs_check_page (0, 10, 0);
}
else
return \"\"; /* Should be empty. 16-bits regs are always 32-bits. */
+ }
if (operands[1] == const0_rtx)
{
CC_STATUS_INIT;
mvs_check_page (0, 8, 0);
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);
return \"ICM %0,8,%1\;SRA %0,24\";
mvs_check_page (0, 8, 0);
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);
return \"ICM %0,8,%1\;SRA %0,24\";
{
rtx dr = gen_reg_rtx (DImode);
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]));