* 1750a-protos.h: New file.
* 1750a.c: Include tm_p.h. Add static prototypes. Fix compile
time warnings.
* 1750a.h: Move prototypes to 1750a-protos.h. Fix compile time
warnings.
* 1750a.md: Likewise.
From-SVN: r31394
+2000-01-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 1750a-protos.h: New file.
+
+ * 1750a.c: Include tm_p.h. Add static prototypes. Fix compile
+ time warnings.
+
+ * 1750a.h: Move prototypes to 1750a-protos.h. Fix compile time
+ warnings.
+
+ * 1750a.md: Likewise.
+
2000-01-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* a29k-protos.h: New file.
--- /dev/null
+/* Definitions of target machine for GNU compiler.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de)
+
+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. */
+
+#ifdef RTX_CODE
+#ifdef TREE_CODE
+extern struct rtx_def *function_arg PARAMS ((int, enum machine_mode, tree, int));
+#endif /* TREE_CODE */
+extern const char *movcnt_regno_adjust PARAMS ((rtx *));
+extern const char *mod_regno_adjust PARAMS ((const char *, rtx *));
+extern void notice_update_cc PARAMS ((rtx));
+extern double get_double PARAMS ((rtx));
+extern int memop_valid PARAMS ((rtx));
+extern int mov_memory_operand PARAMS ((rtx, enum machine_mode));
+extern int small_nonneg_const PARAMS ((rtx, enum machine_mode));
+extern int zero_operand PARAMS ((rtx, enum machine_mode));
+extern int b_mode_operand PARAMS ((rtx));
+extern int unsigned_comparison_operator PARAMS ((rtx));
+extern int next_cc_user_is_unsigned PARAMS ((rtx));
+extern void print_operand PARAMS ((FILE *, rtx, int));
+extern void print_operand_address PARAMS ((FILE *, rtx));
+#endif /* RTX_CODE */
+
+extern char *float_label PARAMS ((int, double));
+extern const char *branch_or_jump PARAMS ((const char *, int));
+extern int find_jmplbl PARAMS ((int));
+extern int one_bit_set_p PARAMS ((int));
+extern void check_section PARAMS ((enum section));
/* Subroutines for insn-output.c for MIL-STD-1750.
- Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95-99, 2000 Free Software Foundation, Inc.
Contributed by O.M.Kellogg, DASA (kellogg@space.otn.dasa.de)
This file is part of GNU CC.
#include "conditions.h"
#include "real.h"
#include "regs.h"
+#include "output.h"
+#include "tm_p.h"
struct datalabel_array datalbl[DATALBL_ARRSIZ];
int datalbl_ndx = -1;
int jmplbl_ndx = -1;
int label_pending = 0, program_counter = 0;
enum section current_section = Normal;
-char *sectname[4] =
+const char *const sectname[4] =
{"Init", "Normal", "Konst", "Static"};
-int
+static int which_bit PARAMS ((int));
+
+void
notice_update_cc (exp)
rtx exp;
{
int cum;
enum machine_mode mode;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
int size;
char *
float_label (code, value)
- char code;
+ int code;
double value;
{
- int i = 1;
static char label[32];
char *p;
label[0] = code;
p = label + 1;
- sprintf (p, "%lf", value);
+ sprintf (p, "%f", value);
while (*p)
{
*p = (*p == '+') ? 'p' :
}
-char *
+const char *
movcnt_regno_adjust (op)
rtx *op;
{
return outstr;
}
-char *
+const char *
mod_regno_adjust (instr, op)
- char *instr;
+ const char *instr;
rtx *op;
{
static char outstr[40];
- char *r = (!strncmp (instr, "dvr", 3) ? "r" : "");
+ const char *r = (!strncmp (instr, "dvr", 3) ? "r" : "");
int modregno_gcc = REGNO (op[3]), modregno_1750 = REGNO (op[0]) + 1;
if (modregno_gcc == modregno_1750
int
mov_memory_operand (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG);
}
int
small_nonneg_const (op, mode)
rtx op;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
{
if (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) <= 15)
return 1;
return -1;
}
-char *
+const char *
branch_or_jump (condition, targetlabel_number)
- char *condition;
+ const char *condition;
int targetlabel_number;
{
static char buf[30];
'w' for int - 16
*/
+void
print_operand (file, x, letter)
FILE *file;
rtx x;
/* {
double value = get_double (x);
char fltstr[32];
- sprintf (fltstr, "%lf", value);
+ sprintf (fltstr, "%f", value);
if (letter == 'D' || letter == 'E')
{
if (!found)
{
fprintf (stderr,
- "float value %lfnot found upon label reference\n", value);
+ "float value %f not found upon label reference\n", value);
strcpy (datalbl[i = ++datalbl_ndx].value, fltstr);
datalbl[i].name = float_label (letter, value);
datalbl[i].size = (letter == 'G') ? 3 : 2;
fprintf (file, " %s ;P_O cst_dbl ", fltstr);
}
*/
- fprintf (file, "%lf", get_double (x));
+ fprintf (file, "%f", get_double (x));
break;
case CONST_INT:
if (letter == 'J')
- fprintf (file, "%d", -INTVAL (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, -INTVAL (x));
else if (letter == 'b')
fprintf (file, "%d", which_bit (INTVAL (x)));
else if (letter == 'B')
fprintf (file, "%d", which_bit (~INTVAL (x)));
else if (letter == 'w')
- fprintf (file, "%d", INTVAL (x) - 16);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) - 16);
else
- fprintf (file, "%d", INTVAL (x));
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
break;
case CODE_LABEL:
break;
case CALL:
- fprintf (file, "CALL nargs=%d, func is either '%s' or '%s'",
- XEXP (x, 1), XSTR (XEXP (XEXP (x, 0), 1), 0), XSTR (XEXP (x, 0), 1));
+ fprintf (file, "CALL nargs=");
+ fprintf (file, HOST_PTR_PRINTF, XEXP (x, 1));
+ fprintf (file, ", func is either '%s' or '%s'",
+ XSTR (XEXP (XEXP (x, 0), 1), 0), XSTR (XEXP (x, 0), 1));
break;
case PLUS:
addr_inc = 0;
}
+void
print_operand_address (file, addr)
FILE *file;
rtx addr;
* Return the number of the least significant bit set, using the same
* convention for bit numbering as in the MIL-STD-1750 sb instruction.
*/
-int
+static int
which_bit (x)
int x;
{
/* Definitions of target machine for GNU compiler.
- Copyright (C) 1994, 95-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95-99, 2000 Free Software Foundation, Inc.
Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de)
This file is part of GNU CC.
extern struct jumplabel_array jmplbl[];
extern int datalbl_ndx, jmplbl_ndx, label_pending, program_counter;
extern enum section current_section;
-extern char *sectname[4];
-extern char *float_label();
-extern struct rtx_def *function_arg ();
-extern char *movcnt_regno_adjust ();
-extern char *mod_regno_adjust ();
-extern char *branch_or_jump ();
+extern const char *const sectname[4];
#endif
/*--------------------------------------------------------------------*/
1750 "index" (remember, in the *GCC* sense!) regs are R12 through R15.
The only 1750 register not usable as BASE_REG is R0. */
-#define REG_CLASS_CONTENTS {0, 0x0004, 0x0003, 0xf000, 0xfffe, 0xffff}
+#define REG_CLASS_CONTENTS { {0}, {0x0004}, {0x0003}, {0xf000}, {0xfffe}, {0xffff} }
/* The same information, inverted:
Return the class number of the smallest class containing
*/
#define REGNO_OK_FOR_BASE_P(REGNO) \
- ((REGNO) > 0 && (REGNO) <= 15 || \
- reg_renumber[REGNO] > 0 && reg_renumber[REGNO] <= 15)
+ (((REGNO) > 0 && (REGNO) <= 15) || \
+ (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] <= 15))
#define REGNO_OK_FOR_INDEX_P(REGNO) \
- ((REGNO) >= 12 && (REGNO) <= 15 || \
- reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15)
+ (((REGNO) >= 12 && (REGNO) <= 15) || \
+ (reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15))
/* Now macros that check whether X is a register and also,
strictly, whether it is in a specified class. */
else \
p = main_input_filename; \
strcpy(name,p); \
- if (p = (char *)strchr(name,'.')) \
+ if ((p = (char *)strchr(name,'.'))) \
*p = '\0'; \
fprintf(FILE,"\tname %s\n",name); \
fprintf(FILE,"\tnolist\n\tinclude \"ms1750.inc\"\n\tlist\n\n"); \
fprintf(asm_out_file,"\tkonst\n"); \
current_section = Konst; \
} \
- check_section(sect) \
+ void check_section(sect) \
enum section sect; \
{ \
if (current_section != sect) { \
do { \
if (label_pending) { \
label_pending = 0; \
- sprintf (datalbl[datalbl_ndx].value, "%lf", (double) VALUE); \
+ sprintf (datalbl[datalbl_ndx].value, "%f", (double) VALUE); \
} \
datalbl[datalbl_ndx].size += 2; \
- fprintf (FILE, "\tdataf\t%lf\n",VALUE); \
+ fprintf (FILE, "\tdataf\t%f\n",VALUE); \
} while(0)
/* This is how to output an assembler line defining a 1750A `double'
do { \
if (label_pending) { \
label_pending = 0; \
- sprintf (datalbl[datalbl_ndx].value, "%lf", VALUE); \
+ sprintf (datalbl[datalbl_ndx].value, "%f", VALUE); \
} \
datalbl[datalbl_ndx].size += 3; \
- fprintf(FILE,"\tdataef\t%lf\n",VALUE); \
+ fprintf(FILE,"\tdataef\t%f\n",VALUE); \
} while (0)
/* This is how to output an assembler line defining a string constant. */
It need not be very fast code. */
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
- fprintf (FILE, "\tPSHM R%s,R%s\n", reg_names[REGNO])
+ fprintf (FILE, "\tPSHM R%s,R%s\n", reg_names[REGNO], "FIXME: missing arg")
/* This is how to output an insn to pop a register from the stack.
It need not be very fast code. */
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
- fprintf (FILE, "\tPOPM R%s,R%s\n", reg_names[REGNO])
+ fprintf (FILE, "\tPOPM R%s,R%s\n", reg_names[REGNO], "FIXME: missing arg")
/* This is how to output an element of a case-vector that is absolute. */
;;- Machine description for GNU compiler
;;- MIL-STD-1750A version.
-;; Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95-99, 2000 Free Software Foundation, Inc.
;; Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de).
;; This file is part of GNU CC.
return \"ucr.m %0,%1\";
case 4:
return \"uc.m %0,%1\";
+ default:
+ abort();
}
else
switch (which_alternative)
return \"cr r%0,r%1\";
case 4:
return \"c r%0,%1\";
+ default:
+ abort();
}
} ")
return \"incm %2,%0\";
case 6:
return \"decm %J2,%0\";
+ default:
+ abort();
} ")
;; double integer
return \"m r%0,%2\";
case 2:
return \"mim r%0,%2\";
+ default:
+ abort();
}
")