aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-01-03 21:13:29 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-01-03 21:13:29 +0000
commit975d393ab8c7dc0527586d34881837924cbb0026 (patch)
tree4db5e76c3dc4ba9bc9acb3825530f9e397ea33bf
parent03dc032560d43abc8a9867472fdb22cbf0c6b9c7 (diff)
downloadgcc-975d393ab8c7dc0527586d34881837924cbb0026.zip
gcc-975d393ab8c7dc0527586d34881837924cbb0026.tar.gz
gcc-975d393ab8c7dc0527586d34881837924cbb0026.tar.bz2
gencodes.c (output_predicate_decls): New function.
* gencodes.c (output_predicate_decls): New function. (main): Call it. * machmode.h (GET_MODE_MASK): Arrange for it to be defined even if it is not the first time machmode.h is #included. * config/sh/sh.c (fpul_operand): Declare MODE argument. * tm.texi (PREDICATE_CODES): Document predicate declarations. * gcc.texi (Copyright): Added 2001. From-SVN: r38673
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/sh/sh.c3
-rw-r--r--gcc/gcc.texi3
-rw-r--r--gcc/gencodes.c29
-rw-r--r--gcc/machmode.h14
-rw-r--r--gcc/tm.texi3
6 files changed, 55 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa8e677..7c91711 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2001-01-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * gencodes.c (output_predicate_decls): New function.
+ (main): Call it.
+ * machmode.h (GET_MODE_MASK): Arrange for it to be defined
+ even if it is not the first time machmode.h is #included.
+ * config/sh/sh.c (fpul_operand): Declare MODE argument.
+ * tm.texi (PREDICATE_CODES): Document predicate declarations.
+ * gcc.texi (Copyright): Added 2001.
+
2001-01-03 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (c_common_lang_init): New function. Warn if format
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index ee64d78..ec88c59 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1,5 +1,5 @@
/* Output routines for GCC for Hitachi Super-H.
- Copyright (C) 1993, 1994, 1995, 1997, 1997, 1998, 1999, 2000
+ Copyright (C) 1993, 1994, 1995, 1997, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
Improved by Jim Wilson (wilson@cygnus.com).
@@ -4793,6 +4793,7 @@ fpscr_operand (op, mode)
int
fpul_operand (op, mode)
rtx op;
+ enum machine_mode mode;
{
return (GET_CODE (op) == REG
&& (REGNO (op) == FPUL_REG || REGNO (op) >= FIRST_PSEUDO_REGISTER)
diff --git a/gcc/gcc.texi b/gcc/gcc.texi
index 3cf16f6..7348cd7 100644
--- a/gcc/gcc.texi
+++ b/gcc/gcc.texi
@@ -100,7 +100,8 @@ Published by the Free Software Foundation@*
59 Temple Place - Suite 330@*
Boston, MA 02111-1307 USA
@sp 1
-Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001 Free Software Foundation, Inc.
@sp 1
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index ab96d96..2df6f30 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -2,7 +2,7 @@
- some macros CODE_FOR_... giving the insn_code_number value
for each of the defined standard insn names.
Copyright (C) 1987, 1991, 1995, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
static int insn_code_number;
static void gen_insn PARAMS ((rtx));
+static void output_predicate_decls PARAMS ((void));
static int print_md_constant PARAMS ((void **, void *));
static void
@@ -46,6 +47,30 @@ gen_insn (insn)
insn_code_number);
}
+/* Print out declarations for all predicates mentioned in
+ PREDICATE_CODES. */
+
+static void
+output_predicate_decls ()
+{
+#ifdef PREDICATE_CODES
+ static struct {
+ const char *name;
+ RTX_CODE codes[NUM_RTX_CODE];
+ } *p, predicate[] = {
+ PREDICATE_CODES
+ {NULL, {}}
+ };
+
+ putc ('\n', stdout);
+ puts ("struct rtx_def;\n#include \"machmode.h\"\n");
+ for (p = predicate; p->name; p++)
+ printf ("extern int %s PARAMS ((struct rtx_def *, enum machine_mode));\n",
+ p->name);
+ putc ('\n', stdout);
+#endif
+}
+
extern int main PARAMS ((int, char **));
int
@@ -91,6 +116,8 @@ from the machine description file `md'. */\n\n");
traverse_md_constants (print_md_constant, stdout);
+ output_predicate_decls ();
+
printf ("\n#endif /* MAX_INSN_CODE */\n");
fflush (stdout);
diff --git a/gcc/machmode.h b/gcc/machmode.h
index e565cb7..230d8b0 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -1,5 +1,5 @@
/* Machine mode definitions for GNU C-Compiler; included by rtl.h and tree.h.
- Copyright (C) 1991, 1993, 1994, 1996, 1998, 1999, 2000
+ Copyright (C) 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -96,7 +96,9 @@ extern const unsigned int mode_unit_size[];
extern const unsigned int mode_bitsize[];
#define GET_MODE_BITSIZE(MODE) (mode_bitsize[(int) (MODE)])
-#ifdef HOST_WIDE_INT
+#endif /* not HAVE_MACHINE_MODES */
+
+#if defined HOST_WIDE_INT && ! defined GET_MODE_MASK
/* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */
@@ -105,7 +107,10 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[];
#define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
-#endif /* HOST_WIDE_INT */
+#endif /* defined (HOST_WIDE_INT) && ! defined GET_MODE_MASK */
+
+#if ! defined GET_MODE_WIDER_MODE || ! defined GET_MODE_ALIGNMENT \
+ || ! defined GET_CLASS_NARROWEST_MODE
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
@@ -153,4 +158,5 @@ extern enum machine_mode byte_mode;
extern enum machine_mode word_mode;
extern enum machine_mode ptr_mode;
-#endif /* not HAVE_MACHINE_MODES */
+#endif /* ! defined GET_MODE_WIDER_MODE || ! defined GET_MODE_ALIGNMENT
+ || ! defined GET_CLASS_NARROWEST_MODE */
diff --git a/gcc/tm.texi b/gcc/tm.texi
index 41f7fd7..59b03ea 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -7576,6 +7576,9 @@ thus speeding up the compiler. The most important predicates to include
in the list specified by this macro are those used in the most insn
patterns.
+For each predicate function named in @var{PREDICATE_CODES}, a
+declaration will be generated in @file{insn-codes.h}.
+
@item SPECIAL_MODE_PREDICATES
@findex SPECIAL_MODE_PREDICATES
Define this if you have special predicates that know special things